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
Winslow
Novice


Joined: 17 Feb 2007
Posts: 48

PostPosted: Wed Aug 22, 2007 3:29 am   

Question on wildcards...
 
Okay, I want a trigger to only trigger when the exact line is hit, no text before or after. But, I also have wildcards inside my trigger. Example:

#Trigger {Joe (*) cake}

Now this could trigger on:

"Joe gives you some cake"

or

"Joe gives you some cake which you eat" (which I don't want)

It could also trigger on a room description such as:

blah, Joe, blah blah blah, etc, etc cake. (which I also don't want)

What I am trying to resolve, is this trigger does not have a period at the end so I don't have anything which shows end of line or end of trigger. The "^" symbol apparently makes it so it will only trigger when it is on a new line and there is no text before it. Is there another type of symbol that I can use at the end which says "no other text will follow"?
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Wed Aug 22, 2007 3:36 am   
 
Yes, $.

#trig {Joe (*) cake$}

Matches "Joe gives you some cake" but not "Joe gives you some cake." or "Joe gives you some cake which you eat"

See Pattern Matching.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Winslow
Novice


Joined: 17 Feb 2007
Posts: 48

PostPosted: Wed Aug 22, 2007 3:37 am   
 
Wow, works excellent...

One more now that I'm on a roll..

I want to change the color of some text using the color command. However the trigger is set for "... hums!" on equipment. When using the color command, I only want to change the color of that quote, not the whole line. How do I do this?
Reply with quote
tomcat025
Wanderer


Joined: 30 Dec 2001
Posts: 66
Location: USA

PostPosted: Wed Aug 22, 2007 9:25 am   
 
#CW can be used to color the text that is triggered.
#CO is for coloring a complete line.
_________________
You can pick your nose. You can pick your friends... but you can't pick your friends nose.

~Arwin Hochhauser
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Wed Aug 22, 2007 11:06 am   
 
You can also use #sub and MXP <color> tags for more exact control of colours.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Zhiroc
Adept


Joined: 04 Feb 2005
Posts: 246

PostPosted: Wed Aug 22, 2007 12:50 pm   
 
You can use #COLOR and #CW with any color, not just the ansi ones, by the way. And there's also #PCOLOR to color text groups captured in triggers.

I tend to only use the color tags when embedding into a #SHOW. One drawback to those tags is that you can't use them in #PSUBs at the moment (well, never probably in zMUD).
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