Using a variable in a trigger to chase and re-engage (Can't make it work!)

Posted by Klaak on Fri 08 Nov 2013 07:52 PM — 6 posts, 22,540 views.

#0
I read through the FAQ and read the example about creating a trigger to match on a variable (@target). I already set up a targeting alias following the instructions in Nick's YouTube video.

However, when I set up the trigger I start with this from the example in the FAQ:

<triggers>
<trigger
custom_colour="7"
enabled="y"
expand_variables="y"
match="@target hits you!"
sequence="100"
>
<send>punch @target</send>
</trigger>
</triggers>

Then I modify that trigger and change it to:

<triggers>
<trigger
custom_colour="7"
enabled="y"
expand_variables="y"
match="@target leaves *"
sequence="100"
>
<send>%1
murder @target</send>
</trigger>
</triggers>

Then I set my target to Bob
So when I'm fighting Bob, if Bob flees the echo will be:

Bob has fled!
Bob leaves west.

Which I'm expecting should match on Bob leaves west (since @target=Bob, and match="@target leaves *") and should send: west; murder bob

However, when I use the Test Trigger function under the Game menu, nothing happens.

I even tried to use the example trigger from the FAQ without modification and used the Test Trigger function to send:

Bob hits you!

But still had nothing happen. When I use Test Trigger on any of my other triggers, it works perfectly, just not on this one.
USA #1

match="@target leaves *"


this should send "west." not exactly what your after.


But onto the main topic, as you have described all this, i would have to guess it is a case sensitivity problem. (bob vrs Bob)

your trigger worked just fine for me, when i actually had the info come from the mud. i dont really use the test trigger feature, but i managed to get it to work there too.
Amended on Fri 08 Nov 2013 08:17 PM by Chyort
#2
Chyort said:


as you have described all this, i would have to guess it is a case sensitivity problem. (bob vrs Bob)

your trigger worked just fine for me, when i actually had the info come from the mud. i dont really use the test trigger feature, but i managed to get it to work there too.



That's strange, because I can check "ignore case" and it still doesn't fire. If, while logged in to the mud, I SAY the match for any of my other triggers, they fire as if it was something that actually happened. But when I say, "Bob leaves west." nothing happens. I've tried it both upper case and lower case, with the period and without the period. I even tried just saying, "Bob leaves" and still nothing.
Amended on Fri 08 Nov 2013 08:53 PM by Klaak
USA #3
On RoD when you say something it is "You say 'blablabla'"
so even if i had something set to match "blablabla" it wouldn't fire because of the start of line/end of line stuff.

i would have to hit the convert to regular expression and delete the start of line ^ and end of line $ to get it to fire off a say.

When i'm testing triggers i typically put it into a note or other similar methods... basically make the mud fake the exact output that i want to see. but yeah, as i said i managed to get it to work with test trigger... i had to add in a new line special character to get it to fire though (i seem to recall, again not a feature i use much)
#4
Tried testing it with a note, but still got no match. I'm totally at a loss here...
Australia Forum Administrator #5
When using Test Trigger, I normally start with a blank line (Ctrl+Enter) to wrap up any previous prompt or stuff that might be there.

Then finish with another newline, eg.


<Ctrl+Enter>
Bob leaves west
<Ctrl+Enter>


(Of course you just see blank lines, not <Ctrl+Enter>).