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
➜ Expand variables and Keep evaluating
Expand variables and Keep evaluating
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Ksajal
(17 posts) Bio
|
Date
| Thu 28 Apr 2011 08:50 AM (UTC) Amended on Thu 28 Apr 2011 08:51 AM (UTC) by Ksajal
|
Message
| I've been trying to get the actual text (another player's name) that the following trigger matches and add it to a table:
<trigger
enabled="y"
expand_variables="y"
group="System_Tracking"
keep_evaluating="y"
match="@!highlight_enemies"
name="get_toenemy"
regexp="y"
repeat="y"
sequence="1"
>
<send>table.insert (to_enemy, "%0")</send>
</trigger>
Highlight_enemies looks like this "Bob|John|Mark", and the trigger WILL match more than once on the same line.
"%0" stores the pattern, and not the matching text, any suggestions how I can make it work? | Top |
|
Posted by
| Nick Gammon
Australia (23,140 posts) Bio
Forum Administrator |
Date
| Reply #1 on Thu 28 Apr 2011 08:57 AM (UTC) |
Message
| You are not sending to script, so I can't see how that can begin to work. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Ksajal
(17 posts) Bio
|
Date
| Reply #2 on Thu 28 Apr 2011 09:25 AM (UTC) |
Message
| Yes, sorry, I don't know how that happened
Here it is:
<trigger
expand_variables="y"
group="System_Tracking"
keep_evaluating="y"
match="@!highlight_enemies"
name="get_toenemy"
regexp="y"
repeat="y"
send_to="12"
sequence="1"
>
<send>table.insert (to_enemy, "%0")
Note ("%0")</send>
</trigger>
It only prints the first matching name. | Top |
|
Posted by
| Twisol
USA (2,257 posts) Bio
|
Date
| Reply #3 on Thu 28 Apr 2011 10:00 AM (UTC) |
Message
| Huh. I can reproduce this:
<triggers>
<trigger
custom_colour="2"
enabled="y"
ignore_case="y"
keep_evaluating="y"
match="Bob|George|Paul"
regexp="y"
repeat="y"
send_to="12"
sequence="100"
>
<send>Note("%0")</send>
</trigger>
</triggers>
Simulate("Bob, George, Paul\r\n")
All three names are highlighted, but only Bob is echoed. |
'Soludra' on Achaea
Blog: http://jonathan.com/
GitHub: http://github.com/Twisol | Top |
|
Posted by
| Nick Gammon
Australia (23,140 posts) Bio
Forum Administrator |
Date
| Reply #4 on Thu 28 Apr 2011 11:25 AM (UTC) |
Message
| When you check "repeat on same line" that refers to highlighting. It doesn't do the action multiple times (eg. call a script, send a response).
You need to match the entire line, and then in a script work out which ones to add to your table. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Ksajal
(17 posts) Bio
|
Date
| Reply #5 on Thu 28 Apr 2011 05:26 PM (UTC) |
Message
| Thanks, I did just that. | 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.
20,315 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top