Location Check

dobey

Lifetimer
Joined
Sep 27, 2007
Messages
129
Reaction score
10
Points
18
In my macro I am trying to run to a location, and then verify I am there.

I have used delays, but I really want to check that I have arrived.

Code:
   /moveto Loc -600 600

   :moveloop

      /if (${Me.Moving}) {
         /goto :moveloop
      }
I am using this and it works ok, but if I get stuck on anything for a second it thinks I have arrived and goes to the next part of the macro. What is the best way to actually check that I am at that location? It will need a small range as the /moveto isn't exact in its stopping point by a few numbers.
 

dobey

Lifetimer
Joined
Sep 27, 2007
Messages
129
Reaction score
10
Points
18
Perfect, this is exactly what I needed thanks so much!

Code:
   /moveto Loc -600 600

   :minimoveloop

      /if (${Math.Distance[-600, 600]}>10) {
         /goto :minimoveloop
      }
 

dewey2461

Developer
Joined
May 4, 2008
Messages
1,805
Reaction score
180
Points
63
You may also want to consider adding a /delay 1 inside the loop

You could also do a conditional with the /delay 10s !${Math.Distance[600 600]<10}

Have to triple check the conditional as I always get them mixed up.
 
Last edited: