Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ General ➜ Sequence of two triggers matching on the same line

Sequence of two triggers matching on the same line

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Wyd   (14 posts)  Bio
Date Sun 28 Dec 2008 03:11 AM (UTC)

Amended on Sun 28 Dec 2008 03:12 AM (UTC) by Wyd

Message
Hi,

I've only just started using Mush again after a long time, so chances are my problems are comming from not knowing how things work exactly, but here it is.

I have two triggers (below). One is just a simple single line trigger which I use to capture the prompt, and redraw it with some extra info. The other is a multiline trigger I am using to track where my weapons hit.

The aim of the multiline trigger is only to fire if the attack isn't parried/dodged (meaning that the line following it is either another attack line, or the prompt)

Whats happening is that the multiline trigger while fire on the prompt if the first trigger is not active, but doesn't fire (but fires on two attacks) if the prompt is being redrawn. - which is what needs to happen

Here is a couple of examples of what comes from the Mud

Lightning-quick, you jab Uli's left arm with a gleaming scimitar.
Uli parries the attack with a deft manoeuvre.
You slash into Uli's left arm with a gleaming scimitar.
Uli parries the attack with a deft manoeuvre.
4740h, 4745m, 19490e, 18340w, 67% cekdb-

and

You swing a gleaming scimitar at Uli's left arm with all your might.
Lightning-quick, you jab Uli's left arm with a gleaming scimitar.
4740h, 4727m, 19490e, 18340w, 67% cekdb-

And the triggers:

<triggers>
<trigger
enabled="y"
group="Prompt"
keep_evaluating="y"
match="^(\d+)h\, (\d+)m\, (\d+)e\, (\d+)w, (\d+)% ([cexkdb@]*)\-"
omit_from_output="y"
regexp="y"
repeat="y"
send_to="14"
sequence="100"
>
<send>
stats.health = %1
stats.mana = %2
stats.endurance = %3
stats.willpower = %4
stats.xp = %5
stats.flags = "%6"

drawprompt ()</send>
</trigger>
</triggers>

and

<triggers>
<trigger
enabled="y"
expand_variables="y"
lines_to_match="2"
keep_evaluating="y"
match="^(Lightning-quick, you jab \w+'s \w+ \w+ with a .*\.|You swing a .* at \w+'s \w+ \w+ with all your might\.|You slash into \w+'s \w+ \w+ with a .*\.)$\n^(Lightning-quick, you jab \w+'s \w+ \w+ with a .*\.|You swing a .* at \w+'s \w+ \w+ with all your might\.|You slash into \w+'s \w+ \w+ with a .*\.|\d+h, \d+m.*$)"
multi_line="y"
regexp="y"
send_to="12"
>
<send></send>
</trigger>
</triggers>


I've pulled out some of the scripting itself, to make things clearer.

I've tried playing around with the regex for the prompt capturing in the multi-line trigger and changing it to match the new trigger...but that didn't do anything either - and I was under the impression that shouldn't matter, because its got a lower sequence then the single-line trigger.

I hope that makes sense!
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #1 on Sun 28 Dec 2008 05:44 AM (UTC)
Message
I don't see a lower sequence number on your multi-line trigger, in fact I don't see one at all. The default is 100, which means they will have the same sequence.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Wyd   (14 posts)  Bio
Date Reply #2 on Sun 28 Dec 2008 09:07 AM (UTC)
Message
Opps, I'd set it to 0 while I was just changing things trying to get it to work, and forgot to send it back - here's the corrected version

<triggers>
<trigger
enabled="y"
expand_variables="y"
lines_to_match="2"
keep_evaluating="y"
match="^(Lightning-quick, you jab \w+'s \w+ \w+ with a .*\.|You swing a .* at \w+'s \w+ \w+ with all your might\.|You slash into \w+'s \w+ \w+ with a .*\.)$\n^(Lightning-quick, you jab \w+'s \w+ \w+ with a .*\.|You swing a .* at \w+'s \w+ \w+ with all your might\.|You slash into \w+'s \w+ \w+ with a .*\.|\d+h, \d+m.*$)"
multi_line="y"
regexp="y"
send_to="12"
sequence="50"
>
<send></send>
</trigger>
</triggers>
Top

Posted by Worstje   Netherlands  (899 posts)  Bio
Date Reply #3 on Sun 28 Dec 2008 02:55 PM (UTC)
Message
First of all, you probably want to adjust your regular expressions to account for head and torso besides the left/right arm/leg combinations. Your current ones won't match those. :)

Second, while I am not sure what particularly causes your problem (your original post confuses me a bit), I have a feeling you may be looking at the wrong place for your problem. While I didn't test anything (assuming the problem is still there even with the amendments from your last post), the triggers themselves seem to match up just fine. IRE muds do not send a newline after the prompt. This means MUSHclient won't know when the prompt ends, and when to start trying to match it. To fix this, you should enable the 'Convert IAC EOR/GA to newline' option in the Output screen of your World configuration.

If you already have that set though... well, I'll need more information as to what the actual issue is. :)
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #4 on Sun 28 Dec 2008 08:13 PM (UTC)
Message
Try giving both triggers a name (label) and turn Trace on. Then see if both fire, and if so, in what order.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


14,737 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.