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
rdemanow
Newbie


Joined: 05 Sep 2005
Posts: 4

PostPosted: Tue Sep 13, 2005 2:58 pm   

coloring words in parentheses
 
I'm having difficulty coming up with a trigger that will color certain words in parentheses -- without coloring the parentheses themselves.

E.G. my mud puts a flag on controlled mobs that puts "(controlled)" in front of their description.

#trigger ~(controlled~) {#cw bold, magenta}

will color both the word "controlled" and the parens.

#trigger ~(controlled~) {#cw {controlled} bold, magenta}

and

#trigger ~(controlled~) {#cw controlled bold, magenta}

will cause the word controlled to be highlighted anywhere it appears, both inside and outside of parens. I only want it colored when it's in parens, but I don't want the parens colored.

Suggestions?
Reply with quote
rdemanow
Newbie


Joined: 05 Sep 2005
Posts: 4

PostPosted: Tue Sep 13, 2005 4:17 pm   
 
never mind -- I figured it out ... hafta use a #cond in reparse mode

#trigger inparens {~(*~)}
#cond inparens {controlled} {#cw bold,magenta} {reparse}
#cond inparens {Red Aura} {#cw red} {reparse}
#cond inparens {Blue Aura} {#cw blue} {reparse}
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Tue Sep 13, 2005 11:19 pm   
 
have you looked at the #PCOL command? I believe it moreorless does exactly what you were looking for.
_________________
EDIT: I didn't like my old signature
Reply with quote
Private
Adept


Joined: 10 Jan 2002
Posts: 264
Location: USA

PostPosted: Tue Sep 13, 2005 11:23 pm   
 
Just another way with #PCOL, no reparsing
Code:

#TRIGGER {~((*)~)} {#IF (%1 = "Red Aura") {#PCOL red %x1}
#IF (%1 = "Blue Aura") {#PCOL blue %x1}
#IF (%1 = "controlled") {#PCOL 13 %x1}}


On #SHOW This is a (Red/Blue Aura,controlled) testing 1 2 3:
This is a (Red Aura) testing 1 2 3
This is a (
Blue Aura) testing 1 2 3
This is a (
controlled) testing 1 2 3
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