movetotarg and movetoloc - 2 Uselful Macros for Movement

A forum for you to dump all the macros you create, allowing users to use, modify, and comment on your work.

Moderator: MacroQuest Developers

gn0m3
a lesser mummy
a lesser mummy
Posts: 39
Joined: Sat Dec 13, 2003 10:43 am

...

Post by gn0m3 » Sat Dec 27, 2003 12:03 pm

FYI, you have your locs reversed. It's:

$distance(y,x) and /face y x

So your macro runs you in circles. I added a max dist from point check, and fixed that problem and it's much better now:

Code: Select all

Sub main 
/declare Xloc local 
/declare Yloc local 
/varset Yloc @Param0 
/varset Xloc @Param1 

/declare MaxDistFromLoc global
/varset MaxDistFromLoc 150
/declare ObstCount local 
/varset ObstCount 0 
/declare distance1 local 
/declare distance2 local 
/declare distanceSum local 
/varset distanceSum 0 
/declare distanceSum1 local 
/varset distanceSum1 0 
/declare distanceAverage local 

:locloop 
/face loc @Yloc, @Xloc 
/if "@yloc"=="u" /Press u 
/call AutoRun 1 

/varset distance1 $distance(@Yloc,@Xloc) 
/delay 1s 
/varset distance2 $distance(@Yloc,@Xloc) 
/varset distanceSum $calc(@distance1-@distance2) 
/delay 1s 

/varset distance1 $distance(@Yloc,@Xloc) 
/delay 1s 
/varset distance2 $distance(@Yloc,@Xloc) 
/varset distanceSum1 $calc(@distance1-@distance2) 


/if n $calc(@distanceSum-3)>@distanceSum1 { 
/if n $calc(@distanceSum+3)<@distanceSum1 { 
/varadd ObstCount 1 
} 
} 

/if n @distanceSum==0 /if n @distanceSum1==0 /varadd ObstCount 1 
/if n @ObstCount>=3 { 
/call Collision 
/varset ObstCount 0 
} 

/if n $distance(@Yloc,@Xloc)>@MaxDistFromLoc /goto :locloop 

/call autorun 0 
/return 

Sub Collision 
/if n $rand(99)>50 { 
/delay 1s 
/sendkey up down 
/sendkey down Right 
/delay 5 
/sendkey up Right 
/sendkey down up 
/delay 1s 
/sendkey up up 
} else { 
/delay 1s 
/sendkey up down 
/sendkey down left 
/delay 5 
/sendkey up left 
/sendkey down up 
/delay 1s 
/sendkey up up 
} 
/return 

Sub AutoRun 
/if @Param0==1 /sendkey down up 
/if @Param0==0 /sendkey up up 
/return 


battaile
Contributing Member
Contributing Member
Posts: 40
Joined: Tue Dec 09, 2003 10:55 am

Gong

Post by battaile » Sat Jan 10, 2004 1:55 am

Zerix wrote:check out the FH forms, theres a stickly link there that has this exact same macro in it, cept it uses warp.

Lets you get a targets XYZ, and then lets you warp to it.
Troll trying to act like he has level two access on FH. Get a life.

SkiD_PL8
decaying skeleton
decaying skeleton
Posts: 5
Joined: Fri Dec 26, 2003 4:54 am

Post by SkiD_PL8 » Sat Jan 10, 2004 10:57 am

Go easy on him he is still trying to forever hack his level 2 access :lol:
______________________________________
Mind over matter, if you don't mind it doesn't matter...

coil
decaying skeleton
decaying skeleton
Posts: 9
Joined: Sun Feb 01, 2004 3:04 am

Re: ...

Post by coil » Wed Feb 04, 2004 7:03 pm

ok i'm very new to this whole programing thing and i'm trying my best to write a Tradeskill macro that once its out of supplies will go to a merchant buy more. the promblem comes into to play when i try getting the toon to move... I'm using this snippet to get to a new loc and i dont understand this part of it. Why this section of code is there. Can someone pls explain?

:locloop
/face loc @Yloc, @Xloc
/if "@yloc"=="u" /Press u
/call AutoRun 1