How to find out if there is any kind of obejct on the ground
Moderators: Murderator+, Murderator
How to find out if there is any kind of obejct on the ground
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?
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
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
-
- Junior Expert
- Posts: 3221
- Joined: 2004-06-24 22:08:56
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: Select all
; 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.
Telegram: @tatikom
Function not found?
Possession of mathematics at the level of art - a gift that is only available for election.
Sorry for my clumsy English.
Telegram: @tatikom
Re: How to find out if there is any kind of obejct on the gr
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
Основные команды языка Injection
Yoko Injection Code Sweeper
Drw (2009) скрипты
2017 Начал играть на Uorpg.net
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: Select all
; 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
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
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
Feel the Power of Dark Side
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:)
-
- Junior Expert
- Posts: 3221
- Joined: 2004-06-24 22:08:56
Try to search something like AStar alg.
Also u can see/modify existing walkers.
See this post: viewtopic.php?p=66813#66813
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.
Telegram: @tatikom
Function not found?
Possession of mathematics at the level of art - a gift that is only available for election.
Sorry for my clumsy English.
Telegram: @tatikom
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
Feel the Power of Dark Side