Sequence of two triggers matching on the same line

Posted by Wyd on Sun 28 Dec 2008 03:11 AM — 5 posts, 18,869 views.

#0
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!
Amended on Sun 28 Dec 2008 03:12 AM by Wyd
Australia Forum Administrator #1
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.
#2
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>
Netherlands #3
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. :)
Australia Forum Administrator #4
Try giving both triggers a name (label) and turn Trace on. Then see if both fire, and if so, in what order.