Yoko

All sides of Injection
It is currently 2025-10-16 08:43:48

All times are UTC+02:00




Post new topic  Reply to topic  [ 10 posts ] 
Author Message
PostPosted: 2009-12-02 20:31:31 
Offline

Joined: 2009-12-02 20:25:25
Posts: 5
Hello, I am finishing my mining script and now I need to do last thing... walking, on my shard it is nightmare because of rocks appearing on the ground. My idea is to scan the direction I want to go if there is a rock on the ground or not, if there is rock, try to find different path. I hope it is clear what I need. Some function like IsThereObjectOnTheGround, is in inject something like that?


Top
   
 Post subject:
PostPosted: 2009-12-03 13:22:00 
Offline

Joined: 2009-02-09 17:12:23
Posts: 38
Can you get information with command ,info?
,info -> Target that rock or something -> Does info shows up?


Top
   
 Post subject:
PostPosted: 2009-12-03 15:02:05 
Offline

Joined: 2009-12-02 20:25:25
Posts: 5
yes it does show info.
now I found this
,findtype type [color container_object|ground|my] - seek for object and point finditem on it if found.
Number of item stacks found may be retrieved by uo.findcount()

this is almost what I need, the only trouble is that it is scaning all the squares in finddistance, just if I can set the coords where it should scan, it will be great


Top
   
 Post subject:
PostPosted: 2009-12-03 18:27:02 
Offline
Junior Expert
User avatar

Joined: 2004-06-24 22:08:56
Posts: 3220
solin wrote:
yes it does show info.
now I found this
,findtype type [color container_object|ground|my] - seek for object and point finditem on it if found.
Number of item stacks found may be retrieved by uo.findcount()

this is almost what I need, the only trouble is that it is scaning all the squares in finddistance, just if I can set the coords where it should scan, it will be great

Is'nt supported.

You must search using finddistance and filter search results.

e.g.:
Code:
; rock description
var rock_type = '0x0000'
var rock_colr = '0x0000'
; search tile x,y
var tile_x = 1500
var tile_y = 1600
var result = false
uo.ignorereset()
uo.findtype( rock_type, rock_colr, 'ground' )
while uo.findcount()
    if uo.getX( 'finditem' ) == tile_x and uo.getY( 'finditem' ) == tile_y then
        result = true
    endif
    uo.ignore( 'finditem' )
    uo.findtype( rock_type, rock_colr, 'ground' )
wend
if result then
    ; rock was found in defined coordinates
else
    ; rock wasnt found
endif

_________________
YokoInjection CodeSweeper
Function not found?
Possession of mathematics at the level of art - a gift that is only available for election.
Sorry for my clumsy English.
Skype: d119060


Top
   
PostPosted: 2009-12-03 19:58:15 
Offline
Expert!
User avatar

Joined: 2005-09-14 15:31:58
Posts: 2152
Location: Latvia
solin wrote:
Hello, I am finishing my mining script and now I need to do last thing... walking, on my shard it is nightmare because of rocks appearing on the ground. My idea is to scan the direction I want to go if there is a rock on the ground or not, if there is rock, try to find different path. I hope it is clear what I need. Some function like IsThereObjectOnTheGround, is in inject something like that?


This will not work.
Use already known walkers.

_________________
Уроки языка Injection
Основные команды языка Injection
Yoko Injection Code Sweeper
Drw (2009) скрипты
2017 Начал играть на Uorpg.net


Top
   
 Post subject:
PostPosted: 2009-12-03 22:19:24 
Offline

Joined: 2009-12-02 20:25:25
Posts: 5
Destruction wrote:
solin wrote:
yes it does show info.
now I found this
,findtype type [color container_object|ground|my] - seek for object and point finditem on it if found.
Number of item stacks found may be retrieved by uo.findcount()

this is almost what I need, the only trouble is that it is scaning all the squares in finddistance, just if I can set the coords where it should scan, it will be great

Is'nt supported.

You must search using finddistance and filter search results.

e.g.:
Code:
; rock description
var rock_type = '0x0000'
var rock_colr = '0x0000'
; search tile x,y
var tile_x = 1500
var tile_y = 1600
var result = false
uo.ignorereset()
uo.findtype( rock_type, rock_colr, 'ground' )
while uo.findcount()
    if uo.getX( 'finditem' ) == tile_x and uo.getY( 'finditem' ) == tile_y then
        result = true
    endif
    uo.ignore( 'finditem' )
    uo.findtype( rock_type, rock_colr, 'ground' )
wend
if result then
    ; rock was found in defined coordinates
else
    ; rock wasnt found
endif


this was very usefull, thanks


Top
   
 Post subject:
PostPosted: 2009-12-06 03:35:35 
Offline
User avatar

Joined: 2007-11-01 19:09:30
Posts: 287
Location: Moscow
findtype does not work for static objects
use injection.dll of version 505.18 and use function uo.privategettile
You can find out how it works by search on this forum

_________________
**Выставляем отступы в скриптах*** ©Destruction
Feel the Power of Dark Side


Top
   
 Post subject:
PostPosted: 2009-12-06 19:04:33 
Offline

Joined: 2009-12-02 20:25:25
Posts: 5
CuHTpoH wrote:
findtype does not work for static objects
use injection.dll of version 505.18 and use function uo.privategettile
You can find out how it works by search on this forum


Yes that was new to me, I have findtype for the rock searching and I am using privategettile for searching the possible mining spots and paths, I have this done, now I need to think about some clever walking alg, but now when I have these searching tools, it should not be big problem:)


Top
   
 Post subject:
PostPosted: 2009-12-07 11:10:44 
Offline
Junior Expert
User avatar

Joined: 2004-06-24 22:08:56
Posts: 3220
Try to search something like AStar alg.

Also u can see/modify existing walkers.

See this post: viewtopic.php?p=66813#66813

_________________
YokoInjection CodeSweeper
Function not found?
Possession of mathematics at the level of art - a gift that is only available for election.
Sorry for my clumsy English.
Skype: d119060


Top
   
 Post subject:
PostPosted: 2009-12-07 11:19:59 
Offline
User avatar

Joined: 2007-11-01 19:09:30
Posts: 287
Location: Moscow
imho if you wanna really good walker, the only way to do your own or use perl injection pathfinder on 2.0.3 :)

_________________
**Выставляем отступы в скриптах*** ©Destruction

Feel the Power of Dark Side


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 10 posts ] 

All times are UTC+02:00


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Limited