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

Joined
Jul 25, 2023
RedCents
2,967¢
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