|
atraeyu Novice
Joined: 29 Dec 2006 Posts: 41 Location: Chester, VT
|
Posted: 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! |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: 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. |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4715 Location: Pensacola, FL, USA
|
Posted: 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 |
|
|
|
Tech GURU
Joined: 18 Oct 2000 Posts: 2733 Location: Atlanta, USA
|
Posted: 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! |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: 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 :|
|
|
|
|
|
|