Another timer question for my mage macro heh

Need help with a macro you are writing? Ask here!

Moderator: MacroQuest Developers

showme1
a ghoul
a ghoul
Posts: 138
Joined: Wed Dec 17, 2003 5:51 pm

Another timer question for my mage macro heh

Post by showme1 » Mon Jun 28, 2004 3:00 pm

I read the timer questions in this thread to try and make sense of it, but I'm just not getting it to apply to my macro well. Right now my macro works perfect for what i want if I comment out the Sub ManaCheck...

Code: Select all

Sub ManaCheck 
  /if (${Me.PctMana}<=88) {
  /call cast "Rod of Mystical Transvergance" item
  } 
/return
and the Sub Event_Timer...

Code: Select all

Sub Event_Timer
  /if (${tmrName.Equal["Rodtimer"]}) { 
but I can't figure out how to complete these two bits of code or combine them to one if that would be better. Here is my full macro for it to make more sense...

Code: Select all

#Event exp "#*#experience!!#*#"    
#Event rageon "#*#has become ENRAGED#*#" 
#Event rageoff "#*#is no longer enraged#*#" 
#Event burn "#*#burnout V spell has worn off#*#" 
#Event nuke1 "#*#Nuke 1#*#" 
#Event nuke2 "#*#Nuke 2#*#"
#Event nuke3 "#*#Nuke 3#*#"

#include spellcast.inc 

Sub Main 
/declare assist outer 
/echo Assisting ${Param0} 

/declare sentpet outer 
/varset sentpet 0 

/declare MaloCast outer 
/varset MaloCast 0 

/declare BoltCast outer 
/varset BoltCast 0 

/declare BoltCastB outer 
/varset BoltCastB 0 

/declare BoltCastC outer 
/varset BoltCastC 0

/declare BoltCastD outer 
/varset BoltCastD 0 
 
/declare BurnOut outer 
/varset BurnOut 0 

/declare NukeAmount outer 
/varset NukeAmount 4

/declare RodTimer timer outer 0
/varset RodTimer 5m 

:MainLoop 
/assist ${Param0} 
/call BuffCheck 
/if (${String[${BurnOut}].Equal[0]}) { 
  /echo Casting Burnout V 
  /if (${String[${Me.State}].Equal[SIT]}) { 
    /stand 
    /delay 1s 
  } 
  /delay 3s 
  /call cast "Burnout V" 
  /delay 5 
  /doevents 
  /varset BurnOut 1  
} 
/call ManaCheck 
/if (${Target.ID} && ${Target.PctHPs}<=97) { 
  /if (${String[${Target.Type}].Equal[NPC]}) { 
    /if (${sentpet}==0) { 
      /pet attack 
      /varset sentpet 1 
      /echo Pet Sent 
    } 
      /if (${MaloCast}==0) { 
        /call Malo 
    }
  }
}
  /if (${Target.PctHPs}<=97 && ${Target.PctHPs}>=90 && ${String[${Target.Type}].Equal[NPC]}) { 
    /if (${BoltCast}==0) { 
      /if (${String[${Me.State}].Equal[SIT]}) { 
        /stand 
        /delay 1s 
      }
      /echo this is cast 1  
      /call cast "Sun Vortex" 
      /varset BoltCast 1 
      /doevents 
    } 
  } 
  
  /if (${Target.PctHPs}<=70 && ${Target.PctHPs}>=60 && ${String[${NukeAmount}].Equal[4]}) { 
    /if (${BoltCastB}==0) { 
      /if (${String[${Me.State}].Equal[SIT]}) { 
        /stand 
        /delay 1s 
      }
      /echo this is cast 2 
      /call cast "Sun Vortex" 
      /varset BoltCastB 1  
      /doevents 
    } 
  }

  /if (${Target.PctHPs}<=40 && ${Target.PctHPs}>=30 && ${String[${NukeAmount}].Equal[4]}) { 
    /if (${BoltCastC}==0) { 
      /if (${String[${Me.State}].Equal[SIT]}) { 
        /stand 
        /delay 1s 
      }
      /echo this is cast 3 
      /call cast "Sun Vortex" 
      /varset BoltCastC 1  
      /doevents 
    } 
  }

  /if (${Target.PctHPs}<=13 && ${Target.PctHPs}>=5 && ${String[${NukeAmount}].Equal[4]}) { 
    /if (${BoltCastD}==0) { 
      /if (${String[${Me.State}].Equal[SIT]}) { 
        /stand 
        /delay 1s 
      }
      /echo this is cast 4 
      /call cast "Sun Vortex" 
      /varset BoltCastD 1 
      /doevents 
    } 
  }  
  
} 
/doevents 
/goto :MainLoop 
/return 

Sub Event_exp 
  /varset sentpet 0 
  /varset MaloCast 0 
  /varset BoltCast 0 
  /varset BoltCastB 0
  /varset BoltCastC 0
  /varset BoltCastD 0 
  /echo Mob is dead!!! Resetting Variables!!
  /pet hold 
/return 
 

Sub Malo 
  /call cast "Veil of Lost Hopes" item
  /if (${Macro.Return.Equal["CAST_SUCCESS"]}) { 
    /echo ${Target.Name} maloed.
    /varset MaloCast 1 
    /return 
  } else /if (${Macro.Return.Equal["CAST_RESISTED"]}) { 
    /delay 1
    /echo trying again with malosinia 
    /call Malo 
  } else 
    /echo check malo logic 
  } 
/return  

Sub ManaCheck 
  /if (${Me.PctMana}<=88) {
  /call cast "Rod of Mystical Transvergance" item
  } 
/return

Sub Event_Timer
  /if (${tmrName.Equal["Rodtimer"]}) { 

Sub Event_rageon 
  /echo %t is enraged. Backing pet off. 
  /pet back off
  /delay 2
  /pet hold 
/return 

Sub Event_rageoff 
  /doevents flush 
  /echo %t is no longer enraged. Sending pet. 
  /pet attack 
/return 

Sub BuffCheck 
  /if (!${Me.Buff[Elemental Siphon Recourse].ID}) { 
    /echo Casting Elemental Siphon 
    /call cast "Elemental Siphon" 
    /delay 5 
    /doevents 
  } 
  /if (!${Me.Buff[Khura's Focusing].ID} && !${Me.Buff[Focus of Soul].ID} && !${Me.Buff[Focus of the Seventh].ID} && !${Me.Buff[Talisman of Kragg].ID} && !${Me.Buff[Shield of Maelin].ID}) { 
  /echo Casting Shield of Maelin 
  /call cast "Shield of Maelin" 
} 
/doevents 
  /if (!${Me.Buff[Xegony's Phantasmal Guard].ID} && !${Me.Buff[Blessing of the Nine].ID} && !${Me.Buff[Protection of the Nine].ID}) { 
    /echo Casting Xegony's Phantasmal Guard 
    /call cast "Xegony's Phantasmal Guard" 
    /delay 5 
    /doevents 
    }
  /if (!${Me.Buff[Maelstrom of Ro].ID}) {
  /call cast "Maelstrom of Ro"
  } 
/return 

Sub Event_burn
  /target ${Me.Pet.CleanName}
  /delay 2s
  /call cast "burnout V"
/return

Sub Event_nuke1 
  /varset NukeAmount 1 
  /echo Nuking Once Per Fight 
/return 

Sub Event_Nuke2 
  /varset NukeAmount 2 
  /echo Nuking Twice Per Fight 
/return

Sub Event_Nuke3 
  /varset NukeAmount 3 
  /echo Nuking Three times Per Fight 
/return 
Basically what I'm shooting for is if I drop below 88%, (or whatever I decide), to use the mod rod then start a 5 minute timer so I dont get spammed with rod can not be used at this time or whatever lame message you get if the 5 minute reuse timer is not up yet. Make sense? I know I'm prolly making this confusing hehe. Some of this I came up with on my own and some I grabbed from here and there on the boards here. I have never used a timer ever in my easier macros so I can't seem to figure this out heh.

Any help filling in the blanks would be much much appreciated!!

When I get the timer part worked out I'm gonna add in another variable that will recast a new rod when the first one is gone, but for now I'd like to get this part working heh. Thanks for any hlep again!

(disclaimer)
This is NOT and afk macro and should NOT be used as such. I have it cause I like to chat with my buddies in our channel and I slack badly when I'm not paying full attention to the game. I'm always right infront of my screen when using this just incase things go crazy in my group. That is why there is no gate and end macro type subs in this.

noober
a lesser mummy
a lesser mummy
Posts: 71
Joined: Mon Mar 08, 2004 4:09 pm

Post by noober » Mon Jun 28, 2004 3:46 pm

Try this:

Code: Select all

Sub ManaCheck 
  /if (${Me.PctMana}<=88) { 
      /call cast "Rod of Mystical Transvergance" item
      [color=red]/varset Rodtimer 5m[/color]
  } 
/return
and this:

Code: Select all

Sub Event_Timer[color=red](tmrName)[/color] 
  /if (${tmrName.Equal["Rodtimer"]}) {[color=red]
      /call cast "Rod of Mystical Transvergance" item
      /varset Rodtimer 5m
  }
/return [/color]

Falco72
a hill giant
a hill giant
Posts: 215
Joined: Fri Sep 26, 2003 3:24 am

Post by Falco72 » Mon Jun 28, 2004 3:56 pm

Try this:

Code: Select all

Sub ManaCheck
  /if (${Me.PctMana}<=88 && ${Rodtimer}<=0) {
    /call cast "Rod of Mystical Transvergance" item
    /if (${Macro.Return.Equal["CAST_SUCCESS"]}) {
      /varset Rodtimer 3200
    }
  }
/return
You do not really need an event_timer to do this, you can check for it everytime you call ManaCheck.
Last edited by Falco72 on Mon Jun 28, 2004 4:00 pm, edited 1 time in total.

showme1
a ghoul
a ghoul
Posts: 138
Joined: Wed Dec 17, 2003 5:51 pm

Post by showme1 » Mon Jun 28, 2004 3:59 pm

with yours I'd get rid of the timer sub all together and just keep the manacheck sub right falco? also is my declare statement right at the top of the macro?

Falco72
a hill giant
a hill giant
Posts: 215
Joined: Fri Sep 26, 2003 3:24 am

Post by Falco72 » Mon Jun 28, 2004 4:03 pm

Sorry I edited my last post just while you was posting your reply.
You only need to declare it and leave it to zero. You will set it to 5 minutes (I prefer 3000 micro secs plus 200 for lag) first time you use it.

showme1
a ghoul
a ghoul
Posts: 138
Joined: Wed Dec 17, 2003 5:51 pm

Post by showme1 » Mon Jun 28, 2004 4:08 pm

ok will give this a try, thanks a ton you guys!

dok
a ghoul
a ghoul
Posts: 127
Joined: Mon Mar 15, 2004 3:38 pm

Post by dok » Mon Jun 28, 2004 4:09 pm

What I would do in your situation is remove the initial "/varset RodTimer 5m" because thats what actually starts the timer. You should only start the timer either just before or just after you use the Rod.

Next, in one of the following, you need to do a check to see if the timer <= 0. I'd put it in the place you /call ChackMana Sub (personally preferred with your code to skip any other checks), somewhere in the actual CheckMana Sub, or at the place you actually do the casting.

option 1

Code: Select all

/if (${RodTimer}<=0) /call CheckMana
option 2

Code: Select all

Sub ManaCheck 
  /if (${Me.PctMana}<=88 && ${RodTimer}<=0) { 
     /call cast "Rod of Mystical Transvergance" item 
     /varset RodTimer 5m
  } 
/return 
option 3

Code: Select all

Sub ManaCheck 
  /if (${Me.PctMana}<=88) { 
    /if (${RodTimer}<=0) {
      /call cast "Rod of Mystical Transvergance" item 
      /varset RodTimer 5m
    }
  } 
/return 

take your pick of whichever one you feel most comfortable with.


As far as the Event_Timer Sub, it shouldn't be necessary with using the above changes, but if you really want it, I'd do something like this instead (assuming your castspell function isn't returning an error)...

Code: Select all

#event NeedMoreTime "whatever the delay message is"
Sub Event_NeedMoreTime
    /if (${RodTimer}<=0) /varset RodTimer 5s
    |makes it check only every 5s to cast the rod instead of spamming every cycle.
/return

showme1
a ghoul
a ghoul
Posts: 138
Joined: Wed Dec 17, 2003 5:51 pm

Post by showme1 » Mon Jun 28, 2004 4:29 pm

got it working! thanks a ton you guys, now i understand it hehe. Now for me to work on click checks and recast a new rod after my first one is gone