- Joined
- Oct 31, 2019
- RedCents
- 1,695¢
@Sic
many thanks for considering this,
many thanks for considering this,Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.

many thanks for considering this,I made the changes suggested below the post. Where do I put theDoing my first test of this on an easy fight....what could possibly go wrong..
The event fails to load...
View attachment 40743
And I get an Error in the Chat. Event Registration Failed: Griklor
Not sure if its a syntax error or do i need to reload something?
Thank you, I found it now on to another one.I don't think that one was a full example but just a snippet comparing mq2event with the event code in lua.
There should already be an event for the AHR silence in LEM by default, called atensilence.
Each one extended with 2 additional options: "on" and "off" in order to be able to set their state without the need to know the actual state/lem event <eventname> - toggle text event enabled/disabled
/lem cond <eventname> - toggle condition event enabled/disabled
/lem event <eventname> - toggle text event enabled/disabled
/lem event <eventname> on - text event enabled indipended from the former state
/lem event <eventname> off - text event disabled indipended from the former state
/lem cond <eventname> - toggle condition event enabled/disabled
/lem cond <eventname> on - condition event enabled indipended from the former state
/lem cond <eventname> off - condition event disabled indipended from the former state
Should already be there, maybe just not doc'd. any ofFeature extension request:
I would like to have 2 commands extended.
Each one extended with 2 additional options: "on" and "off" in order to be able to set their state without the need to know the actual state
afterwards the two command would be extended to six possible commands as follows:
I would like to activate/deactivate events from hotbuttons or even other Luas and would like to be sure, I achieve the intended state in any case, without the need to create a construct to memorize the actual state when calling the toggle.
/lem cond eventname on|off|0|1|true|falseWhat sort of instructions? Everything it does should be on the overview or on the companion resource event library. Short of writing the Lua code for people, that should be all the info.Is there any kind of tutorial/video/instructions out there for this like there is for the mq2events?
I went totally through it, I am not a programmer however, i know kinda how stuff goes, but not how this thing works. There was a video for setting up events, just wondering if there's something else.@Myysterio you may want to click „Overview“ to find the instructions of how to use it.
First samples if events can be found at the library
${Me.Something} becomes mq.TLO.Me.Something()${Me.Something[somethingelse]} becomes mq.TLO.Me.Something('somethingelse')if (${Me.PctHPs} > 70 && ${Me.PctMana} < 50) { becomes if mq.TLO.Me.PctHPs() > 70 and mq.TLO.Me.PctMana() < 50 thenif (!${Pet.ID}) {if mq.TLO.Pet.ID() == 0 thenif (!${Spawn[npc fippy].ID}) {if not mq.TLO.Spawn('npc fippy')() thenand add the reference to an unload-function likereturn {onload=on_load, condfunc=condition, actionfunc=action}
all existing events should run as usual but one could decide to create a destructor-function to eliminate all the references to tables bei setting them to nil.return {onload=on_load, condfunc=condition, actionfunc=action, onunload=on_unload}
With some help from @toadwart (initial idea and react) and @aquietone (formatting and understanding lem lua) here is an event for maxing your toons to max level for the expansions you have, and then altering AA exp % to keep you pushing to 99.99% into max level, while also gaining AA at the same time based on your current exp% level. For example, if you are 15% into 120, this will apply 15% into AA exp gains. Once you hit 16% into level, changes to 16% AA exp, and so on.
This requires you create a Category named "Character", without quotations.
Here is the Import Code:
[CODE title="AAXPOn Import Code"]cmV0dXJuIHsKIGxvYWQgPSB7CiAgYWx3YXlzID0gZmFsc2UsCiAgY2xhc3MgPSAiIiwKICB6b25lID0gIiIsCiB9LAogY29kZSA9ICJiRzlqWVd3Z2JYRWdQU0J5WlhGMWFYSmxLQ2R0Y1NjcENncHNiMk5oYkNCelpYUmhZWEJqZENBOUlEQUtDbXh2WTJGc0lHWjFibU4wYVc5dUlHTnZibVJwZEdsdmJpZ3BDaUFnSUNCc2IyTmhiQ0JzWlhabGJDQTlJRzF4TGxSTVR5NU5aUzVNWlhabGJDZ3BDaUFnSUNCc2IyTmhiQ0J0WVhoc1pYWmxiQ0E5SUcxeExsUk1UeTVOWlM1TllYaE1aWFpsYkNncENpQWdJQ0JzYjJOaGJDQmxlSEJ3WTNRZ1BTQnRjUzVVVEU4dVRXVXVVR04wUlhod0tDa0tJQ0FnSUd4dlkyRnNJR1Y0Y0hCamRHbHVkQ0E5SUcxeExsUk1UeTVOWlM1UVkzUkZlSEF1U1c1MEtDa0tJQ0FnSUd4dlkyRnNJR1Y0Y0hCamRHbHVkREVnUFNCdGNTNVVURTh1VFdVdVVHTjBSWGh3TGtsdWRDZ3BJQ3NnTVFvZ0lDQWdiRzlqWV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0lHVnNjMlVLSUNBZ0lDQWdJQ0J0Y1M1amJXUm1LQ2N2WVd4MElHOXVJQ1Z6Snl3Z2MyVjBZV0Z3WTNRcENpQWdJQ0JsYm1RS1pXNWtDZ3B5WlhSMWNtNGdlMk52Ym1SbWRXNWpQV052Ym1ScGRHbHZiaXdnWVdOMGFXOXVablZ1WXoxaFkzUnBiMjU5IiwKIGNhdGVnb3J5ID0gIkNoYXJhY3RlciIsCiB0eXBlID0gImNvbmRpdGlvbnMiLAogbmFtZSA9ICJBQVBDVCIsCn0=[/CODE]
Here is the Verbose Code:
[CODE title="AAXPOn Verbose Code"]local mq = require('mq')
local setaapct = 0
local function condition()
local level = mq.TLO.Me.Level()
local maxlevel = mq.TLO.Me.MaxLevel()
local exppct = mq.TLO.Me.PctExp()
local exppctint = mq.TLO.Me.PctExp.Int()
local exppctint1 = mq.TLO.Me.PctExp.Int() + 1
local aapct = mq.TLO.Me.PctExpToAA()
if level ~= maxlevel and aapct > 0 then
setaapct = 0
return true
end
if level == maxlevel and
exppct > 10 and
exppct <= 99.98 and
exppctint ~= aapct then
setaapct = exppctint
return true
end
if level == maxlevel and
exppct > 99.98 and
exppctint1 ~= aapct then
setaapct = exppctint1
return true
end
return false
end
local function action()
if setaapct == 0 then
mq.cmd('/alt off')
else
mq.cmdf('/alt on %s', setaapct)
end
end
return {condfunc=condition, actionfunc=action}
[/CODE]
Shouldn't that be 2*level?[CODE title="StopAA_XP"]cmV0dXJuIHsKIGxvYWQgPSB7CiAgYWx3YXlzID0gZmFsc2UsCiAgY2xhc3MgPSAiIiwKICB6b25lID0gIiIsCiB9LAogY29kZSA9ICJiRzlqWVd3Z2JYRWdQU0J5WlhGMWFYSmxLQ2R0Y1NjcENncHNiMk5oYkNCbWRXNWpkR2x2YmlCbGRtVnVkRjlvWVc1a2JHVnlLQ2tLSUNBZ0lDMHRJRWx0Y0d4bGJXVnVkQ0IwYUdVZ2FHRnVaR3hwYm1jZ1ptOXlJSFJvWlNCbGRtVnVkQ0JvWlhKbExnb2dJQ0FnYlhFdVkyMWtLQ2N2YkdWdElHTnZibVFnUVVGUVExUWdiMlptSnlrS1pXNWtDZ3B5WlhSMWNtNGdlMlYyWlc1MFpuVnVZejFsZG1WdWRGOW9ZVzVrYkdWeWZRPT0iLAogY2F0ZWdvcnkgPSAiIiwKIHR5cGUgPSAiZXZlbnRzIiwKIG5hbWUgPSAiU3RvcEFBX1hQIiwKIHBhdHRlcm4gPSAiIyojWW91IGFyZSBjdXJyZW50bHkgb3ZlciB0aGUgZWFybmVkIEFkdmFuY2VtZW50IHBvaW50IGxpbWl0IyojIiwKfQ==[/CODE]
Quick little LEM to stop your AAXP if you get over 240.
Shouldn't that be 2*level
yes known issueLEM failing to load... Can not open... Permission denied...
Until RG releases a new build, you can either rename lem.Lua to something else and /Lua run somethingelse, or move lem.Lua to lem/init.Lua and /Lua run lemLEM failing to load... Can not open... Permission denied...
Fix an if in an event template
Switch to init.lua pattern
Is this how all Lua scripts will be that have a folder structure?aquietone updated (Mighty) Lua Event Manager with a new update entry:
Couple small template updates and folder layout change
Read the rest of this update entry...
is what how all will be?Is this how all lua scripts will be that have a folder structure?
just referring to the init.Lua change.is what how all will be?
No. There is nothing stopping you from continuing to have something like:Is this how all lua scripts will be that have a folder structure?
myscript.lua and myscript/utils-for-myscript.lua where users would do /lua run myscriptmyscript/start.lua where users would do /lua run myscript/startmyscript/init.lua/lua run myscriptmyscript/init.lualocal mq = require('mq')
local my_class = mq.TLO.Me.Class.ShortName()
local my_mana = mq.TLO.Me.PctMana()
---@return boolean @Returns true if the action should fire, otherwise false.
local function condition()
If my_class == MAG and my_mana < 15 then
mq.cmd('/lua run mm')
end
end
I really don't know why I didn't catch this the first time you asked me about it. Sometimes the derp is strong. Change toSo I am trying to learn this with something easy. I was trying to set up a condition event that checks if the character is a mage and its mana is under 15%, and if so to run the lua mm, which is the mage mana lua from roundeq. What am I missing or need to change to make this wor? Once I get this one figured out I want to set up one for my bard to fire up his epic when my shaman does.
Lua:local mq = require('mq') local my_class = mq.TLO.Me.Class.ShortName() local my_mana = mq.TLO.Me.PctMana() ---@return boolean @Returns true if the action should fire, otherwise false. local function condition() If my_class == MAG and my_mana < 15 then mq.cmd('/lua run mm') end end
if my_class == "MAG" and my_mana < 15 thenIn general, you would run it on every toon so that it can respond to events on each toon its running on. Look at it the same way as mq2events and mq2react, except you can write more complex Lua code to handle the events, opposed to a giant multiline like in the two plugins.Sorry if this question is a bit silly or stupid, but didnt really see anywhere that it was exactly address. I know with MQ2events you need to have that running on each toon. Does Lem need to be running on each toon with the script in there, or running it on the driver sufficient?
Thank youIn general, you would run it on every toon so that it can respond to events on each toon its running on. Look at it the same way as mq2events and mq2react, except you can write more complex lua code to handle the events, opposed to a giant multiline like in the two plugins.
It could also depend on the event, technically you could write an event that runs on the driver and coordinates things to other toons.
0.4.8
- Add `bg` start parameter to start script with UI hidden
Can any of you folks good with Lua tell me why this is not working? For the life of me, I can't figure it outSo I am trying to learn this with something easy. I was trying to set up a condition event that checks if the character is a mage and its mana is under 15%, and if so to run the lua mm, which is the mage mana lua from roundeq. What am I missing or need to change to make this wor? Once I get this one figured out I want to set up one for my bard to fire up his epic when my shaman does.
Lua:local mq = require('mq') local my_class = mq.TLO.Me.Class.ShortName() local my_mana = mq.TLO.Me.PctMana() ---@return boolean @Returns true if the action should fire, otherwise false. local function condition() if my_class == MAG and my_mana < 15 then mq.cmd('/lua run mm') end end
Can any of you folks good with LUA tell me why this is not working? For the life of me, I can't figure it out
local mq = require('mq')
---@return boolean @Returns true if the action should fire, otherwise false.
local function condition()
local my_class = mq.TLO.Me.Class.ShortName()
local my_mana = mq.TLO.Me.PctMana()
local mm_status = mq.TLO.Lua.Script('mm').Status()
return my_class == 'MAG' and my_mana < 15 and mm_status ~= 'RUNNING'
end
local function action()
mq.cmd('/lua run mm')
end
return {condfunc=condition, actionfunc=action}
[CODE title="StopAA_XP"]cmV0dXJuIHsKIGxvYWQgPSB7CiAgYWx3YXlzID0gZmFsc2UsCiAgY2xhc3MgPSAiIiwKICB6b25lID0gIiIsCiB9LAogY29kZSA9ICJiRzlqWVd3Z2JYRWdQU0J5WlhGMWFYSmxLQ2R0Y1NjcENncHNiMk5oYkNCbWRXNWpkR2x2YmlCbGRtVnVkRjlvWVc1a2JHVnlLQ2tLSUNBZ0lDMHRJRWx0Y0d4bGJXVnVkQ0IwYUdVZ2FHRnVaR3hwYm1jZ1ptOXlJSFJvWlNCbGRtVnVkQ0JvWlhKbExnb2dJQ0FnYlhFdVkyMWtLQ2N2YkdWdElHTnZibVFnUVVGUVExUWdiMlptSnlrS1pXNWtDZ3B5WlhSMWNtNGdlMlYyWlc1MFpuVnVZejFsZG1WdWRGOW9ZVzVrYkdWeWZRPT0iLAogY2F0ZWdvcnkgPSAiIiwKIHR5cGUgPSAiZXZlbnRzIiwKIG5hbWUgPSAiU3RvcEFBX1hQIiwKIHBhdHRlcm4gPSAiIyojWW91IGFyZSBjdXJyZW50bHkgb3ZlciB0aGUgZWFybmVkIEFkdmFuY2VtZW50IHBvaW50IGxpbWl0IyojIiwKfQ==[/CODE]
Quick little LEM to stop your AAXP if you get over 240.
