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.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ General ➜ Multiple trigger colors

Multiple trigger colors

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


Posted by Drraagh   (4 posts)  Bio
Date Thu 17 Apr 2008 06:52 PM (UTC)
Message
I've read through the forums and have noticed a few things I was doing wrong and have been able to fix most of my problems, but I am wondering if there is some way I might be able to get this idea I am having to work.

Currently, I have a trigger that colors just the channel names, so that [Public] is one color and [Newbie] is another one. So, [Public] John Doe says, "Test." comes back with only [Public] colored.

What I want to do is make it so whatever is said, but only on channels is colored. I don't want the stuff people say not on channel to be colored.

I set a trigger as a lower sequence, set to match * says, "*", and it colors the whole line, overriding the earlier one, due to matching the wildcard. What I am trying to find out is, is there any way to match multiple colors on a line? Or, is it just that we can match multiple triggers, have multiple reactions, but not colors?
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #1 on Thu 17 Apr 2008 09:20 PM (UTC)

Amended on Fri 18 Apr 2008 03:45 AM (UTC) by Nick Gammon

Message
You know, it really helps to see what you have done when you paste problems about triggers. When you start a new thread it says:

Quote:

If you are having problems getting a trigger to work, please help us to help you more quickly by providing the following information:

* A literal copy of the trigger (there is a Copy button) ...


It helps to know if you are using regular expressions, what sequence numbers you are using, and whether you have "keep evaluating" checked.

If I read your post correctly you want to colour each chat channel, differently, but not colour ordinary "say"s?

Well in that case you don't need to catch ordinary chat at all, if your channel trigger is specific enough. For example:


<triggers>
  <trigger
   custom_colour="17"
   colour_change_type="1"
   enabled="y"
   match="[Public] * says, &quot;*&quot;"
   sequence="100"
   other_text_colour="salmon"
  >
  </trigger>

  <trigger
   custom_colour="17"
   colour_change_type="1"
   enabled="y"
   match="[Newbie] * says, &quot;*&quot;"
   sequence="100"
   other_text_colour="lime"
  >
  </trigger>
</triggers>


These two triggers colour the [Public] and [Newbie] channels - the entire line, but don't colour * says, "*", simply because the ordinary chat doesn't have a channel name in square brackets.

Does that answer the question? Or have I missed something?

See http://mushclient.com/pasting for how to copy those triggers into the client.

- Nick Gammon

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

Posted by Drraagh   (4 posts)  Bio
Date Reply #2 on Wed 23 Apr 2008 06:16 AM (UTC)
Message
<triggers>
<trigger
custom_colour="3"
enabled="y"
keep_evaluating="y"
match="^\[Public\]"
regexp="y"
sequence="100"
>
</trigger>
</triggers>


<triggers>
<trigger
custom_colour="5"
enabled="y"
keep_evaluating="y"
match="^\[Newbie\]"
regexp="y"
sequence="100"
>
</trigger>
</triggers>


Those are the triggers I am using. What I am wondering is can I then have it set to catch the channel speak and make it a different color than the channel color, though I suppose that works as well. I will give it a try.
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #3 on Wed 23 Apr 2008 08:18 AM (UTC)

Amended on Wed 23 Apr 2008 08:19 AM (UTC) by Nick Gammon

Message
Yes you can do that. The trick here is to have two triggers (per channel).

The first one, which I have given a sequence number of 100, matches first, and because it is not a regular expression, colours the whole line. It has "keep evaluating" checked, so MUSHclient checks for more triggers.

The second one, which is a regular expression, and has a higher sequence number, then recolours the channel name in a different colour.

Regular expression triggers only colour the matching text, so in this case it stops after the channel name.


<triggers>
  <trigger
   custom_colour="3"
   enabled="y"
   match="^\[Public\]"
   regexp="y"
   sequence="110"
  >
  </trigger>

  <trigger
   custom_colour="5"
   enabled="y"
   match="^\[Newbie\]"
   regexp="y"
   sequence="110"
  >
  </trigger>

  <trigger
   custom_colour="17"
   colour_change_type="1"
   enabled="y"
   keep_evaluating="y"
   match="[Public] * says, &quot;*&quot;"
   sequence="100"
   other_text_colour="salmon"
  >
  </trigger>

  <trigger
   custom_colour="17"
   colour_change_type="1"
   enabled="y"
   keep_evaluating="y"
   match="[Newbie] * says, &quot;*&quot;"
   sequence="100"
   other_text_colour="darkmagenta"
  >
  </trigger>
</triggers>


- Nick Gammon

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

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #4 on Wed 23 Apr 2008 08:21 AM (UTC)
Message

This is what my test triggers look like:


[Public] John Doe says, "Test."
[Newbie] Nick says, "rofl."

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


19,531 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.