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
➜ Trigger, print the match?
|
Trigger, print the match?
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
| Posted by
| Zeno
USA (2,871 posts) Bio
|
| Date
| Fri 03 Aug 2007 01:16 AM (UTC) |
| Message
| I have a trigger that is using a few ors. Something like this:
hits you for (.*)|You dodge|(.*) looks up
I want to send what it matched on to the status bar. But I'm not sure how. I can't use %1 of course, that would just print one word. And since it's an or, I'm not sure what it would be matching. |
Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org | | Top |
|
| Posted by
| Nick Gammon
Australia (23,173 posts) Bio
Forum Administrator |
| Date
| Reply #1 on Fri 03 Aug 2007 01:25 AM (UTC) |
| Message
| %0 is the whole match.
eg.
<triggers>
<trigger
enabled="y"
match="hits you for (.*)|You dodge|(.*) looks up"
regexp="y"
send_to="2"
sequence="100"
>
<send>%%0 = %0</send>
</trigger>
</triggers>
Input line:
Nick hits you for 20
Prints:
%0 = hits you for 20
Another possibility is to enclose the whole thing in brackets, eg.
match="(hits you for (.*)|You dodge|(.*) looks up)"
Now %1 is "hits you for 20" and %2 is "20". |
- 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.
6,749 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top