• 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 - Modifying Global Variables from a hotkey

Looked around a bit, but wondering if any Lua wizard can throw me a quick suggestion on this.

Have a hotkey in game that I want to send a variable update to a Lua script. The variable is global in the Lua and the script is kept running in the background at all time (doesn't terminate). This works if I have the variable inside a macro, but cant seem to locate a / command to edit variables that are stored inside LUAs.

Example Hotkey:
Code:
/varset Variable1 Active

Lua: *this is not the code for the script but just a quick reference to show what I am meaning*
Code:
local mq = require('mq')

Variable1 = nil


while not terminate do

print(Variable1)

end
 
it is probably very very very much a better idea to create a bind and then issue changing your variable with that bind

/evian dothis <value>

where /evian is your bind, dothis is what setting/variable you want to change and then <value> is what you change it to
 
Lua:
local function bind_evian(cmd, cmd2)
    if cmd == nil or cmd == 'help' then 
       help()
       return
    end
    do_changesetting(cmd, cmd2)
end
something like this is what i use in one of mine
 
Question - Modifying Global Variables from a hotkey

Users who are viewing this thread

Back
Top
Cart