 |
rdemanow Newbie
Joined: 05 Sep 2005 Posts: 4
|
Posted: 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? |
|
|
 |
rdemanow Newbie
Joined: 05 Sep 2005 Posts: 4
|
Posted: 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} |
|
|
 |
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: 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 |
|
|
 |
Private Adept
Joined: 10 Jan 2002 Posts: 264 Location: USA
|
Posted: 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 |
|
|
 |
|
|