follow.mac *New PARM Version*

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

Moderator: MacroQuest Developers

pcgear
decaying skeleton
decaying skeleton
Posts: 1
Joined: Fri Apr 23, 2004 10:17 pm

follow.mac *New PARM Version*

Post by pcgear » Fri Apr 23, 2004 10:21 pm

Here is my translation of follow.mac.

Code: Select all

#turbo
Sub Main
   :Loop

      /if (${Target.Distance}>60) /keypress forward hold
      /if (${Target.Distance}<40) /keypress forward
      /face fast
   /if (${Target.ID}) /goto :Loop

/return

bob_the_builder
a hill giant
a hill giant
Posts: 275
Joined: Tue Jul 22, 2003 1:22 pm

Post by bob_the_builder » Fri Apr 23, 2004 11:38 pm

#turbo is implied default #turbo 20

And if were re doing it give it a Param0

Code: Select all

| /macro follow <distance> 

Sub Main 
   /declare TheDistance global 
   /varset TheDistance @Param0 
   /if (!${Defined[Param0]}) {
      /varset TheDistance 20 
      /echo Using default distance of 20
      /echo Useage: /macro follow <distance>
   }
   /popup I am following ${Target.Name}
   
   :Loop 
   /if (${Target.Distance}>@TheDistance) /keypress forward hold 
   /if (${Target.Distance}<@TheDistance) /keypress forward 
   /if (${Target.Distance}<=${Math.Calc[@TheDistance-5]}) /keypress back hold 
   /face fast 
   /if (${Target.ID}) /goto :Loop 

   :Stopping
   /keypress forward 
   /popup I stopped following !!
/return  
/mac follow 20

Bob
Last edited by bob_the_builder on Sun Apr 25, 2004 9:48 pm, edited 2 times in total.

fantum409
a ghoul
a ghoul
Posts: 141
Joined: Fri Nov 14, 2003 10:03 pm

Was just posting a request fr this one BTW, thanks guys

Post by fantum409 » Sat Apr 24, 2004 10:01 am

the first version works good, but bob_the_builder's gives error about nonnumeric encountered. I'm noob to this, not sure how to fix but the param idea does sound useful.

Preocts
a snow griffon
a snow griffon
Posts: 312
Joined: Thu Jan 29, 2004 1:02 pm

Post by Preocts » Sat Apr 24, 2004 10:22 am

bob_the_builder wrote:#turbo is implied default #turbo 20

And if were re doing it give it a Param0

Code: Select all

| /macro follow <distance>

Sub Main
   /declare TheDistance global
   /varset TheDistance @param0 
   
   :Loop 
   /if (${Target.Distance}>@TheDistance) /keypress forward hold 
   /if (${Target.Distance}<@TheDistance) /keypress forward 
   /if (${Target.Distance}<=${Math.Calc[@TheDistance-5]}) /keypress back hold 
   /face fast 
   /if (${Target.ID}) /goto :Loop 

/return 
/mac follow 20

Bob
Would just like to add:

Code: Select all

/if (!${Defined[Param0]}) /return |Or do something about no param
Through personal experience, and reloading EQ about 564 times in one long ass day, I discovered just how much of a mess NOT checking to see if @Param0 is actually defined causes.
Thankfully once Lax breaks all our macros again this won't be a problem :wink:

MikeDVB
decaying skeleton
decaying skeleton
Posts: 5
Joined: Tue Apr 13, 2004 1:32 pm

Post by MikeDVB » Sun Apr 25, 2004 8:56 pm

Code: Select all

| /macro follow <distance> 

Sub Main 
   /declare TheDistance global 
   /varset TheDistance @Param0 
   /if (!${Defined[Param0]}) /varset TheDistance 10
    
   :Loop 
   /if (${Target.Distance}>@TheDistance) /keypress forward hold 
   /if (${Target.Distance}<@TheDistance) /keypress forward 
   /if (${Target.Distance}<=${Math.Calc[@TheDistance-5]}) /keypress back hold 
   /face fast nolook
   /if (${Target.ID}) /goto :Loop 

/keypress forward
/return 
keeps you from keeping running when target is lost, and fixes the Param problem

Also added nolook so that it doesn't look straight up

Edit:
this is really good for a melee in an aggro-kite group

or if you add autoarchery to it and increase the range... =) lol

eluminate
orc pawn
orc pawn
Posts: 16
Joined: Wed Apr 28, 2004 4:20 am

Post by eluminate » Wed Apr 28, 2004 4:24 am

works great

MikeDVB
decaying skeleton
decaying skeleton
Posts: 5
Joined: Tue Apr 13, 2004 1:32 pm

Post by MikeDVB » Thu May 20, 2004 12:52 pm

Fixed for latest MQ2Data

Code: Select all

| /macro follow <distance> 

Sub Main 
   /declare TheDistance outer 
   /varset TheDistance ${Param0} 
   /if (!${Defined[Param0]}) /varset TheDistance 10 
    
   :Loop 
   /if (${Target.Distance}>${TheDistance}) /keypress forward hold 
   /if (${Target.Distance}<${TheDistance}) /keypress forward 
   /if (${Target.Distance}<=${Math.Calc[${TheDistance}-5]}) /keypress back hold 
   /face fast nolook 
   /if (${Target.ID}) /goto :Loop 

/keypress forward 
/return