• You've discovered RedGuides, an EverQuest multi-boxing and scripting community 🧙‍♀️⚙️. We want you to play several EQ characters at once, come join us and say hello! 👋

  • A TLP without truebox has thawed (Very Vanilla ready)
    Frostreaver

Question - Modifying Global Variables from a hotkey

Joined
May 19, 2015
RedCents
1,294¢
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