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


Joined: 04 Aug 2008
Posts: 9
Location: Washington

PostPosted: Thu Feb 12, 2009 7:14 am   

Help with a Verbatim Trigger
 
Hi everyone, sorry if this question is easy to answer, and believe me I looked for a long time and just couldn't find an answer on my own. Ok here is my question.

I would like to make a trigger that procs on a pattern, but only when the pattern is by itself on one line. I don't want it to proc if there is anything before, or after the pattern on a line.

I actually want to make a lot of triggers this way, but here's one of them for an example so that way you guys know exactly what I mean.

I want to trigger a command (doesn't matter what, it will change anwyays) on this pattern:

Your white aura fades.

I don't want it to trig if for example if someone says it:

John says, 'Your white aura fades'

This would just get me into bad situations. So is there any way to make the trigger work only if the pattern is by itself on a line?

Thanks for any help you guys can offer.
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Thu Feb 12, 2009 7:27 am   
 
Yes you want to use line anchors that Pattern Matching offers. Specifically '^' which matches the beginning of a line, and '$' which matches the end of a line.
_________________
Asati di tempari!
Reply with quote
Pogi
Newbie


Joined: 04 Aug 2008
Posts: 9
Location: Washington

PostPosted: Thu Feb 12, 2009 7:37 am   
 
Ahh that is great, thank you so much! This really simplifies everything. Although clicking on that link, at first few glances, I still couldn't find the information you gave me. So thanks for telling me specifically what to have!
Reply with quote
Dumas
Enchanter


Joined: 11 Feb 2003
Posts: 511
Location: USA

PostPosted: Thu Feb 12, 2009 1:52 pm   
 
Several lines down
Quote:

^ force pattern to match starting at the beginning of the line
$ force pattern to match ending at the end of the line
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