Updated follow.mac

Post your completed (working) macros here. Only for macros using MQ2Data syntax!

Moderator: MacroQuest Developers

Dregs
orc pawn
orc pawn
Posts: 20
Joined: Tue Dec 29, 2009 9:57 am

Updated follow.mac

Post by Dregs » Tue Dec 29, 2009 10:17 am

Hi, guys. Long time user, first time poster. Just thought I'd post this simple update I made to the follow.mac macro. The default one stays on even if you change targets. It would also continue running if you had no target while the /keypress up hold part was active.

This updated version will stop moving if you don't have a target and you were autorunning. It will also end if you change targets.

I must admit the idea just came to me. I have done limited testing, so if anyone notices any problems, please let me know.

Code: Select all

#turbo
Sub Main
/declare FollowWho string outer
/if (!${Target.ID}) {
   /echo You must select a target to follow
   /return
}
/varset FollowWho ${Target.Name}
/echo Following ${FollowWho}
   :Loop
      /if (${Target.Distance}>60) /keypress up hold
      /if (${Target.Distance}<40) /keypress up 
      /face fast
      /delay 2
   /if (${Target.ID} && ${Target.Name.Equal[${FollowWho}]}) /goto :Loop
   /keypress down
/return