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

ButtKoWitz

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

Users who are viewing this thread

Back
Top
Cart