• 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
Resource icon

Release Lua Event Manager (LEM) Event Library

LEM for Tank bandolier for 2H to Shield.


[CODE title="Event Export"]cmV0dXJuIHsKIGxvYWQgPSB7CiAgY2xhc3MgPSAiIiwKICBhbHdheXMgPSBmYWxzZSwKICB6b25lID0gIiIsCiB9LAogY29kZSA9ICJMUzFCWkdGd2RHVmtJR1p5YjIwZ1UybGpKM01nVkdGdWEwSmhibVJ2VTNkaGNDQnRZV055YndvdExTMHRMUzB0TFMwdExTMHRMUzB0TFMwdExTMHRMUzB0TFMwdExTMHRMUzB0TFMwdExTMHRMUzB0TFMwdExTMEtDbXh2WTJGc0lHMXhJRDBnY21WeGRXbHlaU2duYlhFbktRcHNiMk5oYkNCRGIyMXRiMjV6SUQwZ2NtVnhkV2x5WlNnbmJHVnRZMjl0Ylc5dWN5NURiMjF0YjI1ekp5a0tiRzlqWVd3Z2JXVmZZMnhoYzNNZ1BTQnRjUzVVVEU4dVRXVXVRMnhoYzNNdVUyaHZjblJPWVcxbEtDa0tiRzlqWVd3Z2JYbGZibUZ0WlNBOUlHMXhMbFJNVHk1TlpTNURiR1ZoYms1aGJXVW9LUXBzYjJOaGJDQnBjMTkwWVc1cklEMGdlMUJCVEQxMGNuVmxMRk5JUkQxMGNuVmxMRmRCVWoxMGNuVmxmUXBzYjJOaGJDQnBaMjV2Y21WNmIyNWxjeUE5SUh0YkoyZDFhV3hrYUdGc2JETmZhVzUwSjEwOWRISjFaU3dnV3lkaGEyaGxkbUYwZDI5ZmJXbHpjMmx2YmlkZFBYUnlkV1VzSUZzbllXdG9aWFpoZEhkdlgzSmhhV1FuWFQxMGNuVmxmUW9LQ2dvdExTQkVieUJ1YjNRZ1pXUnBkQ0IwYUdseklHbG1JR052Ym1ScGRHbHZiZ3BwWmlCdWIzUWdjR0ZqYTJGblp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lDQWdJQ0FnSUNBZ0lHRmpkR2wyWVhSbFgySmhibVJ2YkdsbGNpZ25Na2duS1FvZ0lDQWdJQ0FnSUNBZ0lDQmxibVFLSUNBZ0lDQWdJQ0J5WlhSMWNtNGdabUZzYzJVS0lDQWdJQ0FnSUNCbGJtUWdJQW9nSUNBZ1pXeHpaUW9nSUNBZ2NtVjBkWEp1SUdaaGJITmxDaUFnSUNCbGJtUUtaVzVrQ2dvS2JHOWpZV3dnWm5WdVkzUnBiMjRnWVdOMGFXOXVLQ2tLSUNBZ0lDMHRJRWx0Y0d4bGJXVnVkQ0IwYUdVZ1lXTjBhVzl1SUhSdklIQmxjbVp2Y20wZ2FHVnlaUzRLSUNBZ0lHbG1JRzF4TGxSTVR5NU5aUzVDWVc1a2IyeHBaWElvSnpKSUp5a3VRV04wYVhabEtDa2dkR2hsYmdvZ0lDQWdJQ0FnSUcxeExtTnRaQ2duTDJKaGJtUnZiR2xsY2lCaFkzUnBkbUYwWlNCVGFHbGxiR1FuS1FvZ0lDQWdaVzVrQ2lBZ0lDQUtaVzVrQ2dweVpYUjFjbTRnZTI5dWJHOWhaRDF2Ymw5c2IyRmtMQ0JqYjI1a1puVnVZejFqYjI1a2FYUnBiMjRzSUdGamRHbHZibVoxYm1NOVlXTjBhVzl1ZlE9PSIsCiBjYXRlZ29yeSA9ICJHZW5lcmFsIiwKIHR5cGUgPSAiY29uZGl0aW9ucyIsCiBuYW1lID0gIlRhbmtCYW5kb1N3YXAiLAp9[/CODE]

[CODE title="LEM Script"]--Adapted from Sic's TankBandoSwap macro
------------------------------------------------

local mq = require('mq')
local Commons = require('lemcommons.Commons')
local me_class = mq.TLO.Me.Class.ShortName()
local my_name = mq.TLO.Me.CleanName()
local is_tank = {PAL=true,SHD=true,WAR=true}
local ignorezones = {['guildhall3_int']=true, ['akhevatwo_mission']=true, ['akhevatwo_raid']=true}



-- 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 activate_bandolier(bandolier)
if not mq.TLO.Me.Bandolier(bandolier).Active() then
mq.cmd('/bandolier activate ' .. bandolier)
end
end

local function on_load()
-- Perform any initial setup here when the event is loaded.
if is_tank[me_class] then
activate_bandolier('2H')
else
mq.cmd('/dt Not a Tank Disabling this')
mq.cmd('/lem cond TankBandoSwap 0')
end
end

local function condition()
-- Implement the condition to evaluate here.
local is_in_combat = mq.TLO.Me.Combat() == true
local is_low_health = mq.TLO.Me.PctHPs() < 60
local has_multiple_targets = mq.TLO.Me.XTarget() > 3
local is_target_named = mq.TLO.Target.Named() == true
local current_zone_id = mq.TLO.Zone.ShortName()

if not ignorezones[current_zone_id] then
if is_in_combat and (is_low_health or has_multiple_targets or is_target_named) then
return true
else
if is_tank[me_class] then
activate_bandolier('2H')
end
return false
end
else
return false
end
end


local function action()
-- Implement the action to perform here.
if mq.TLO.Me.Bandolier('2H').Active() then
mq.cmd('/bandolier activate Shield')
end

end

return {onload=on_load, condfunc=condition, actionfunc=action}[/CODE]
 
Maybe a dumb question, but is I add an event (the copy and paste long sting way) do I need to do it on each toon I'm running or just on one toon?


Thanks- BB
 
Just restart LEM on the rest of the toons.
Thanks a bunch @aquietone.

This is awesome. Wish I'd run across it earlier. SOOOO much stuff on this site I don't know I need until I happen to run into it.

This site feels like a shopping trip to Costco.


BB
 
Thanks a bunch @aquietone.

This is awesome. Wish I'd run across it earlier. SOOOO much stuff on this site I don't know I need until I happen to run into it.

This site feels like a shopping trip to Costco.


BB
Thank god is doesn;t cost you $500 each time you come here 😛
 
new effect: empty character.Lua within folder "characters"
1688409672291.png

The Lua of the character was totally empty.
There was a similar file named character's corpse.Lua within the characters folder. (dated from january)
This seemded to be ok.
I copied the content into character.Lua, after done this, I could run /Lua run lem on this character without any errormessages and the lem-ui appeard as usual.
 
Here is a Lua for the Cleric class to keep DI up on your group in and out of combat.
Code:
cmV0dXJuIHsKIGxvYWQgPSB7CiAgYWx3YXlzID0gZmFsc2UsCiAgY2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lCR2FYZ2dkR2hwY3lCaWNtOXJaVzRnYzJocGRBb2dJQ0FnSUNBZ0lDMHRiWEV1WkdWc1lYa29iWEV1VkV4UExsTndaV3hzS0cxbFpHbGhkR2x2YmlrdVVtVmpZWE4wVkdsdFpTZ3BJQ3NnTVRBd01Da0tJQ0FnSUNBZ0lDQnlaWFIxY200Z1ptRnNjMlVLSUNBZ0lHVnNjMlVLSUNBZ0lDQWdJQ0J5WlhSMWNtNGdjR0Z5ZEhsTlpXMWlaWEpPYjNSQ2RXWm1aV1FvS1FvZ0lDQWdaVzVrQ21WdVpBb0tiRzlqWVd3Z1puVnVZM1JwYjI0Z1luVm1abEJoY25SNVRXVnRZbVZ5Y3lncENpQWdJQ0J0Y1M1amJXUW9JaTluSUVOaGMzUnBibWNnUkVrZ2IyNGdKWFFpS1FvZ0lDQWdiWEV1WTIxa0tDY3ZZMkZ6ZENBeE1pY3BDaUFnSUNCdGNTNWpiV1FvSnk5dGNYQWdiMlptSnlrS1pXNWtDZ3BzYjJOaGJDQm1kVzVqZEdsdmJpQmhZM1JwYjI0b0tRb2dJQ0FnTFMwZ1NXMXdiR1Z0Wlc1MElIUm9aU0JoWTNScGIyNGdkRzhnY0dWeVptOXliU0JvWlhKbExnb2dJQ0FnWW5WbVpsQmhjblI1VFdWdFltVnljeWdwQ2dwbGJtUUtDbkpsZEhWeWJpQjdiMjVzYjJGa1BXOXVYMnh2WVdRc0lHTnZibVJtZFc1alBXTnZibVJwZEdsdmJpd2dZV04wYVc5dVpuVnVZejFoWTNScGIyNTkiLAogY2F0ZWdvcnkgPSAiIiwKIHR5cGUgPSAiY29uZGl0aW9ucyIsCiBuYW1lID0gIkNsZXJpY0RJIiwKfQ==

Be gentle, this is my first attempt at a Lua. Comments or tweaks are welcome!

Code:
--  Deathlock - 7/2023
--  Condition Event
--  Will check group for DI in and out of Combat and cast if any group memeber needs.
--   DI = Divine Mediation

local mq = require('mq')
local mediation = mq.TLO.Spell('Divine Mediation').RankName()

-- 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

local function partyMemberNotBuffed()
    mq.cmd("/mqp on")
    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

---@return boolean @Returns true if the action should fire, otherwise false.
local function condition()
    -- Implement the condition to evaluate here.
    if not mq.TLO.Me.SpellReady(mediation)() then
        mq.delay("8s")
        --TODO: Fix this broken recast timer shit at some point.
        --mq.delay(mq.TLO.Spell(mediation).RecastTime() + 1000)
        return false
    else
        return partyMemberNotBuffed()
    end
end

local function buffPartyMembers()
    mq.cmd("/g Casting DI on %t")
    mq.cmd('/cast 12')
    mq.cmd('/mqp off')
end

local function action()
    -- Implement the action to perform here.
    buffPartyMembers()

end

return {onload=on_load, condfunc=condition, actionfunc=action}
 
This Lua will cast Di on anyone if it has worn off.
Code:
cmV0dXJuIHsKIGxvYWQgPSB7CiAgYWx3YXlzID0gZmFsc2UsCiAgY2xhc3MgPSAiIiwKICB6b25lID0gIiIsCiB9LAogY29kZSA9ICJMUzBnUkdWaGRHaHNiMk5ySUMwZ055OHlNREl6Q2kwdElGUmxlSFFnUlhabGJuUUtMUzBnVjJsc2JDQmpZWE4wSUVSSklHOXVJR0Z1ZVc5dVpTQnBaaUJoSUhkdmNtNGdiMlptSUcxbGMzTmhaMlVnYVhNZ2MyVmxiZ290TFNCRVNTQnBjeUJqWVhOMElHWnliMjBnYzNCbGJHd2dabkp2YlNCblpXMGdNVEl1Q2dwc2IyTmhiQ0J0Y1QxeVpYRjFhWEpsS0NkdGNTY3BDZ3BzYjJOaGJDQm1kVzVqZEdsdmJpQmxkbVZ1ZEY5b1lXNWtiR1Z5S0d4cGJtVXNJRzVoYldVcENpQWdJQ0F0TFNCSmJYQnNaVzFsYm5RZ2RHaGxJR2hoYm1Sc2FXNW5JR1p2Y2lCMGFHVWdaWFpsYm5RZ2FHVnlaUzRLSUNBZ0lHMXhMbU50WkNnbkwyMXhjQ0J2YmljcENpQWdJQ0J0Y1M1amJXUm1LQ2N2ZEdGeVoyVjBJQ1Z6Snl3Z2JtRnRaU2tLSUNBZ0lHMXhMbVJsYkdGNUtERXdNQ2tLSUNBZ0lHMXhMbU50WkNnbkwyTmhjM1FnTVRJbktRb2dJQ0FnYlhFdVpHVnNZWGtvTlRBd0tRb2dJQ0FnYlhFdVkyMWtLQ2N2YlhGd0lHOW1aaWNwQ21WdVpBb0tjbVYwZFhKdUlIdHZibXh2WVdROWIyNWZiRzloWkN3Z1pYWmxiblJtZFc1alBXVjJaVzUwWDJoaGJtUnNaWEo5IiwKIGNhdGVnb3J5ID0gIiIsCiB0eXBlID0gImV2ZW50cyIsCiBuYW1lID0gIkNsZXJpY1RleHRESSIsCiBwYXR0ZXJuID0gIiMqI1lvdXIgRGl2aW5lIE1lZGlhdGlvbiMqIyBzcGVsbCBoYXMgd29ybiBvZmYgb2YgIzEjLiMqIyIsCn0=

First attempt at a Texted Event.
Code:
-- Deathlock - 7/2023
-- Text Event
-- Will cast DI on anyone if a worn off message is seen
-- DI is cast from spell from gem 12.

local mq=require('mq')

local function event_handler(line, name)
    -- Implement the handling for the event here.
    mq.cmd("/mqp on")
    mq.delay(100)
    mq.cmdf('/target %s', name)
    mq.cmd('/cast 12')
    mq.delay(500)
    mq.cmd("/mqp off")
end

return {onload=on_load, eventfunc=event_handler}
 
Last edited:
Had a request to post this here. Enable it when if you are going to do the Close the gate mission in TOL.

Start the event and put your guys in camp mode at the gate run this LEM anytime you are in the zone on the MT and you'll kill the gargoyle and golem in the right order.

Code:
cmV0dXJuIHsKIGxvYWQgPSB7CiAgYWx3YXlzID0gZmFsc2UsCiAgY2xhc3MgPSAiIiwKICB6b25lID0gIiIsCiB9L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Z1ptRnNjMlV1Q214dlkyRnNJR1oxYm1OMGFXOXVJR052Ym1ScGRHbHZiaWdwQ2lBZ0lDQXRMU0JKYlhCc1pXMWxiblFnZEdobElHTnZibVJwZEdsdmJpQjBieUJsZG1Gc2RXRjBaU0JvWlhKbExnb2dJQ0FnY21WMGRYSnVJRzF4TGxSTVR5NWFiMjVsTGxOb2IzSjBUbUZ0WlNncElEMDlJSEpsY1hWcGNtVmtYM3B2Ym1VZ1lXNWtJRzF4TGxSTVR5NVRjR0YzYmtOdmRXNTBLQ0poSUdkeWFXNXVhVzVuSUdkaGNtZHZlV3hsSWlrb0tTQStJREFLWlc1a0NncHNiMk5oYkNCbWRXNWpkR2x2YmlCaFkzUnBiMjRvS1FvZ0lDQWdMUzBnU1cxd2JHVnRaVzUwSUhSb1pTQmhZM1JwYjI0Z2RHOGdjR1Z5Wm05eWJTQm9aWEpsTGdvZ0lDQWdiWEV1WTIxa0tDY3ZiWEYwWVhKblpYUWdZU0JuY21sdWJtbHVaeUJuWVhKbmIzbHNaU2NwQ21WdVpBb0tjbVYwZFhKdUlIdHZibXh2WVdROWIyNWZiRzloWkN3Z1kyOXVaR1oxYm1NOVkyOXVaR2wwYVc5dUxDQmhZM1JwYjI1bWRXNWpQV0ZqZEdsdmJuMD0iLAogY2F0ZWdvcnkgPSAiTWlzc2lvbnMtVE9MIiwKIHR5cGUgPSAiY29uZGl0aW9ucyIsCiBuYW1lID0gIlRPTF9NaXNzaW9uX0Nsb3NlX3RoZV9HYXRlX0tpbGxPcmRlciIsCn0=

Code:
local mq = require('mq')
local required_zone = 'bloodfalls_mission'

-- 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.
    if mq.TLO.Zone.ShortName() == required_zone then
        return nil
    else
        mq.cmd('/lem cond TOL_Mission_Close_the_Gate_KillOrder 0')
    end
end

---@return boolean @Returns true if the action should fire, otherwise false.
local function condition()
    -- Implement the condition to evaluate here.
    return mq.TLO.Zone.ShortName() == required_zone and mq.TLO.SpawnCount("a grinning gargoyle")() > 0
end

local function action()
    -- Implement the action to perform here.
    mq.cmd('/mqtarget a grinning gargoyle')
end

return {onload=on_load, condfunc=condition, actionfunc=action}
 
LEM for Tank bandolier for 2H to Shield.


[CODE title="Event Export"]cmV0dXJuIHsKIGxvYWQgPSB7CiAgY2xhc3MgPSAiIiwKICBhbHdheXMgPSBmYWxzZSwKICB6b25lID0gIiIsCiB9LAogY29kZSA9ICJMUzFCWkdGd2RHVmtJR1p5YjIwZ1UybGpKM01nVkdGdWEwSmhibVJ2VTNkaGNDQnRZV055YndvdExTMHRMUzB0TFMwdExTMHRMUzB0TFMwdExTMHRMUzB0TFMwdExTMHRMUzB0TFMwdExTMHRMUzB0TFMwdExTMEtDbXh2WTJGc0lHMXhJRDBnY21WeGRXbHlaU2duYlhFbktRcHNiMk5oYkNCRGIyMXRiMjV6SUQwZ2NtVnhkV2x5WlNnbmJHVnRZMjl0Ylc5dWN5NURiMjF0YjI1ekp5a0tiRzlqWVd3Z2JXVmZZMnhoYzNNZ1BTQnRjUzVVVEU4dVRXVXVRMnhoYzNNdVUyaHZjblJPWVcxbEtDa0tiRzlqWVd3Z2JYbGZibUZ0WlNBOUlHMXhMbFJNVHk1TlpTNURiR1ZoYms1aGJXVW9LUXBzYjJOaGJDQnBjMTkwWVc1cklEMGdlMUJCVEQxMGNuVmxMRk5JUkQxMGNuVmxMRmRCVWoxMGNuVmxmUXBzYjJOaGJDQnBaMjV2Y21WNmIyNWxjeUE5SUh0YkoyZDFhV3hrYUdGc2JETmZhVzUwSjEwOWRISjFaU3dnV3lkaGEyaGxkbUYwZDI5ZmJXbHpjMmx2YmlkZFBYUnlkV1VzSUZzbllXdG9aWFpoZEhkdlgzSmhhV1FuWFQxMGNuVmxmUW9LQ2dvdExTQkVieUJ1YjNRZ1pXUnBkQ0IwYUdseklHbG1JR052Ym1ScGRHbHZ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hjM05kSUhSb1pXNEtJQ0FnSUNBZ0lDQWdJQ0FnSUNBZ0lHRmpkR2wyWVhSbFgySmhibVJ2YkdsbGNpZ25Na2duS1FvZ0lDQWdJQ0FnSUNBZ0lDQmxibVFLSUNBZ0lDQWdJQ0J5WlhSMWNtNGdabUZzYzJVS0lDQWdJQ0FnSUNCbGJtUWdJQW9nSUNBZ1pXeHpaUW9nSUNBZ2NtVjBkWEp1SUdaaGJITmxDaUFnSUNCbGJtUUtaVzVrQ2dvS2JHOWpZV3dnWm5WdVkzUnBiMjRnWVdOMGFXOXVLQ2tLSUNBZ0lDMHRJRWx0Y0d4bGJXVnVkQ0IwYUdVZ1lXTjBhVzl1SUhSdklIQmxjbVp2Y20wZ2FHVnlaUzRLSUNBZ0lHbG1JRzF4TGxSTVR5NU5aUzVDWVc1a2IyeHBaWElvSnpKSUp5a3VRV04wYVhabEtDa2dkR2hsYmdvZ0lDQWdJQ0FnSUcxeExtTnRaQ2duTDJKaGJtUnZiR2xsY2lCaFkzUnBkbUYwWlNCVGFHbGxiR1FuS1FvZ0lDQWdaVzVrQ2lBZ0lDQUtaVzVrQ2dweVpYUjFjbTRnZTI5dWJHOWhaRDF2Ymw5c2IyRmtMQ0JqYjI1a1puVnVZejFqYjI1a2FYUnBiMjRzSUdGamRHbHZibVoxYm1NOVlXTjBhVzl1ZlE9PSIsCiBjYXRlZ29yeSA9ICJHZW5lcmFsIiwKIHR5cGUgPSAiY29uZGl0aW9ucyIsCiBuYW1lID0gIlRhbmtCYW5kb1N3YXAiLAp9[/CODE]

[CODE title="LEM Script"]--Adapted from Sic's TankBandoSwap macro
------------------------------------------------

local mq = require('mq')
local Commons = require('lemcommons.Commons')
local me_class = mq.TLO.Me.Class.ShortName()
local my_name = mq.TLO.Me.CleanName()
local is_tank = {PAL=true,SHD=true,WAR=true}
local ignorezones = {['guildhall3_int']=true, ['akhevatwo_mission']=true, ['akhevatwo_raid']=true}



-- 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 activate_bandolier(bandolier)
if not mq.TLO.Me.Bandolier(bandolier).Active() then
mq.cmd('/bandolier activate ' .. bandolier)
end
end

local function on_load()
-- Perform any initial setup here when the event is loaded.
if is_tank[me_class] then
activate_bandolier('2H')
else
mq.cmd('/dt Not a Tank Disabling this')
mq.cmd('/lem cond TankBandoSwap 0')
end
end

local function condition()
-- Implement the condition to evaluate here.
local is_in_combat = mq.TLO.Me.Combat() == true
local is_low_health = mq.TLO.Me.PctHPs() < 60
local has_multiple_targets = mq.TLO.Me.XTarget() > 3
local is_target_named = mq.TLO.Target.Named() == true
local current_zone_id = mq.TLO.Zone.ShortName()

if not ignorezones[current_zone_id] then
if is_in_combat and (is_low_health or has_multiple_targets or is_target_named) then
return true
else
if is_tank[me_class] then
activate_bandolier('2H')
end
return false
end
else
return false
end
end


local function action()
-- Implement the action to perform here.
if mq.TLO.Me.Bandolier('2H').Active() then
mq.cmd('/bandolier activate Shield')
end

end

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

all i get is failed to load when i try to import this
 
First attempt at LEM with zero coding background.... Just trying to get my bard to cast Selo's when it sees a certain text line. I "speed please" as the pattern as a text condition LEM. It obviously doesn't work.

Event pattern: #*#Speed Please#*#

local mq = require('mq')

local function event_handler()
-- Implement the handling for the event here.
mq.cmd('/alt activate 3704')

end

return {eventfunc=event_handler}


Edit: I know there is easier ways to do this. I use a hotkey for for this with the /dexecute command. Just trying to learn the process. Also updated coded. I was an idiot and had activate alt as the command which was backwards.

Edit2: It works!
 
Last edited:
First attempt at LEM with zero coding background.... Just trying to get my bard to cast Selo's when it sees a certain text line. I "speed please" as the pattern as a text condition LEM. It obviously doesn't work.

Event pattern: #*#Speed Please#*#

local mq = require('mq')

local function event_handler()
-- Implement the handling for the event here.
mq.cmd('/alt activate 3704')

end

return {eventfunc=event_handler}


Edit: I know there is easier ways to do this. I use a hotkey for for this with the /dexecute command. Just trying to learn the process. Also updated coded. I was an idiot and had activate alt as the command which was backwards.

Edit2: It works!
Thanks. I don't know why, but I didn't "get" LEM until now. Then un-thanks! now I have to convert all my events!
 
First attempt at LEM with zero coding background.... Just trying to get my bard to cast Selo's when it sees a certain text line. I "speed please" as the pattern as a text condition LEM. It obviously doesn't work.

Event pattern: #*#Speed Please#*#

local mq = require('mq')

local function event_handler()
-- Implement the handling for the event here.
mq.cmd('/alt activate 3704')

end

return {eventfunc=event_handler}


Edit: I know there is easier ways to do this. I use a hotkey for for this with the /dexecute command. Just trying to learn the process. Also updated coded. I was an idiot and had activate alt as the command which was backwards.

Edit2: It works!
Anyone know if there is a way to add something to this Lua that will repeat it every 10 min even if it isn’t triggered by the pattern?

Goal being that it triggers every 10 min OR when the pattern phrase is read.
 
UGH i really really really really really would like to not be an idiot, but i cant. So that means i have no clue how to use some of this stuff. I would pay another 50 just to be able to use the dang Lua duck thing for one dang mission lol. the directions are waaaay too complex for me i would appreciate some help!
 
you mean lem? dude its super easy...
make sure the lem Lua is installed and launch it with /Lua run lem then import the duck lem from the forums and make sure its active by right clicking it. Rejoice
 
you're going to have to help us help you. Vague messages aren't helpful. Did you load the Lua plugin? Did you load LEM? are you in the thread for LEM to pull the one to make you duck?
 
i imported and saved. checked the box on all the dudes. they just get spanked anyways.

i embedded from the lem page as you said. imported and yah does nothing at this point
 
Yeah mike - you dont need to pay an extra 50 - we can help you - but you need to be asking the right questions, and follow up your question with the details about what you try.

Screen shots etc. will make it easy for us to diagnose what is happening and suggest an answer.

I assume you are trying the TOV mission Avatar of War. Are you running on live server or Test? What automation are you running? Some automation has auto stand on duck!
Can you screen shot the spam?

Did you ever try the plugin mq2events? Lem wasnt a thing when TOV came out and i found eq2events was a good solution.

Code:
[kneel]
trigger=#1#The ice encrusted Avatar of War shouts that |${Me}| must bend the knee!#2#
command=/if (!${Me.Ducking}) /multiline ; /boxr Pause; /twist off; /attack off; /target clear; /keypress DUCK
[stand]
trigger=#1#The Avatar of War nods, accepting the subservience of those that gave it#2#
command=/if (${Me.Ducking}) /multiline ; /keypress DUCK; /boxr Unpause
 
im using all CWTN except the bard i control. full group. all on chase. turned off auto duck in options from standard eq. live server. i will do as you say im trying
 
Hello everyone. I hope I am in the right place to ask a question about LEM. For my understanding if I use LEM which is a Lua I would not have to turn on the event plug-in in the pluginmanager? is this correct. I would like to try one of the LEM's that someone created on the Avatar of War and this caught my eye. Before I make any mistakes I wanted to ask first for more understanding.
Thank you everyone for your time.
 
Hello everyone. I hope I am in the right place to ask a question about LEM. For my understanding if I use LEM which is a lua I would not have to turn on the event plug-in in the pluginmanager? is this correct. I would like to try one of the LEM's that someone created on the Avatar of War and this caught my eye. Before I make any mistakes I wanted to ask first for more understanding.
Thank you everyone for your time.
That's correct but I'm not sure that the AOW mission LEM works, people often seem to say it doesn't. But I haven't been on live in a while to figure out if the event is broken or if its user error. The code looks comparable to the mq2events version far as I can tell. For example, just today someone couldn't get that event to work properly https://www.redguides.com/community...-of-my-hairs-is-coming-out.87825/#post-575843 so you may want to keep using mq2events for AOW.
 
I will keep that in mind. I still wear my high in tight so no hair pulling here. I have done the AoW without any events in place, just do not have the duck achievement on my tunes. I think if you do not duck you get a death touch I was told. I never knew because the cleric and shaman auto rez you so fast I guess. Thanks for the quick response. People are always friendly here.
 
Hello again, I just got home from work and tested the event in LEM. He shouted at my berserker to bend the knee, he did and got the message AoW nods accepting the subservience of those that gave it. So I said cool, Little later he did it again to the same berserker and got the message the AoW punishes his corpse. I did not think to look at the berserkers screen but I noticed after I the AoW changes the rules and go up stair my Berserker did not un-pause. Maybe next time I can check the char screen to look or just tell my guys to un-pause since it seems bend the knee is working. Maybe the stand is not worded right or could be lag anything happens in a game. I am on a live server. I do have the auto duck and stand turned off. All I did is copy the long string of code and imported. Hope this information helps everyone.
 
Hello again, sorry 3 comments in a row. I am looking at the AoWduck event and it has mq.cmd('/keypress DUCK'). Am I wrong I am not a coder or programmer but the AoWstand event has for stand mq.cmd('/stand') ?? could it be that is should be just do the mq.cmd('/keypress DUCK') command again? it does make you stand when you press the key again?? Thanks everyone, I am just trying to figure this out.
 
Mike, are you running this on all your characters? you dont just run it on one toon.

It looks ok to me.

You can test this very easy btw.

Just say the trigger phrase and see if your toon ducks or not.

/say The ice encrusted Avatar of War shouts that Mike must bend the knee!
 
I have not got those to work right... The Lem triggers.. I still use my MQ2event ones they always work. Well for Kael ToV triggers that is.
 
Most people say that avatar of war lem doesn't work, I think I've only seen one person say it did work. Its mostly identical to the working mq2events provided above. Don't think anyone has ever tried to understand why the LEM one doesn't work though. I've not been on live servers in a while so unlikely to look into it myself but anyone is welcome to add some prints to it and debug why it fails.


Lua:
local mq = require('mq')

local function event_handler(line, name)
    Write.Debug('name="%s", ducking=%s name==Me.CleanName=%s', name, mq.TLO.Me.Ducking(), name==mq.TLO.Me.CleanName())
    if name == mq.TLO.Me.CleanName() and not mq.TLO.Me.Ducking() then
        Write.Info('Pausing automation and ducking for AOW emote!')
        -- pause automation, alternatively have autostand off
        mq.cmdf('/%s pause on', mq.TLO.Me.Class.ShortName())
        mq.cmd('/mqp on')
        mq.cmd('/twist off')
        mq.cmd('/keypress DUCK')
    end
end

return {eventfunc=event_handler}

For example, could add those two Write lines to print some information. Or use printf.
1696176221460.png
If using Write.Debug like I have there, then need to set log level to debug in settings.
 
Mine works, and I run the mission every few days.

You shouldn't need to turn off the autostandonduck since it pauses the plugin.
 
When I did this event, i succeded when I holded dps to not get the named under 60% hp, until the adds downstairs have been killed.
If I remember well, there are 6 mobs standing around and activating one ny one. This event is more about taking the time to follow all the mechanic than killing all asap.
 
There are serveral versions if I remember well. Mind to narrow down by a link to the post to the version you are using?
Are you using the version in Post No #12?
Does your nec has bought the pestilence paralysis Aa.
A nec has also the option to use the Spell “Root”.
In the first bloc of the code, you see the aa/spell the class should use for banish.
You may change the row of the nec to use “Root” instead of ”Pestilence Paralysis” but don’t forget to change also the type from “aa” to “spell” if you want to give it a try and mem the spell “Root” into gem 13 before you start the event as described.
 
Last edited:
There are serveral versions if I remember well. Mind to narrow down by a link to the post to the version you sre using?
The Dragonslayer one on the overview page.

---@type Mq
---@type ImGui

local mq = require('mq')

local required_zone = 'akhevatwo_mission'
local bane_mob_name = 'datiar xi tavuelim'

local banes = {
BRD={name='Slumber of the Diabo',type='spell'},
CLR={name='Blessed Chains',type='aa'},
ENC={name='Beguiler\'s Banishment',type='aa'},
Pal={name='Shackles of Tunare',type='aa'},
SHM={name='Virulent Paralysis',type='aa'},
Nec={name='Pestilent Paralysis',type='aa'},
DRU={name='Paralytic Spores',type='aa'},
RNG={name='Grasp of Sylvan Spirits',type='aa'},
}

local function StopDPS()
mq.cmd('/squelch /mqp on')
mq.delay(10)
if mq.TLO.Me.Class.ShortName() == 'BRD' then
mq.cmd('/squelch /twist off')
mq.delay(10)
mq.cmd('/squelch /stopsong')
mq.delay(10)
end
--mq.cmd('/attack off') ... maybe deactivate attack but save state to reactivate at StartDps
--mq.delay(10)
mq.cmd('/squelch /boxr pause')
mq.delay(10)
while mq.TLO.Me.Casting.ID() do
mq.delay(200)
end
end

local function ResumeDPS()
mq.cmd('/squelch /mqp off')
mq.delay(10)
if mq.TLO.Me.Class.ShortName() == 'BRD' then
mq.cmd('/squelch /twist on')
mq.delay(10)
end
mq.cmd('/squelch /boxr unpause')
mq.delay(10)
end

local function on_load()
if mq.TLO.Zone.ShortName() ~= required_zone then return end
local bane = banes[mq.TLO.Me.Class.ShortName()]
local Spellname = mq.TLO.Spell(bane.name).RankName()
if bane and bane.type == 'spell' then
if mq.TLO.Me.Gem(Spellname)() and mq.TLO.Me.Gem(Spellname)() > 0 then return end -- Should be memmed already
StopDPS()
mq.cmdf('/memspell 13 "%s"', Spellname)
mq.delay('4s')
mq.TLO.Window('SpellBookWnd').DoClose()
ResumeDPS()
end
end

---@return boolean @Returns true if the action should fire, otherwise false.
local function condition()
return mq.TLO.Zone.ShortName() == required_zone and mq.TLO.SpawnCount(('%s npc'):format(bane_mob_name))() > 0
end

local function target_bane_mob()
if mq.TLO.Target.CleanName() ~= bane_mob_name then
mq.cmdf('/mqtar %s npc', bane_mob_name)
mq.delay(50)
end
end

local function cast(spell)
mq.cmdf('/cast %s', spell.RankName())
mq.delay(50+spell.MyCastTime())
end

local function use_aa(aa)
mq.cmdf('/alt activate %s', aa.ID())
mq.delay(50+aa.Spell.CastTime())
end

local function bane_ready(bane)
if bane.type == 'spell' then
return mq.TLO.Me.SpellReady(bane.name) and not mq.TLO.Me.Casting()
elseif bane.type == 'aa' then
return mq.TLO.Me.AltAbilityReady(bane.name) and not mq.TLO.Me.Casting()
end
end

local function action()
local my_class = mq.TLO.Me.Class.ShortName()
local bane = banes[my_class]
-- if not a bane class, return
if not bane then return end
-- if bane ability isn't ready, return
if my_class ~= 'BRD' and not bane_ready(bane) then return end
StopDPS()
target_bane_mob()
if bane.type == 'spell' then
cast(mq.TLO.Spell(bane.name))
else
use_aa(mq.TLO.Me.AltAbility(bane.name))
end
while mq.TLO.Me.Casting() do
mq.doevents()
mq.delay(50)
end
ResumeDPS()
end

return {onload=on_load, condfunc=condition, actionfunc=action}
 
Use the one from Post #12, there is an older one which still had a bug. So I posted the final version again in Post #12.
Worked for me with different classes and don’t remember to have seen posted issues since.

You are using the “SheiBanish Import-Code”, the binary one row code to import it to lem, don’t you?
Can you exolain further: “it fails to load”. If you just log in the shaman and see the event in the lem of the shaman, logging in the nec afterwards the event should be there as well.
Does “it fails to load” mean, you get an message/errormessage when attempting to activate it on the nec?

You do see the event on both chars identic inside lem? Like:
1697147038898.png
Are you running both chars on same pc or on different machines? If so, maybe on the second machine there is a prereq missing like “boxr”.
 
Last edited:
Use the one from Post #12, there is an older one which still had a bug. So I posted the final version again in Post #12.
Worked for me with different classes and don’t remember to have seen posted issues since.

You are using the “SheiBanish Import-Code”, the binary one row code to import it to lem, don’t you?
Can you exolain further: “it fails to load”. If you just log in the shaman and see the event in the lem of the shaman, logging in the nec afterwards the event should be there as well.
Does “it fails to load” mean, you get an message/errormessage when attempting to activate it on the nec?

You do see the event on both chars identic inside lem? Like:
View attachment 51502
Are you running both chars on same pc or on different machines? If so, maybe on the second machine there is a prereq missing like “boxr”.
Switching to post 12 fixed it. Next to the active LEM it said - failed to load. LEM was still running and I could use other LEMs. Just not the banish one. And yep, importing the binary one row.

With all that said, it is all fixed. Thanks!
 
Release Lua Event Manager (LEM) Event Library

Users who are viewing this thread

Back
Top
Cart