Convert as in automatically take an event and turn it into lua? No, nothing like that. However, anything written in mq2events or mq2react should be able to be written with LEM. Its not necessary to convert them unless you just really wanted to for some reason.
The main reason for LEM was to write potentially more complex events without having to write a lot of the plumbing of a one-off script like the ones which have been written for shei and AHR missions. For example, in mq2events it gets complicated very quickly writing some giant multiline ${If[,,,]} statement.
For a comparison from mq2events to lua, can look at the atensilence event I included with lem:
mq2event ini
Code:
[AtenHaRa]
trigger=#*#Aten Ha Ra points at |${Me.Name}|#*#
command=/docommand ${If[${EventArg1.Equal[${Me}]} && !${Group.Member[0].MainAssist},/multiline ; /docommand /${Me.Class.ShortName} mode 0; /mqp on; /twist off; /if (${Me.ActiveDisc.Name.Find[Frenzied Resolve Discipline]}) /stopdisc; /timed 5 /afollow off; /nav stop; /target clear; /timed 10 /nav locxyz 1186.12 0.932035 235.003; /timed 150 /docommand /${Me.Class.ShortName} mode 2; /timed 150 /mqp off; /timed 150 /twist on,/docommand ${If[${EventArg1.Equal[${Group.MainAssist}]} && !${Group.Member[0].MainAssist},/multiline ; /docommand /${Me.Class.ShortName} mode 0; /mqp on; /twist off; /if (${Me.ActiveDisc.Name.Find[Frenzied Resolve Discipline]}) /stopdisc; /timed 5 /afollow off; /nav stop; /target clear; /timed 10 /nav locxyz 1186.12 0.932035 235.003; /timed 150 /docommand /${Me.Class.ShortName} mode 2; /timed 150 /mqp off; /timed 150 /twist on,/echo BAD]}]}
lua code
Lua:
local function event_handler(line, target)
if not mq.TLO.Zone.ShortName() == 'vexthaltwo_mission' then return end
local my_class = mq.TLO.Me.Class.ShortName()
local i_am_ma = mq.TLO.Group.Member(0).MainAssist()
local my_name = mq.TLO.Me.CleanName()
local ma_name = mq.TLO.Group.MainAssist.CleanName()
-- Run away if I am the target and I am not the MA, or if the MA is the target and I am not the MA
if not i_am_ma and (target == my_name or target == ma_name) then
mq.cmdf('/%s mode 0', my_class) -- pause CWTN and other sorts of automation
if my_class == 'BER' and mq.TLO.Me.ActiveDisc.Name() == mq.TLO.Spell('Frenzied Resolve Discipline').RankName() then
mq.cmd('/stopdisc') -- Stop BER disc that roots you in place so you can run if you are a BER
end
mq.cmd('/mqp on')
mq.cmd('/twist off')
mq.cmd('/afollow off')
mq.cmd('/nav stop')
mq.cmd('/target clear')
mq.delay(100)
mq.cmd('/nav locxyz 1222.67 -48.97 236.41') -- Move to the safe spot
mq.delay(15000)
mq.cmdf('/%s mode 2', my_class) -- Unpause and return with CWTN chase mode
mq.cmd('/mqp off')
mq.cmd('/twist on')
end
end
These both accomplish the same thing. It just comes down to personal preference. If you're very familiar with macros you could pick apart that giant command into the individual components and make edits to it. Meanwhile, the lua code is pretty readable.