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 ➜ Color settings

Color settings

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


Posted by Nightcaste   (2 posts)  Bio
Date Sun 16 Sep 2007 01:43 AM (UTC)
Message
I'm new to MUSHing, and this is the client my friend recommended. What I would like to know is if there is a way that I could set the different channels to different colors.

For example, lines starting with "so-and-so says," would be blue, stuff from a different chat channel would be green, or red, or whatever...

I get the idea that this is probably not easy to do, since the couple other people I have asked don't know how, and they've been doing this kind of stuff for a long time.

Thanks!!
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #1 on Sun 16 Sep 2007 02:33 AM (UTC)
Message
That's pretty easy to do.

Go into world configuration (Alt+Enter) and add a trigger. Make it match what you expect to see, with asterisks in place of the variable stuff.

eg. Trigger: * says, *


Then click on "Change colour and style to" and select a colour from the drop-down list, or select "Other" which will give you two colour swatches. You can then click on those to select a foreground and background colour for matching lines.

Click OK, and then add other triggers for other channels (like chat channels).

- Nick Gammon

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

Posted by Nightcaste   (2 posts)  Bio
Date Reply #2 on Sun 16 Sep 2007 04:25 PM (UTC)
Message
I think we tried something like that, but I don't think it was exactly that way... I think we forgot the second wildcard. I will give this another go, and see what happens.

Is there a way to limit how many characters can be before "says"? Just to prevent it from triggering on something like "According to what this book says, you should..." in the middle of someone's statement...
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #3 on Sun 16 Sep 2007 06:14 PM (UTC)
Message
Quote:
Is there a way to limit how many characters can be before "says"? Just to prevent it from triggering on something like "According to what this book says, you should..." in the middle of someone's statement...

Sure. You could get the length of %1 and then do an ifcheck.

Or if you know a say will be only one word, you could also match off of that.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #4 on Sun 16 Sep 2007 09:55 PM (UTC)
Message
Quote:

Is there a way to limit how many characters can be before "says"?


Click on "convert to regular expression" (when editing the trigger) and the amend the first asterisk to have some sort of conditions. See:

http://www.gammon.com.au/regexp

In my example below (see http://www.gammon.com.au/pasting for how to copy and paste directly), I have limited the name of the person who "says" something to between 1 and 10 characters, and consisting of A-Z, a-z, space or underscore. You may need to edit what is inside the brackets a bit depending on your MUD naming conventions. For example, if numbers were allowed you could add 0-9 inside the brackets.


<triggers>
  <trigger
   custom_colour="17"
   enabled="y"
   match="^([A-Za-z _]{1,10}) says\, (.*?)$"
   regexp="y"
   sequence="100"
   other_text_colour="tomato"
   other_back_colour="palegoldenrod"
  >
  </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 #5 on Sun 16 Sep 2007 09:57 PM (UTC)
Message
Also, if the MUD quotes what you say, you could add that into the match text. Eg. rather than:

Match: * says, *

You could have:

Match: * says, '*'


Or, change the regular expression in a similar way.

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


20,236 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.