What is wrong with this macro?

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

Moderator: MacroQuest Developers

CrackMe
decaying skeleton
decaying skeleton
Posts: 5
Joined: Sat Feb 08, 2003 2:19 pm

What is wrong with this macro?

Post by CrackMe » Wed Feb 19, 2003 11:03 am

Im pretty new to macro making and stole abit from diffrent macros and tried to make my own simple macro, but the part where haste fades doesnt work. What did I do wrong? It wont go to the sub event_speed it seems, the rest works just as intended
(My hotbutton 1
/target npc
/pause 10
/pet attack
I made it this way so I easy can change target without editing macro)

And another thing, if the pet isnt healed it doesnt ask for it again, I thought it would with this code?

Code: Select all

#define Pet.ID "$char(pet)" 
#Event speed "Your restless nature fades."

#include SpellSub.mac 
#include routines.mac


Sub Main
/echo Macro startet

:petcheck  
  /if $spawn(Pet.ID,hp,pct)<45 /call petheal
  /delay 5s  
  /call kill
  /goto :petcheck 
/return 


Sub Kill 
:kill 
  /press 1 
  /face
  /delay 90s 
  /press 3
/return 
/goto :petcheck

Sub petheal
:petheal
/g heal my pet please
/delay 13s
/return
/goto :petcheck


Sub Event_speed
/press esc
/press esc
/press f1
/sit off
/cast 5
/delay 7s
/press f1
/cast 5
/delay 7s
/return

Vendor001
Cheezily Banned
Cheezily Banned
Posts: 78
Joined: Wed Nov 13, 2002 1:37 pm

Post by Vendor001 » Wed Feb 19, 2003 6:36 pm

Hmm....you have a few strange things in here...

Do you really intend to only check your pet every 118+ seconds?

Your events will never go off if you don't have a /doevents. Try this slight modification(removed the unneeded labels...why have them if you dont use them?).

I would personally use a counter in the main loop to reduce the frequency of the pet heal request spam. Let me know if you want me to give it a shot.

Code: Select all

#define Pet.ID "$char(pet)" 
#Event speed "Your restless nature fades." 

#include SpellSub.mac 
#include routines.mac 


Sub Main 
/echo Macro started

:petcheck  
  /if n $spawn(Pet.ID,hp,pct)<45 /call petheal 
  /delay 5s  
  /call kill 
| Need to do the events sometime...here is good maybe
  /doevents
  /goto :petcheck 
/return 


Sub Kill 
  /echo Killing %t
  /press 1 
  /face 
| I'm killing it, but hope my pet doesn't die in the next 90 seconds
  /delay 90s 
  /press 3 
/return 
/goto :petcheck 

Sub petheal 
/g heal my pet please 
| Hoping pet doesn't die in the next 13 seconds....
/delay 13s 
/return 



Sub Event_speed 
/echo speed wore off
/press esc 
/press esc 
/press f1 
/sit off 
/cast 5 
/delay 7s 
/press f1 
/cast 5 
/delay 7s 
/return
[edit] doh...forgot you are supposed to have an "n" on numeric if statements....<sigh>