• 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

Question - Declaring a timer in lua

Soandso2

Well-known member
So, there is a timer datatype. The values are normal integers, but the timer has a feature that makes it automatically count down to zero directly after being set. https://docs.macroquest.org/reference/data-types/datatype-timer/?h=timer

In macroscript you declare timers like this:
timer in macroscript
Code:
/declare BuffTimer timer local
/varset BuffTimer 360

But in Lua you dont declare datatypes (as far as this here noob understands things)

How do I tell my Lua that "this variable, that currently holds an integer, is and should behave, like a timer"? I googled and found the question asked, but no answer given,
 
Yeah, that is one of the answers that I found when I googled. But this is code for making your own timers, right? Not using the timer that already exists as a macroquest datatype? Or am I failing to understand the documentation completely?
 
Well I'm not sure that you can make one like that. There were several examples of timers present and I'm sure one will fullfill the need. In Lua you declare variables in Lua, and you don't declare macro variables that I'm aware of, so presumably you'd need to use a method of creating timers that is used in Lua.
 
Right, so the easy method possible in macroscript simply isnt possible in Lua. Fair enough. Thanks for the clarification. :)
 
Question - Declaring a timer in lua

Users who are viewing this thread

Back
Top
Cart