Multiple trigger colors

Posted by Drraagh on Thu 17 Apr 2008 06:52 PM — 5 posts, 20,549 views.

#0
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?
Australia Forum Administrator #1
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.
Amended on Fri 18 Apr 2008 03:45 AM by Nick Gammon
#2
<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.
Australia Forum Administrator #3
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>

Amended on Wed 23 Apr 2008 08:19 AM by Nick Gammon
Australia Forum Administrator #4

This is what my test triggers look like:


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