• 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 - LEM for Aureate bane syntax question

I'd like to improve a LEM I use to trigger Aureate's Bane when my tank has the curse (I often run him manually with no plugin so a LEM is the best option). Unfortunately, the LEM I use right now suffers from the EQ bug where Aureate's Bane doesn't immediately dispell Curse of Subjugation and it therefore triggers needlessly for a while.

To get around that, I'd like to change it to only trigger if he has the curse AND he doesn't have the bane buff running. However, I'm very new to Lua and struggling to get the right syntax on the condition - so, after multiple failures I thought I'd ask some experts!

Any guidance appreciated! Thank you!

The LEM I am using is as follows (I've been trying to amend the line that says "local bane = mq.TLO.Me.Song('Subjugation')() or false" but it doesn't seem to like it if I put an "and" in there:

local mq = require('mq')

-- Do not edit this if condition
if not package.loaded['events'] then
print('This script is intended to be imported to Lua Event Manager (LEM). Try "\a-t/Lua run lem\a-x"')
end

local function on_load()
end


local function condition()
local bane = mq.TLO.Me.Song('Subjugation')() or false
return bane
end

local function action()
mq.cmd('/alt activate 15074')
end

return {onload=on_load, condfunc=condition, actionfunc=action}
 
You were on the right track! Here is code I use elsewhere as an example.

mq.TLO.Me.Song("Curse of Subjugation")() and not mq.TLO.Me.Song("Aureate's Bane")()

I don't see why the or false would be necessary at all

I'd like to improve a LEM I use to trigger Aureate's Bane when my tank has the curse (I often run him manually with no plugin so a LEM is the best option). Unfortunately, the LEM I use right now suffers from the EQ bug where Aureate's Bane doesn't immediately dispell Curse of Subjugation and it therefore triggers needlessly for a while.

To get around that, I'd like to change it to only trigger if he has the curse AND he doesn't have the bane buff running. However, I'm very new to Lua and struggling to get the right syntax on the condition - so, after multiple failures I thought I'd ask some experts!

Any guidance appreciated! Thank you!

The LEM I am using is as follows (I've been trying to amend the line that says "local bane = mq.TLO.Me.Song('Subjugation')() or false" but it doesn't seem to like it if I put an "and" in there:
 
So if you have the Song Subjugation and don't have the bane buff...sounds like a situation for "and not"

local bane = mq.TLO.Me.Song("Curse of Subjugation")() and not mq.TLO.Me.Song("Aureate's Bane")() or false


Give this a go.
Consider: You always return bane here. bane is the result of the complete condition.
If you just use "and" without the "not" it means you want to have the Curse of Subjugation and the Aureate's Bane. If both are true you get (true && true || false)
If you use "and not" it means you want the Curse of Subjugation but not Aureate's Bane, which would results in (true && !true || false). meaning the second entry would need to be false to return a true because it's accepting the opposite.
 
Damn! I was close and can't believe I didn't try that! Thank you both so much! I was messing around with "and ~=" (which didn't work, obviously) and then tried "not" but never got as far as "and not". Doh!
 
Damn! I was close and can't believe I didn't try that! Thank you both so much! I was messing around with "and ~=" (which didn't work, obviously) and then tried "not" but never got as far as "and not". Doh!
Right, just be aware that if either of the conditions here are nil:

thing = foo and bar

thing will return false


Lua has wonderful documentation, and I'm still learning myself, but one of my biggest teachers has been our existing codebases (for me, specifically RGMercs, but I've picked up stuff from other places too!).

There are literally times I've searched for a term, TLO, something in my entire Lua folder to see how other people have used it for inspiration!
 
Right, just be aware that if either of the conditions here are nil:

thing = foo and bar

thing will return false


Lua has wonderful documentation, and I'm still learning myself, but one of my biggest teachers has been our existing codebases (for me, specifically RGMercs, but I've picked up stuff from other places too!).

There are literally times I've searched for a term, TLO, something in my entire lua folder to see how other people have used it for inspiration!
The nil bit is why I left the or false bit at the end. I considered that if it's nil then it may not result in a return. But I also am super unfamiliar with Lua.
 
Question - LEM for Aureate bane syntax question

Users who are viewing this thread

Back
Top
Cart