• Hail, we're RedGuides. We want you to play six (yes, 6!) EverQuest characters at once. We have scripts and a friendly community to help, please join our playstyle and say hello! 👋
  • We've added LLM sections to our Terms & Rules and Resource Rules, for everyone's sanity & in-game safety.
    Read more
    a. Do not replace your voice with an LLM. This goes for your posts and your scripts. Drafting and editing with a tool is fine, but don't take you out of what you share.
    b. Do not replace your EQ character's voice with an LLM. We don't want scripts that speak over /ooc, /shout or other public channels. This has been an unwritten rule that's kept casino scripts off the site for decades, but we're now compelled to make it clear: keep automated communication private.

    Why Does RG Review Scripts?
    Nearly every LLM-written Lua script we see is making your character do impossible things, and rarely in a way that's beneficial to you. We've seen heavy server hammering, /target over impossible distances when /nav spawn would passively accomplish the same thing, a spawn search that fires 20+ times per second, and other pointless actions that are likely annoying GMs.

    You are welcome to use LLMs as a tool to structure, draft, and edit your work, but please read critically before hitting /lua run

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

Xzero

New member
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
Cart