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
➜ Need a method to manually terminate the multi-line trigger
|
Need a method to manually terminate the multi-line trigger
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
| Posted by
| Zhenzh
China (68 posts) Bio
|
| Date
| Mon 15 Jan 2018 08:59 AM (UTC) |
| Message
| I'm using multi-line trigger to capture the description of a room. The general description looks like:
Roomename -
Roome description line 1
Roome description line 2
Roome description line 3
...
Roome description line n
Roome exit is xxx
The trigger I have is:
^(\S+) - \n(?:(.*)\n)*
Enabled multi-line flag and set max_line to 10 as I don't know how many description lines a room may has.
In the sendto section, I compare all captured strings and keep on con-cat them until the string "exit is" is found.
I tried disabling the trigger at "exit is" being found. The trigger works find at the first time I looking at a room whose description lines are less then 10(suppose it's 5 lines in this topic).
But the problem comes when I enable the trigger again to capture another room. The trigger immediately compared 5 more noisy lines before I looking at a new room.
Seems the multi-line trigger will not reset and start a new comparison before the previous compare completing specified lines.
This my case, I specified max line to 10 while the first trigger was disabled at the 5th line room description. When the trigger is re-enabled, it directly capture the rest 5 lines.
I wonder is there any way to manually terminate/reset the previous used multi-line trigger?
I mean when I think the captured lines are enough for the current trigger, I can force get ride of comparing the rest lines.
I have also tried one-short flag to auto-delete the multi-line trigger itself but the trigger was deleted immediately after completing 1st line, the other multiple lines were ignored. Seems one-short can not support multi-line trigger. | | Top |
|
| Posted by
| Nick Gammon
Australia (23,173 posts) Bio
Forum Administrator |
| Date
| Reply #1 on Mon 15 Jan 2018 09:03 AM (UTC) Amended on Mon 15 Jan 2018 09:04 AM (UTC) by Nick Gammon
|
| Message
|
The above link shows a much easier way of doing this, with much more control over what is matched. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| Zhenzh
China (68 posts) Bio
|
| Date
| Reply #2 on Mon 15 Jan 2018 09:44 AM (UTC) |
| Message
| Thank you so much.
That's what I'm looking for. | | 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.
14,736 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top