• You've discovered RedGuides 📕 an EverQuest multi-boxing community 🛡️🧙🗡️. We want you to play several EQ characters at once, come join us and say hello! 👋
  • IS THIS SITE UGLY? Change the look. To dismiss this notice, click the X --->

Timer in Macro (Global I Think?) (1 Viewer)

Xzero

New member
Joined
May 28, 2006
RedCents
Hi guys, hopefully one of you will be able to help me out with this.

What I would like to do is have my macro stop running it's main loop and execute specified commands every 10 minutes. I'm just not sure how to set this up.

Thanks in Advance.

X
 
Rich (BB code):
sub main
:loop
....commands here....
/delay 10m
/goto :loop
/return

If you first want to wait 10m, then do the commands, put them after the /delay 10m, not before.
 
Basic timer handling is done like this

Rich (BB code):
Sub Main
  /declare MyTimer timer outer 10m

  :loop
  /delay 5
  /goto :loop
/return

Sub Event_Timer(Timer,OriginalValue)
   /if (${Defined[Timer]}) {
      /if (${Timer.Equal[MyTimer]}) {
           /echo do "MyTimer" handling here
      }
   }
/return
In sub Main we define the timer and its countdown value.

In Sub Event_Timer we check to see if the timer has been triggered (by counting down to zero). If it has reached zero this sub will be called with the name (string value) and the Original timer countdown value (integer). Inside the event sub we simply check to see if the timer name equals the timer we want to handle then branch appropriately.

Timer handling has one major restriction, there can only be one handler sub routine per macro (this includes all inc files etc)


Due to the timers limitation of only being able to call only one handler (within all includes and mac file) I used a branching method in my "routines.inc" file. If I need a timer handler within the macro and/or includes I simply define the variable then it knows to try and process them in each specialized timer handler.


Rich (BB code):
Sub Event_Timer(Timer,OriginalValue)
   /if (${Defined[IRCTIMERHANDLER]}) /call IRC_Timer "${Timer}" "${OriginalValue}"
   /if (${Defined[CLASSTIMERHANDLER]}) /call Class_Timer "${Timer}" "${OriginalValue}"
   /if (${Defined[MACROTIMERHANDLER]}) /call Macro_Timer "${Timer}" "${OriginalValue}"
/return


Hope this helps.
 
Timer in Macro (Global I Think?)

Users who are viewing this thread

Back
Top