• 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

Macro on a timer

BadPuss

Member
I am looking to run a macro, which then reruns itself after say, 2 hours.
This was suggested:

sub main
:MainLoop

< all the other code and such is here >

/call restart
/goto :MainLoop
/return

Sub restart
/declare restart_time int local ${Math.Calc[${Math.Rand[60]}+120]}
/delay ${restart_time}m
/return


But it does nothing...
Any suggestions?
 
If I was having trouble with this routine, I'd add something like:
Rich (BB code):
Sub restart
  /declare restart_time int local ${Math.Calc[${Math.Rand[60]}+120]} 
  /echo > Restarting in ${restart_time} minutes...
  /delay ${restart_time}m 
/return
If you don't get the echo, you know you're not reaching the routine. If you do get the echo, it should delay that many minutes.
 
Rerun, as in keep running till the time frame ends, then restart itself?

Or do you mean to pause all activity for that time frame then continue?

Assuming you just want to issue the /macro <whatever> after a specified time frame I would look into the "/timed" command. It keeps track of the time even if the parent macro ends and executes after the time has been met.

/timed <timeframe> /endmac (clears the stack)
/timed <timeframe+a second or two> /macro <whatever> (fresh restart)
 
Rich (BB code):
Sub main
/declare restartallover timer outer 120m

:mainloop
..... lots of cool things you want to do for 2 hours or whatever time above timer is set to.....
/if (!${restartallover}) /mac macroname
/goto :mainloop
 
Macro on a timer

Users who are viewing this thread

Back
Top
Cart