Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
atraeyu
Novice


Joined: 29 Dec 2006
Posts: 41
Location: Chester, VT

PostPosted: Sun Dec 31, 2006 6:09 pm   

Syntax Coloring
 
The MUD I play on doesn't output in different colors, so I created a new class and have been filling it with triggers, such as:

#TRIGGER party { #COLOR white; }
#TRIGGER tells you { #COLOR blue; }
#TRIGGER Guild { #COLOR orange; }
#TRIGGER | { #COLOR orange; }
#TRIGGER + { #COLOR orange; }
#TRIGGER ~*~* { #COLOR red; }

First, is this the best way to make different types of text different colors?

Second, is there a list of all the colors I can use? Names like light-blue or light-green don't work. HTML color strings like #FFFFFF don't work. Do only strings work?

Third, assuming this is the correct way to color my syntax, you'll notice that there are three lines that all output in orange. That's because guild text lines can contain "Guild" begin with | or begin with +. But, if someone in my party says something containing those words, it colors it in orange as well. Or worse, since party is colored and + is colored, if someone in the party says something containing a '+' it comes out colored orange, instead of white. Is there a way to fix that?

That's a lot of questions, I've got more, but I'll leave it like that, for now. Thanks!
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Sun Dec 31, 2006 6:18 pm   
 
1) Yes, that's pretty much the best way to do it.
2) #Color uses the standard ANSI colours. You need to use lightblue and lightgreen, no hyphens.
3) HTML strings do work, start them with $ rather than #.

If you need more colours, you can use the MXP <color> tag - something like #sub {<color colorname>%line</color>} should do the trick. MXP has tons of colors, google for a list or something.

Your final problem, it'd help if we could see some of the actual MUD output. From what you say it sounds like you'll get Guild prefixing some guild lines, Party prefixing some party lines, and + or | prefixing some lines that may be party or may be guild. Giving us the actual output will let us know what you need to do to get it working.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4662
Location: Pensacola, FL, USA

PostPosted: Sun Dec 31, 2006 11:04 pm   
 
Check to help file for %colorname for a list of color words allowed.

Also #COLOR and #CW both accept the colornames and the hexidecimal color codes.
_________________
Discord: Shalimarwildcat
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Mon Jan 01, 2007 3:10 am   
 
Here's a script I have (by slight modifying one I saw here at the forums) that basically spits out all the colors.

Code:

#CLASS {ColourWheel}
#ALIAS ColourTest {#FORALL @Colours {:1:#SAYPROMPT ~<color %i~>%i~</color~>%char( 32)};%cr}
#VAR Colours {aliceblue|antiquewhite|aqua|aquamarine|azure|beige|bisque|black|blanchedalmond|blue|blueviolet|brown|burlywood|cadetblue|chartreuse|chocolate|coral|cornflowerblue|cornsilk|crimson|cyan|darkblue|darkcyan|darkgoldenrod|darkgray|darkgreen|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightsteelblue|lightyellow|lime|limegreen|linen|magenta|maroon|mediumaquamarine|mediumblue|mediumorchid|mediumpurple|mediumseagreen|mediumslateblue|mediumspringgreen|mediumturquoise|mediumvioletred|midnightblue|mintcream|mistyrose|moccasin|navajowhite|navy|oldlace|olive|olivedrab|orange|orangered|orchid|palegoldenrod|palegreen|paleturquoise|palevioletred|papayawhip|peachpuff|peru|pink|plum|powderblue|purple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen}
#CLASS 0
_________________
Asati di tempari!
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Mon Jan 01, 2007 1:15 pm   
 
Thanks for that Tech, that'll be really useful in picking them. I hope you didn't type all that out :|
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net