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
➜ Tips and tricks
➜ Hightlighting Multiple Words in One Line
Hightlighting Multiple Words in One Line
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Aheram
(23 posts) Bio
|
Date
| Wed 22 Dec 2004 12:43 AM (UTC) |
Message
| I am currently pulling out my hair in frustration, trying to figure this problem out.
At the moment, I am trying to figure out how to highlight words (WORDSSSS) in battle messages.
Here are examples.
You smashed Beggar with a bone-crushing sound.
You smashed Beggar to no avail.
You eradicate Beggar to no avail.
You eradicate Beggar with a bone-crushing sound.
What I am trying to do is have a trigger that looks at a line and colors the hit and have another trigger that looks at the same line and then colors the damage. Do I need to script this (bear in mind that the thought scares me, the last time I tried scripting, my alias list vanished)? | Top |
|
Posted by
| Nick Gammon
Australia (23,133 posts) Bio
Forum Administrator |
Date
| Reply #1 on Wed 22 Dec 2004 02:07 AM (UTC) |
Message
| You don't need scripting.
- Make a trigger.
- Make it a regular expression (check the Regular Expression box)
- Choose the word to colour (eg. Beggar) and put that in the Trigger box.
- Choose the colour to set it to (eg. Custom2)
- Make it keep evaluating (check the Keep Evaluating box).
- Repeat this process for any other words you are interested in (ie. make more triggers)
If you want to colour different things the same way, put the "|" symbol (for this OR that) into the match text, eg.
Trigger: to no avail|with a bone-crushing sound
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Aheram
(23 posts) Bio
|
Date
| Reply #2 on Wed 22 Dec 2004 11:17 AM (UTC) |
Message
| Thanks! It was "Keep Evaluating" that I needed!
And wow, what a timely response!
By the way, would there be any updates to MUSH client?
And I have another problem. It is a multiline trigger that I want colored, but it has variables that I want colored differently.
(You|> You|> > You) hurl a fireball at (.*).
And...
(You|> You|> > You) (singed|scorched|severely scorched|burned) (.*).
"You hurl fireball at Target." and "You (damage) Target." will be pale yellow, while the damage "(singed|scorched|severely scorched|burned)" will be colored differently. I want it to be a Multiline trigger because "You (wildcard) (wildcard)" will cause the client to color things I do not want colored. | Top |
|
Posted by
| Nick Gammon
Australia (23,133 posts) Bio
Forum Administrator |
Date
| Reply #3 on Wed 22 Dec 2004 09:44 PM (UTC) |
Message
|
Quote:
By the way, would there be any updates to MUSH client?
Depends which version you currently have, but see this for the latest available right now:
http://www.gammon.com.au/forum/bbshowpost.php?bbsubject_id=5040
However version 3.61 is about to be released.
Quote:
It is a multiline trigger that I want colored ...
Is this really multiple lines with line breaks? Or just a long line which wraps?
The genuine multiple lines are harder to do, because although MUSHclient supports multi-line triggers, it won't go back and retrospectively colour them.
A line-wrap trigger is OK, you just need to get the wildcards right. Rather than using something like "You (wildcard) (wildcard)" use regular expressions that narrow down what you are looking for. You can always have multiple triggers, if one doesn't match it tries another.
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Flannel
USA (1,230 posts) Bio
|
Date
| Reply #4 on Wed 22 Dec 2004 09:48 PM (UTC) |
Message
| Instead of multiline (since that won't allow you to color them at all, let alone differently) how about you have a series of triggers.
In this case two.
Your first trigger would be:
^(You|> You|> > You) hurl a fireball at (.*)\.$
(You have to escape that last period, and the other things ^ and $ are regexp things)
Give it a name (Label).
Make your second trigger match on the second line:
^(You|> You|> > You) (singed|scorched|severely scorched|burned) (.*)\.$
give it a label as well.
Uncheck 'enabled' on the second one.
Then when your first one matches, we're going to enable your second. We do this by changing the 'send to' to script, and sending (assuming youre using VB)
EnableTrigger "Trigger2", 1
where Trigger2 is the label of the second trigger.
We will do the exact same ting on the second one, except it will be disabling itself (EnableTrigger "Trigger2", 0)
This way the second trigger only works after the first one has matched, and will only work once per.
That of course assumes that the first one always is followed by the second. If something else comes up for the second line (if you miss?) then you will get it matching on something else.
However with this, you can indeed match on:
^(> ){0,2}You (.*) (.*)\.$
(which is the same as ^(You|> You|> > You) (.*) (.*)\.$)
As for your first question, yes, MC is updated often. Or at least actively developed. The updates sometimes are a month in between, sometimes a couple hours, depending on what needs to be changed and how many changes comprise an update. |
~Flannel
Messiah of Rose
Eternity's Trials.
Clones are people two. | Top |
|
Posted by
| Aheram
(23 posts) Bio
|
Date
| Reply #5 on Mon 27 Dec 2004 03:07 AM (UTC) |
Message
| Heh. :) MUSH client just became even better!
Thank you for the trick. I love it! | Top |
|
Posted by
| Aheram
(23 posts) Bio
|
Date
| Reply #6 on Mon 27 Dec 2004 03:12 AM (UTC) |
Message
| Taking what Nick and Flannel taught me, I was FINALLY able to do this.
<triggers>
<trigger
custom_colour="2"
enabled="y"
match="^(You|> You|> > You) hurl a fireball at (.*)\.$"
name="Fireball"
regexp="y"
send_to="12"
sequence="100"
other_text_colour="black"
other_back_colour="black"
>
<send>EnableTrigger "FireballDam1", 1
EnableTrigger "FireballDam2", 1
EnableTrigger "FireballDam3", 1</send>
</trigger>
<trigger
custom_colour="2"
keep_evaluating="y"
match="^(You|> You|> > You)"
name="FireballDam1"
regexp="y"
send_to="12"
sequence="100"
other_text_colour="black"
other_back_colour="black"
>
<send>EnableTrigger "FireballDam1", 0</send>
</trigger>
<trigger
custom_colour="7"
enabled="y"
keep_evaluating="y"
match="(singed|scorched|severely scorched|burned)"
name="FireballDam2"
regexp="y"
send_to="12"
sequence="100"
other_text_colour="black"
other_back_colour="black"
>
<send>EnableTrigger "FireballDam2", 0</send>
</trigger>
<trigger
custom_colour="2"
keep_evaluating="y"
match="(.*)\.$"
name="FireballDam3"
regexp="y"
send_to="12"
sequence="100"
other_text_colour="black"
other_back_colour="black"
>
<send>EnableTrigger "FireballDam3", 0</send>
</trigger>
</triggers>
Thanks guys. :) | 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,118 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top