• 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 - Calling/updating a var in a separate/module script

ButtKoWitz

Member
Joined
Mar 23, 2023
RedCents
342¢
Warning: I'm a Lua noob...

I'm wondering if there's a simple solution to what is, for me, becoming a total PITA. I have 6 toon specific scripts, one for each character in a group. The scripts primarily monitor/apply their buffs and request buffs as needed from others, and also handle a number of other toon-specific routines, such as gem'n/mem'n spells. I have a general "amBusy" var that a toon will set to true, such as when mem'n/gem'n/casting spells so that when other toons need a buff they'll check the caster's amBusy state, if true then they won't request anything.

I have a few other global bools that are used by all toons for general checks, such as for staying invis, breathing water, levitate, which run buff to use (running a druid), etc. these also seem to fail to work reliably.

Problem is I'm having trouble with reliably using globals (which I have in a general non-toon-specific script) that are called by the toon-specific scripts.

I've just started trying my hand at using modules. Yet to have any success with modules but I'm barely into that, with maybe 10 minutes in game trying to test.

Anywho long winded, the gist of my post is: What is a simple/best method for having bools that are "global" (accessible to all toon's scripts) and can be not only accessed but also the var values can be changed by each toon.

Globals? (seems iffy so far in my experience, sometimes works, sometimes maybe not)
Modules?
Events off mq.cmd("/dtell toon1 I'm Busy!")? -- works, semi-slowish programmatically, and my mq window gets spammy! :p

Thanks!
 
Warning: I'm a Lua noob...

I'm wondering if there's a simple solution to what is, for me, becoming a total PITA. I have 6 toon specific scripts, one for each character in a group. The scripts primarily monitor/apply their buffs and request buffs as needed from others, and also handle a number of other toon-specific routines, such as gem'n/mem'n spells. I have a general "amBusy" var that a toon will set to true, such as when mem'n/gem'n/casting spells so that when other toons need a buff they'll check the caster's amBusy state, if true then they won't request anything.

I have a few other global bools that are used by all toons for general checks, such as for staying invis, breathing water, levitate, which run buff to use (running a druid), etc. these also seem to fail to work reliably.

Problem is I'm having trouble with reliably using globals (which I have in a general non-toon-specific script) that are called by the toon-specific scripts.

I've just started trying my hand at using modules. Yet to have any success with modules but I'm barely into that, with maybe 10 minutes in game trying to test.

Anywho long winded, the gist of my post is: What is a simple/best method for having bools that are "global" (accessible to all toon's scripts) and can be not only accessed but also the var values can be changed by each toon.

Globals? (seems iffy so far in my experience, sometimes works, sometimes maybe not)
Modules?
Events off mq.cmd("/dtell toon1 I'm Busy!")? -- works, semi-slowish programmatically, and my mq window gets spammy! :p

Thanks!
No variable global or local in a Lua script can be accessed outside of that Lua process on that toon.

Any sharing of state that you want to do across toons or even across different Lua scripts on the same toon requires using either TLOs or some kind of commands/events/broadcasting like with dannet or eqbc or soon the new actor support
 
Was slowly coming to that conclusion after a number of hours toying with modules. Thanks for the reply!
 
Question - Calling/updating a var in a separate/module script

Users who are viewing this thread

Back
Top
Cart