• 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

Problem - Head scratcher: Cant get a Text Event to trigger

Joined
Mar 20, 2024
RedCents
1,051¢
I got a Text Event that just wont trigger, and I have no idea why.

The idea is to trigger some custom code when the last mob in the XTarget list dies. So, I have created a Text Event that triggers on the sentence You have gained (#1#) party experience! (#2#), and the code inside the event is...

Code:
local mq = require('mq')

if not package.loaded['events'] then
end
local function on_load()
end

local function event_handler(line, exp, exppct)

    if mq.TLO.Me.XTarget() == 0 then
        print("Success!")
    end

end

return {eventfunc=event_handler}

Unfortunately, the event does not trigger. I have tried other Text combinations such as You have gained * , You have gained (*) party experience! (*) or * party experience *, but no luck. The print("Success!") just doesnt get printed.

What am I doing wrong? Thanks!

Screenshot 2024-08-11 091225.png
 
Last edited:
Perhaps your input string (event pattern) is incorrect?

A quick search through eqlogparser for 'party experience' shows me the following:

Code:
[Fri Aug 09 01:06:14 2024] You gain party experience! (0.036%)
[Fri Aug 09 01:07:25 2024] You gain party experience! (0.078%)
[Fri Aug 09 01:17:26 2024] You gain party experience! (0.052%)

There may be another input string for exp gain (aa, etc). I also have a string that has no number output:

Code:
[Thu Aug 08 06:08:11 2024] You gain party experience!
[Thu Aug 08 06:08:23 2024] You gain party experience!
 
Is your thingie supposed to have a percent sign somewhere?

I am not sure I understand, but I have also tried with the trigger line You have gained (#1#) party experience! (#2#%) and it doesnt work. I do not need the passed variables (#1# and #2#) anywhere in my code.
 
I am not sure I understand, but I have also tried with the trigger line You have gained (#1#) party experience! (#2#%) and it doesnt work. I do not need the passed variables (#1# and #2#) anywhere in my code.
Well if you don't need the variables to be passed you can wildcard with #*#, right?
I haven't played with text triggers in LEM but in examples I've never seen a pattern without wildcards on either end (not claiming it isn't possible).

If that ain't it hopefully someone more smarterer or less tireder will help out.
 
event triggers fine for me on laz, have you tried changing the code? does it still print nothing if you don't have that if mq.TLO.Me.XTarget() == 0?

xtarget also works like complete trash on emu so there is a good chance the value is just not 0 even if your ext target looks empty.
 
Well if you don't need the variables to be passed you can wildcard with #*#, right?

Yes, I have tried with #*# too. Same result unfortunately.

event triggers fine for me on laz, have you tried changing the code? does it still print nothing if you don't have that if mq.TLO.Me.XTarget() == 0?

Good thinking, I thought that too. Unfortunately, I removed the mq.TLO.Me.XTarget() == 0, therefore leaving only the print("Success!") . Same result: Nothing is printed on screen.

It is like the "You gained experience" message is not read by LEM at all. Could that be even possible?
 
you are making your trigger too tight

You have gained #*# experience #*#

try that one
 
you are making your trigger too tight

You have gained #*# experience #*#

try that one

Unfortunately, same results: the Text Event does not trigger. I event tried You have gained #*# to no avail.

Can anyone in Lazarus please try this same Text Event to confirm whether it's just me please?
 
this triggers for me on Laz.

1723435169141.png

[CODE title="import code"]cmV0dXJuIHsKIFsibmFtZSJdID0gIkV4cEdhaW5lZCIsCiBbImxvYWQiXSA9IHsKICBbImFsd2F5cyJdID0gZmFsc2UsCiAgWyJ6b25lIl0gPSAiIiwKICBbImNsYXNzIl0gPSAiIiwKIH0sCiBbInR5cGUiXSA9ICJldmVudHMiLAogWyJjYXRlZ29yeSJdID0gIiIsCiBbInNpbmdsZWNvbW1hbmQiXSA9IGZhbHNlLAogWyJwYXR0ZXJuIl0gPSAiIyojWW91IGhhdmUgZ2FpbmVkICMqIyBleHBlcmllbmNlIyojIiwKIFsiY29kZSJdID0gImJHOWpZV3dnYlhFZ1BTQnlaWEYxYVhKbEtDZHRjU2NwQ2dwc2IyTmhiQ0JtZFc1amRHbHZiaUJsZG1WdWRGOW9ZVzVrYkdWeUtHeHBibVVwQ25CeWFXNTBLQ0pUZFdOalpYTnpJRmx2ZFNCSFlXbHVaV1FnUlZoUUlTRWlLUXBsYm1RS0NuSmxkSFZ5YmlCN1pYWmxiblJtZFc1alBXVjJaVzUwWDJoaGJtUnNaWEo5IiwKfQ==[/CODE]
 
Question I have just realized:
If I have a mq.event() configured inside my Condition Events scripts, does that interfere with the Text Events?
 
@Yaguex if no text triggers are working make sure you have MQ2Events loaded /plugin mq2events
Lem has no reliance on mq2events or mq2react.

Question I have just realized:
If I have a mq.event() configured inside my Condition Events scripts, does that interfere with the Text Events?
You put an mq.event inside of a Lem event? I'm not sure anyone's done that, and not sure what impact it would have.. if you never disable the event it might be ok? But I wouldn't really recommend putting your events inside Lem events.. just write a separate script at that point.
 
Unfortunately, same results: the Text Event does not trigger. I event tried You have gained #*# to no avail.

Can anyone in Lazarus please try this same Text Event to confirm whether it's just me please?
As mentioned I did try with both raid aa xp and group regular xp events and they triggered fine on lazy with the exact pattern from your original post.
 
As mentioned I did try with both raid aa xp and group regular xp events and they triggered fine on lazy with the exact pattern from your original post.

What a strange thing. I literally copied your same code and triggering text, and it doesnt work for me.

You put an mq.event inside of a Lem event? I'm not sure anyone's done that, and not sure what impact it would have..

I followed this guide and it works pretty well: https://docs.macroquest.org/lua/events-and-binds/
 
LEM is already doing the mq.event() call and creation, for you using your trigger and calling its own callback function.
which is why it may cause errors if you are creating your own events as well.
 
LEM is already doing the mq.event() call and creation, for you using your trigger and calling its own callback function.
which is why it may cause errors if you are creating your own events as well.

Yup, I think that might be the culprit of the issue: gotta run one or the other, but not both simulatenously. Worth noting in the documentation to avoid confusion.
 
Yup, I think that might be the culprit of the issue: gotta run one or the other, but not both simulatenously. Worth noting in the documentation to avoid confusion.
What do you mean by run one or the other? You can run Lem alongside mq2events or any number of other Lua scripts that register their own events.
 
What do you mean by run one or the other? You can run Lem alongside mq2events or any number of other lua scripts that register their own events.

Sorry for confusion. I meant running mq.events() inside my Conditions Events vs running Text Events separately (both configured inside LEM - I only use LEM). Perhaps having both simultaneously creates conflicts? I am not a programer, so there is a good chance Im talking bollocks :)
 
Problem - Head scratcher: Cant get a Text Event to trigger

Users who are viewing this thread

Back
Top
Cart