Move to loc help.

Help section from before the user variable changes that broke all macros

Moderator: MacroQuest Developers

Shocks
a ghoul
a ghoul
Posts: 101
Joined: Tue Feb 18, 2003 3:26 pm
Contact:

Move to loc help.

Post by Shocks » Wed Jul 23, 2003 10:03 am

Im currently making a macro that I need to be able to move my char to a loc x,y. The bigest problem im having is getting a distance to the loc. Here is some code that Im using that I thought should work.

Sub main

/varset v71 $char(x)
/varset v72 $char(y)
/echo $distance($v71,$v72)

/return

Now this should return a value of 0.0 if I understand correctly. What it does return is wierd numbers. If anyone can help me find a good way to make a run to loc it would be a great help.

Valerian
a grimling bloodguard
a grimling bloodguard
Posts: 709
Joined: Sun Jul 28, 2002 3:29 am

Post by Valerian » Wed Jul 23, 2003 4:00 pm

try /echo $distance($char(y),$char(x))

EQ has a tendancy to reverse the x,y coords into y,x.

Shocks
a ghoul
a ghoul
Posts: 101
Joined: Tue Feb 18, 2003 3:26 pm
Contact:

Thanks

Post by Shocks » Wed Jul 23, 2003 7:57 pm

That was the trick works like a charm. Thanks a ton. I bashed my head on this for over a hour. Here I was getting the right responce but was giving it the wrong variables. I guess thats why you need to take some math other than basic .........


Thanks again

Shocks