ScriptUO
Official ScriptUO EasyUO Scripts => Script Debug => Topic started by: rbestone on March 29, 2014, 04:17:25 PM
-
looking for info about using an object located at -1, -2 of your character in a field of same type objects.
im working on a fishing script that picksup and replaces traps. i can get it to do everything except, it just picks up random traps instead of the one i want. i cant figure out how to make it see a specific spot, based off my char position.
7pick&replace:
findItem CZZ G_ 5 ;i dont know how to make this - or + charpos instead of ground 5
if #findKind = -1
{
wait 10
goto trap
}
else
{
set #ltargetKind
set #lobjectID #findID
set #ltargetKind 1
event macro 17 0
wait 10
set #lTargetX #charposx + +1 ; i know its to late here
set #lTargetY #charposy + -1 ; and here
set #lTargetZ 1
wait 25
-
When you do a "finditem" command, you also get information about where the item is located and that is returned in #FINDX, #FINDY and #FINDZ. If you subtract your #CHARPOSX from #FINDX, you get a relative location of the item. Same goes for the Y and Z coords. This gives you an idea where the item is located relative to your position.
-
Hmm.... Probably the easiest method for you to work with would be to build individual Subs for Each Trap Location Based on Position.
Sub Trap1
Finditem CZZ G_5
if #Findcnt > 0
{
For #Findindex 1 #Findcnt ; Index's Through all the items That are Found of that Type within the Range
{
if #Findx = #Charposx - 2 && #Findy = #Charposy -1 ; here is where you setup your Coordinates
{
; DO STUFF
}
}
}
Return
Then you Could Build a Sub For Each Trap And when you wanted to pull a specific one you just Gosub to it.
Gosub Trap1
Gosub Trap2
Gosub Trap3
etc etc etc
-
thank you both for the info and explanation of how/why it works. i will give it a whirl and let you know.
-
They didn't let you know.
I fear that this all may have been an elaborate ruse to get you guys to waste valuable electrons on a response.
The fiend!