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
➜ Coluring words in triggers differently
Coluring words in triggers differently
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Brothfeder
(16 posts) Bio
|
Date
| Fri 17 Jul 2015 12:16 PM (UTC) Amended on Fri 17 Jul 2015 08:14 PM (UTC) by Brothfeder
|
Message
| I'm trying to get the following to statement to trigger with the first part one color, and the 2nd another color.
You can use another Battlerage ability again. Available abilities: (Dilation|Disintegrate|Squeeze|Firefall|windlash)
So "You can use another Battlerage ability again. Available abilities:" would be one color.
And any of the abilities that are available will be another colour.
Been trying to capture the abilities as wildcards and use custom_colour, however it just wont work out for me.
<triggers
<trigger
enabled="y"
match="^You can use another Battlerage ability again. Available abilities\:$"
custom_colour="9"
regexp="y"
keep_evaluating="y"
sequence="100"
>
</trigger>
<trigger
enabled="y"
match="^You can use another Battlerage ability again. Available abilities\: +(*|*|*|*|*)$"
regexp="y"
keep_evaluating="y"
sequence="110"
>
</trigger>
<triggers>
<trigger
enabled="y"
match="^(%1|%2|%3|%4|%5)$"
custom_colour="15"
regexp="y"
keep_evaluating="y"
sequence="120"
>
</trigger>
</triggers>
So the first trigger colours the first part of the text. The 2nd says capture these wildcards in the context of the statement. And the 3rd colours the wildcards.
Its not working. :( | Top |
|
Posted by
| Nick Gammon
Australia (23,140 posts) Bio
Forum Administrator |
Date
| Reply #1 on Fri 17 Jul 2015 08:48 PM (UTC) |
Message
|
match="^(%1|%2|%3|%4|%5)$"
I'm not sure what this is doing. For one thing, colouring words needs to be done word-by-word, not the whole line. So lose the ^ and the $.
Second, what is %1? You can't carry a wildcard from one trigger into the next one, it doesn't work like that.
You are probably best off making a single trigger (like your second one), omit it from output, and then break it up in a small script, using ColourNote?ColourTell to draw the trigger, and the new abilities, in different colours.
So basically you drop the original line, and redraw it in whatever way you want. |
- 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.
8,699 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top