Goto Coordinates

Posted by Jcet on Tue 23 Apr 2002 03:39 PM — 2 posts, 15,151 views.

USA #0
First of all, there's coords like 123.-24(Location: * *.*)
3rd and 4th are the coord wilcards
1st one really has no purpose just say northwest, northeast etc

Sub SetLoc (TriggerName, TriggerLine, AWC)
world.SetVariable "Loca", AWC (2)
world.SetVariable "Locb", AWC (3)
End Sub

That code is set on the location trigger to make the loca and locb
(hit like goto 23.87)
Sub GotoCoords (AliasName, AliasLine, AWC)
dim DesA
dim DesB
DesA = AWC(1)
DesB = AWC(2)

' E +, W -, N -, S


if world.getvariable ("Loca") > DesA then
world.send "west"
elseif world.getvariable ("Loca") < DesA then
world.send "east"
elseif world.getvariable ("Locb") > DesB then
world.send "north"
elseif world.getvariable ("Locb") < DesB then
world.send "south"



end if


end sub

thats the code, all i really need is to put a loop in it, so when Loca reaches DesA to stop, and Locb reaches DesB of course, stop.

not sure exactly how and where to put a loop in there.
Australia Forum Administrator #1
Do you mean to keep walking until you get there? In that case you don't really want a loop, you want to keep doing it until you are there.

There was a lengthy post a while back about a "wilderness walker" or something like that, that did something very similar.