Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to "verify" your details, 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.
Entire forum
➜ MUSHclient
➜ General
➜ Multi Line Trigger
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Mudletusr
(2 posts) Bio
|
Date
| Mon 01 Apr 2024 12:10 PM (UTC) |
Message
| Hi I"m trying to get this small multi line trigger working thanks. I want to match the last word of the second line.
Right here you (.*)$(.*)(\w+).*\z
For example:
Right here you see:
- The rabbit
- A field mouse
Should match rabbit but isn't outputting what I want. I use this:
say 'k %1 %2 aaaaaaaaaaaaa'
say 'k %1 %2 bbbbbbbbbbbb'
thanks | Top |
|
Posted by
| Nick Gammon
Australia (23,070 posts) Bio
Forum Administrator |
Date
| Reply #1 on Tue 02 Apr 2024 02:32 AM (UTC) |
Message
| Can you show the actual trigger please? See this:
|
For advice on how to copy aliases, timers or triggers from within MUSHclient, and paste them into a forum message, please see Copying XML.
|
Quote:
Should match rabbit but isn't outputting what I want.
What is it outputting? |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Nick Gammon
Australia (23,070 posts) Bio
Forum Administrator |
Date
| Reply #2 on Tue 02 Apr 2024 02:46 AM (UTC) Amended on Tue 02 Apr 2024 02:47 AM (UTC) by Nick Gammon
|
Message
| Try this:
<triggers>
<trigger
enabled="y"
lines_to_match="2"
match="Right here you (.*)\n(?:.*)\s+(\w+)\Z"
multi_line="y"
regexp="y"
send_to="12"
sequence="100"
>
<send>
print ("%%1 = %1")
print ("%%2 = %2")
</send>
</trigger>
</triggers>
|
For advice on how to copy the above, and paste it into MUSHclient, please see Pasting XML.
|
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Mudletusr
(2 posts) Bio
|
Date
| Reply #3 on Wed 03 Apr 2024 04:43 AM (UTC) |
Message
| That worked thanks a lot! | 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.
1,823 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top