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
➜ Lua
➜ Using a variable in a trigger to chase and re-engage (Can't make it work!)
Using a variable in a trigger to chase and re-engage (Can't make it work!)
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Klaak
(5 posts) Bio
|
Date
| Fri 08 Nov 2013 07:52 PM (UTC) |
Message
| 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. | Top |
|
Posted by
| Chyort
USA (58 posts) Bio
|
Date
| Reply #1 on Fri 08 Nov 2013 08:16 PM (UTC) Amended on Fri 08 Nov 2013 08:17 PM (UTC) by Chyort
|
Message
|
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. | Top |
|
Posted by
| Klaak
(5 posts) Bio
|
Date
| Reply #2 on Fri 08 Nov 2013 08:52 PM (UTC) Amended on Fri 08 Nov 2013 08:53 PM (UTC) by Klaak
|
Message
|
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. | Top |
|
Posted by
| Chyort
USA (58 posts) Bio
|
Date
| Reply #3 on Fri 08 Nov 2013 09:24 PM (UTC) |
Message
| 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) | Top |
|
Posted by
| Klaak
(5 posts) Bio
|
Date
| Reply #4 on Sat 09 Nov 2013 02:52 AM (UTC) |
Message
| Tried testing it with a note, but still got no match. I'm totally at a loss here... | Top |
|
Posted by
| Nick Gammon
Australia (23,140 posts) Bio
Forum Administrator |
Date
| Reply #5 on Sat 09 Nov 2013 04:15 AM (UTC) |
Message
| 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>). |
- 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.
17,222 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top