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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Robkin
Newbie


Joined: 24 Jun 2003
Posts: 2
Location: USA

PostPosted: Thu Jun 26, 2003 7:53 pm   

Highlighting a single word?
 
I would like to highlight a single word. Not the whole line of that word in other words.

example: Rat

Would to make it green, but dont want the whole line green or rat in rations green , just the word rat when it is a worb by itself.

thnakz
Reply with quote
Humpton
Apprentice


Joined: 10 Oct 2000
Posts: 158
Location: Chicago, IL

PostPosted: Thu Jun 26, 2003 8:21 pm   
 
Easy. #CW {Rat} {PrettyColor}
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Thu Jun 26, 2003 9:48 pm   
 
Unfortunately, there's no easy way to create a pattern which matches rat but not rations. You'll need several patterns to allow for rat at the beginning or middle of a line, and followed by a space or punctuation. The punctuation will also be colored green. I've assumed you won't have "rat" as a single-word sentence/phrase at the beginning of the line.
#CW {^rat%s} {green}
#CW {%srat%s} {green}
#CW {%srat%p} {green}

Edited to replace spaces with %s.
Reply with quote
atreus
Beginner


Joined: 22 Mar 2005
Posts: 21

PostPosted: Tue Mar 22, 2005 11:17 pm   
 
I'm having a little bit of trouble here as well. What I have so far:

#TR {^Your default pack tactic is ~'*~'.} {#CW {%1} {$cccc00}}

Works fine, whenever I get something like: "Your default pack tactic is 'encirclement'." only the string inside single quotes is colored yellow, just like I wanted it.

Now, the weird part is that after I get a line like that, zMud automatically adds a new trigger in my trigger list, with "encirclement" as the pattern and "#CW $cccc00" as the value. This, of course, causes that the word "encirclement" (and any other string that matches the original trigger pattern) appears yellow, anywhere on the screen. Not exactly what I wanted, after all.

What am I doing wrong?

.atr.
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Wed Mar 23, 2005 2:53 am   
 
Quote:

Unfortunately, there's no easy way to create a pattern which matches rat but not rations.


Actually, there is. It uses the %q wildcard, which matches punctation, whitespace, and can anchor on either side of the line.

#trigger {%qrat%q} {#cw green}
_________________
EDIT: I didn't like my old signature
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD 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