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


Joined: 13 Feb 2021
Posts: 4

PostPosted: Sat Feb 13, 2021 10:14 pm   

Color a word and not other words with that word in it...
 
So how do I color the word Cat and not have it color the first three letters of Cathode too?

I am coloring names of guild characters and some are 3 and 4 letter names that pop up frequently in room descriptions, room names, and general conversation.

#CLASS {Assassins}
#ALIAS addassassin {#ADDITEM assassinlist}
#ALIAS delassassin {#DELITEM assassinlist}
#VAR assassinlist {Moop|Juohn|Tim|Star|Cat|Caterine|Bob}
#TRIGGER {{@assassinlist}} {#CW 57} "" {case}
#CLASS 0

Also the add and delete commands don't seem to work anymore. I think these were from Zmud. Should I be using something else in Cmud?
Reply with quote
shalimar
GURU


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

PostPosted: Sun Feb 14, 2021 7:57 pm   
 
Use the %q word boundary wildcard:

#TR {%q{@assassinList}%q} {#CW 57} "" {case}
_________________
Discord: Shalimar#3679
Reply with quote
jgstroll
Newbie


Joined: 13 Feb 2021
Posts: 4

PostPosted: Sun Feb 14, 2021 9:17 pm   
 
Thank you! That works perfectly now.

Any idea why the add\delete commands are not working?
Reply with quote
shalimar
GURU


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

PostPosted: Mon Feb 15, 2021 1:56 am   
 
You are essentially passing it nothing so it adds and removes nothing.
Implied concatenation doesn't always work.

#ALIAS addassassin {#ADDITEM assassinlist %params}
_________________
Discord: Shalimar#3679
Reply with quote
jgstroll
Newbie


Joined: 13 Feb 2021
Posts: 4

PostPosted: Mon Feb 15, 2021 2:00 am   
 
In zmud that alias would let me type
addassassin Billy
and it would add Billy to the assassinlist...


Last edited by jgstroll on Mon Feb 15, 2021 2:05 am; edited 2 times in total
Reply with quote
shalimar
GURU


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

PostPosted: Mon Feb 15, 2021 2:01 am   
 
Right, that is the implied concatenation I was talking about.
Add the %params and it will start working again.
_________________
Discord: Shalimar#3679
Reply with quote
jgstroll
Newbie


Joined: 13 Feb 2021
Posts: 4

PostPosted: Mon Feb 15, 2021 2:05 am   
 
Thank you! That works great Very Happy
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