• 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
(Mighty) Lua Event Manager

Release (Mighty) Lua Event Manager 12/13/2024

No permission to download
I need to make something to dump stuff off my cursor in the guildhall... if i eat anymore stat food due to people summoning mod rods for no reason, I will pk everyone in the guildhall... Whats the LEM command/condition to id when something ends up on your cursor?
 
you can test by doing /echo ${Cursor.ID} to get the ID, or /echo ${Cursor} to get the name of it

so some sort of /if ${Cursor} statement would maybe work?
 
you can test by doing /echo ${Cursor.ID} to get the ID, or /echo ${Cursor} to get the name of it

so some sort of /if ${Cursor} statement would maybe work?
i thought the $ stuff wasnt Lua. it certainly didnt work earlier when i was doing things.
 
so, would I do this:


[CODE title="item_on_cursor"]local mq = require('mq')

---@return boolean @Returns true if the action should fire, otherwise false.
local function condition()
local itemonhand = mq.TLO.Cursor()
end

local function action()
if itemonhand == true then
mq.cmd('/2 I have an item on my cursor, dumping it in 20 seconds')
mq.cmd('/timed 200 /dgza /autoinventory')
end
end

return {condfunc=condition, actionfunc=action}[/CODE]


or

[CODE title="item_on_cursor"]local mq = require('mq')

---@return boolean @Returns true if the action should fire, otherwise false.
local function condition()
local itemonhand = mq.TLO.Cursor()
end

local function action()
mq.cmd('/2 I have an item on my cursor, dumping it in 20 seconds')
mq.cmd('/timed 200 /dgza /autoinventory')

return {condfunc=condition, actionfunc=action}[/CODE]

or what is significantly more likely... neither do something else.
 
so, would I do this:
if this is just for mod rods, a couple thoughts..
1. if its a toon you don't use rods on you can just take the rods and place them in your real estate, then because there lore when people cast that spell it wont land on you.
2. if you still want mod rods, you will need to make the condition to only fire if it's one of the type's of mod rods, otherwise you wont be able to put anything on your cursor at all.
 
if this is just for mod rods, a couple thoughts..
1. if its a toon you don't use rods on you can just take the rods and place them in your real estate, then because there lore when people cast that spell it wont land on you.
2. if you still want mod rods, you will need to make the condition to only fire if it's one of the type's of mod rods, otherwise you wont be able to put anything on your cursor at all.
People AE summon all kinds of crap in my guild hall.... bread, food, water, mod rods.... If i am paying attention I can just shut the event off, if Im not, thats the problem. I put a 20 second delay on it to help give time to do things without shutting off the event. I need the mod rods, I have a mage :P

I will attempt to make a more comprehensive list of things to autoinventory, however, i do need to know if Im on the right track with the code itself.
 
People AE summon all kinds of crap in my guild hall
Maybe this be a good start for you:
Code:
local mq = require('mq')

local function condition()
    return mq.TLO.Cursor.ID() ~= nil
end

local function action()
    mq.cmd('/dgt --> Item on cursor, auto inventory in 20s.')
    mq.delay(20000)
    if mq.TLO.Cursor.ID() ~= nil then
        mq.cmd('/autoinv')
    end
end

return {condfunc=condition, actionfunc=action}

I don't usually use the Timed feature, and then I also used /dgt rather then a channel so you don't spam a wrong channel some day.

Good luck.
 
@1
Maybe this be a good start for you:
Code:
local mq = require('mq')

local function condition()
    return mq.TLO.Cursor.ID() ~= nil
end

local function action()
    mq.cmd('/dgt --> Item on cursor, auto inventory in 20s.')
    mq.delay(20000)
    if mq.TLO.Cursor.ID() ~= nil then
        mq.cmd('/autoinv')
    end
end

return {condfunc=condition, actionfunc=action}

I don't usually use the Timed feature, and then I also used /dgt rather then a channel so you don't spam a wrong channel some day.

Good luck

the #2 channel is my channel I use so i can send items links to myself and see when my events say stuff. Its all good :P Thank you for getting back to me on this. Appreciate the help!
 
the #2 channel is my channel
another thing you could do to not overwhelm your chat is put the channel command only when its actually going to inventory the item, so you don't get spammed all the time unless something got inventoried. though you mentioned having time to interrupt it.
 
Two questions:

is there a way to load a LEM from a file? I put the files from a LEM in the folder but they don't load unless there's an event in the folder with a same name to overwrite.

what is the command to check the name of stuff on xtarget?
 
thought of adding a debug button on events. Dont know if there's an easier way than typing the /Lua run lem/events/blahblahblah out.
 
May have missed info on it somewhere, but just as an aside, if you start LEM for the first time, and try to create a category when you have no text events, the add category button didn't do anything for me. Once I created an initial event, I was then able to create a category.
 
May have missed info on it somewhere, but just as an aside, if you start LEM for the first time, and try to create a category when you have no text events, the add category button didn't do anything for me. Once I created an initial event, I was then able to create a category.
can create categories here and then assign your event to them while you do them.
1677279863528.png
 
I used the template for aow_duck and stand changing only the duck key to x instead of d, but it doesn't seem to work 'cause I've got wiped a couple of times. Am I supposed to add something to it, or do you see something that I may be missing?

1682273509222.png
 
I used the template for aow_duck and stand changing only the duck key to x instead of d, but it doesn't seem to work 'cause I've got wiped a couple of times. Am I supposed to add something to it, or do you see something that I may be missing?

View attachment 48037
my version of that shows instead of '/keypress x' , it shows '/keypress DUCK'

maybe try that? i know mine works.. and i am 99% sure I got it from this same thread...
 
I used the template for aow_duck and stand changing only the duck key to x instead of d, but it doesn't seem to work 'cause I've got wiped a couple of times. Am I supposed to add something to it, or do you see something that I may be missing?

View attachment 48037
As someone else mentioned above, keypress DUCK is key. However, what everyone is missing if you are using it on spellcasters with longer cast times, is a stopcast command. The LEM will fail if in the middle of a longer cast time when the event is triggered.

What I have done was change the option for the keyboard command to Stop Casting A Spell, and include that in my LEM as well. Z is my key of choice.

Code:
local mq = require('mq')

local my_class = mq.TLO.Me.Class.ShortName()

local function event_handler(line, name)
    if name == mq.TLO.Me.CleanName() and not mq.TLO.Me.Ducking() then
        if my_class == 'BER' and mq.TLO.Me.ActiveDisc.Name() == mq.TLO.Spell('Frenzied Resolve Discipline').RankName() then
            mq.cmd('/stopdisc')
        end
        mq.cmd('/dgt Ducking to avoid AoW wrath!')
        mq.cmd('/cwtns autostandonduck off')
        mq.cmd('/boxr Pause')
        mq.cmd('/keypress Z')
        mq.cmd('/twist stop')
        mq.delay(10)
        mq.cmd('/keypress Duck')
    end
end

return {eventfunc=event_handler}
 
Last edited:
I think this is what is happening because even though LorDeth's way was working better than before, my necro and chanter kept dying every time. I will try this. Thanks Shadow!
 
For the LEM coding purposes, would adding a code of 'MOB Name01-02' work to target those specific mobs instead of all of the named mob using 'Mob Name'?
 
When you are running Lua on 6+ accts, how do you know which Lua GUIbelongs to who? Can the name be added into the GUI title bar? This happens to me on Overseer's, etc.. Am I missing something?
1688617981516.png
 
When you are running Lua on 6+ accts, how do you know which Lua GUIbelongs to who? Can the name be added into the GUI title bar? This happens to me on Overseer's, etc.. Am I missing something?
View attachment 49525
I guess you must be dragging them outside of the eq window? Their focus is linked to the eq client that created them either way so if you click one, it would bring that client to the foreground even if its outside the eq window.

but you can also broadcast commands around to enable/disable LEMs or right click in the list to broadcast etc, so having to go to the ui for each toon probably isn't really necessary.
 
Been struggling to figure this out, any help would be appreciated.
If I didn't want to cast a buff on a pet, how would I use a TLO statement to determine if the target was a pet so I could skip it? This local function seems to be including pets.


Code:
Local function partyMemberNotBuffed()
    for idx=1,mq.TLO.Group.Members() do
        local charName = mq.TLO.Group.Member(idx)
        mq.cmdf('/target %s', charName)
        mq.delay(500)
        if not mq.TLO.Target.Buff(mediation).SpellID() then
            return true
        end
    end
    mq.cmd('/mqp off')
    mq.delay("2m")
    return false
end

This returns if a target is a pet in events:
Code:
${Target.Type.Equal[Pet]}
 
Been struggling to figure this out, any help would be appreciated.
If I didn't want to cast a buff on a pet, how would I use a TLO statement to determine if the target was a pet so I could skip it? This local function seems to be including pets.


Code:
Local function partyMemberNotBuffed()
    for idx=1,mq.TLO.Group.Members() do
        local charName = mq.TLO.Group.Member(idx)
        mq.cmdf('/target %s', charName)
        mq.delay(500)
        if not mq.TLO.Target.Buff(mediation).SpellID() then
            return true
        end
    end
    mq.cmd('/mqp off')
    mq.delay("2m")
    return false
end

This returns if a target is a pet in events:
Code:
${Target.Type.Equal[Pet]}
check if the spawn has a Master.ID
 
TLO statement to determine if the target was a pet so I could skip it
Id say its because your targeting a name, and the pet has the name of owner in it and is closer. the way I would go at it is target the ID.
something like:

Code:
local function partyMemberNotBuffed()
    for idx = 1,mq.TLO.Group.Members() do
        local charID = mq.TLO.Group.Member(idx).ID()
        mq.cmdf('/mqtarget ID %i', charID)
        mq.delay(500)
        if not mq.TLO.Target.Buff(mediation).SpellID() then
            return true
        end
    end
    mq.cmd('/mqp off')
    mq.delay("2m")
    return false
end
 
Been struggling to figure this out, any help would be appreciated.
If I didn't want to cast a buff on a pet, how would I use a TLO statement to determine if the target was a pet so I could skip it? This local function seems to be including pets.


Code:
Local function partyMemberNotBuffed()
    for idx=1,mq.TLO.Group.Members() do
        local charName = mq.TLO.Group.Member(idx)
        mq.cmdf('/target %s', charName)
        mq.delay(500)
        if not mq.TLO.Target.Buff(mediation).SpellID() then
            return true
        end
    end
    mq.cmd('/mqp off')
    mq.delay("2m")
    return false
end

This returns if a target is a pet in events:
Code:
${Target.Type.Equal[Pet]}
You can also use mq.TLO.Group.Member(I).DoTarget(), but ya targeting by id or adding PC should work too
 
I'm just getting started with LEM and can't figure out what I did wrong after installing. Every time I launch lem with "/Lua run lem", I get the error messages in the attached screenshot. I can't call lem with either "/lem" or "/mlem". I modified the code to add a third binding with "mq.bind('/mylem', cmd_handler)" and can then call lem with "/mylem" and add a Condition Event, however I can't toggle it on and off with any of the variations of "/mylem cond <Condition Name> 0/true/false", etc.. If enabled, the condition stays enabled when I do a "/mylem cond >Condition Name> false" and if not enabled, it never enables with "/mylem cond <Condition Name> true" I also tried right-clicking on the event and toggling it for group and all and it never toggles either. What do I need to do in order to be able to launch this on multiple toons and toggle it back and forth, without individually going to each window and manually checking and un-checking the condition box?
 

Attachments

  • Capture.GIF
    Capture.GIF
    7.3 KB · Views: 2
I'm just getting started with LEM and can't figure out what I did wrong after installing. Every time I launch lem with "/lua run lem", I get the error messages in the attached screenshot. I can't call lem with either "/lem" or "/mlem". I modified the code to add a third binding with "mq.bind('/mylem', cmd_handler)" and can then call lem with "/mylem" and add a Condition Event, however I can't toggle it on and off with any of the variations of "/mylem cond <Condition Name> 0/true/false", etc.. If enabled, the condition stays enabled when I do a "/mylem cond >Condition Name> false" and if not enabled, it never enables with "/mylem cond <Condition Name> true" I also tried right-clicking on the event and toggling it for group and all and it never toggles either. What do I need to do in order to be able to launch this on multiple toons and toggle it back and forth, without individually going to each window and manually checking and un-checking the condition box?
Do you have some reliable way to get LEM into this situation? Do you have some event setup that is making the script crash, and it gets into this state upon restarting it? Is it happening the first time you start LEM after logging in?
 
Do you have some reliable way to get LEM into this situation? Do you have some event setup that is making the script crash, and it gets into this state upon restarting it? Is it happening the first time you start LEM after logging in?
I did in fact have an error on initial install that only happens the first time I call "/Lua run lem". I was able to replicate it and have pasted a screenshot here. After receiving this error, I then receive the other "bind" error I attached earlier. Just let me know if there is any additional information I can provide.



lem_error.GIF
 
I did in fact have an error on initial install that only happens the first time I call "/lua run lem". I was able to replicate it and have pasted a screenshot here. After receiving this error, I then receive the other "bind" error I attached earlier. Just let me know if there is any additional information I can provide.



View attachment 50097
There's a MQ bug to be fixed around errors that come up after a file fails to be loaded. You have an event which has some kind of syntax error or something and so LEM fails to load it, which then leads to this error. You can look at lem/characters/<charactername>.Lua and see what events are enabled and try to narrow down which is failing to load and share the code for it.
 
Thanks for the pointers. I found a blank condition in one of my character's ini files (one that was added vai the LEM GUI itself) and removing that resolved the "bind" errors. However, I'm still unable to enable/disable the following "Condition Event". I've tried using "/lem cond ManaCheck 1" (on/off,true,false,0,1, etc) and I can't enable or disable it via the command-line. I tried adding the condition name in double-quotes, but that didn't work either. Any suggestions?

[CODE title="ManaCheck"]local mq = require('mq')

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

local function on_load()
-- Perform any initial setup here when the event is loaded.
end

---@return boolean @Returns true if the action should fire, otherwise false.
local function condition()
return mq.TLO.Group.LowMana(60)() > 0
end

local function action()
if mq.TLO.Group.LowMana(60)() > 0 then
--print("mana not ideal, resting")
if (mq.TLO.Me.Standing() and not mq.TLO.Me.Casting.ID()) then
mq.TLO.Me.Sit()
end
end
end

return {onload=on_load, condfunc=condition, actionfunc=action}[/CODE]
 
Release (Mighty) Lua Event Manager

Users who are viewing this thread

Back
Top
Cart