Register forum user name Search FAQ

Gammon Forum

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.
 Entire forum ➜ MUSHclient ➜ General ➜ Highlighting (It's been done before, I've checked)

Highlighting (It's been done before, I've checked)

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Underscore   (2 posts)  Bio
Date Mon 24 Mar 2003 11:44 PM (UTC)
Message
I'm trying to do a simple highlight for a mud I play on and found the following resource: http://www.gammon.com.au/mushclient/funwithtriggers.htm . I tried doing using the command ^.*Insert tex here.*$ however it's not highlighting the text when that phrase is outputted from the MUD. So, I'm very confoozled. I know what the text is going to be and I know I want to highlight it. I'm using version 3.34, if that helps any. If someone would either kindly answer my question or point me in the direction of something a little less confoozling, I'd be extremely appreciative.
Top

Posted by Nick Gammon   Australia  (23,120 posts)  Bio   Forum Administrator
Date Reply #1 on Tue 25 Mar 2003 04:59 AM (UTC)
Message
The first question is, is the trigger matching? When you edit that trigger there will be a "match count" displayed. If that is zero, then for some reason you haven't got an exact match.

You could put something like "trigger matched" in the "send" box and change to "send to output" just to send yourself a message if it matches (temporarily of course).

If it *is* matching then you need to make sure you have set "change colour to" the appropriate colour you want to highlight in.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Plazgoth   USA  (10 posts)  Bio
Date Reply #2 on Tue 25 Mar 2003 05:43 PM (UTC)
Message
Here is a quick way of highlighting a single word which I use in my script.

sub HW(Word)
World.deletetrigger "Highlight"
World.addtrigger "Highlight", "(" + Word + ")", "", eEnabled + eIgnoreCase + eTriggerRegularExpression , 3,0, "", ""
end sub

If you want to change the color and all that lookup the addtrigger funtion. So in your command window you would just type:/ hw "Gold"
And the word Gold will be highlighted everywhere it comes up. you can change what words get highlighted by executing it again. and if you do not want any words just type: / hw ""
This only highlights a single word at a time. But if you wanted a more permananet highlight just copy the trigger this script creates and use it.

Regards,
Plazgoth
Top

Posted by Underscore   (2 posts)  Bio
Date Reply #3 on Wed 26 Mar 2003 12:03 AM (UTC)
Message
Hmm..Well. I've got my trigger set up in the following way:

Trigger:Strengthen
Match any on any
Send:IT WORKED!

Enabled:checked
Ignore Case:checked
Omit from log file:unchecked
Omit from output:unchecked
Keep evaluating:unchecked
Regular Expression:unchecked
Repeat on same line:grayed
Expand variables:unchecked
Temporary:unchecked

Make wildcards lower-case:unchecked

Custom color is at Custom6
Italic:checked
Underline:checked
Bold:grayed

Send to:World

Picked the sound of a cow mooing, so i can hear if it works also

and left Sequence, Copy Wildcard, Lavel, Script, and group alone

From what I've read, that's supposed to highlight any cases of the word, but It hasn't had one call yet. From that information, can you tell me if I'm doing anything wrong, and how I would apply that to a phrase?
Top

Posted by Nick Gammon   Australia  (23,120 posts)  Bio   Forum Administrator
Date Reply #4 on Wed 26 Mar 2003 12:46 AM (UTC)
Message
First, you would find it easier to click on the trigger in the trigger list, then the Copy button, and paste that. It gives us the exact information about your trigger without the possibility of transcription errors.

Second, if you are trying to highlight the single word "Strengthen" you must check "regular expression" (which you haven't) otherwise it only matches an entire line consisting of the word "Strengthen" and nothing else.

Regular expressions are more powerful, they can match on partial lines, and because of that you can colour partial lines.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Guest1   USA  (256 posts)
Date Reply #5 on Wed 26 Mar 2003 04:54 AM (UTC)
Message

  <trigger
   custom_colour="6"
   enabled="y"
   match="(Strengthen)"
   regexp="y"
   sequence="100"
  >
  </trigger>


try pasting that in your world file
Top

Posted by Nick Gammon   Australia  (23,120 posts)  Bio   Forum Administrator
Date Reply #6 on Wed 26 Mar 2003 05:55 AM (UTC)
Message
The brackets aren't really required in this case. Try just using:


match="Strengthen"



This makes it clearer you are matching on that word.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Nick Gammon   Australia  (23,120 posts)  Bio   Forum Administrator
Date Reply #7 on Sun 26 Dec 2004 04:30 AM (UTC)
Message
Quote:

I'm trying to do a simple highlight for a mud I play on ...


This is now easily done with a quick dialog box. See:

http://www.gammon.com.au/forum/bbshowpost.php?bbsubject_id=5071

- 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.


25,126 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.