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


Joined: 06 Feb 2006
Posts: 8

PostPosted: Thu Apr 20, 2006 12:51 pm   

Triggers
 
The Mud i play gives the following messages when you do a special attack

Moving swiftly,
Moving quickly,

Catching (him|her|it) off-balance,
Catching (him|her|it) by surprise,

there is a few more but you get the idea.....
what i want to do is set a single sound trigger for all of these messages, i know i could do a tigger for each message but there must me a easier way.
Reply with quote
Vodoc
Apprentice


Joined: 11 Apr 2003
Posts: 119
Location: Sweden

PostPosted: Thu Apr 20, 2006 1:48 pm   
 
Code:
#REGEX {^(?:Moving (?:quickly|swiftly)|Catching (?:it|him|her) (?:off-balance|by surprise)),} {#beep}

That should do what you want.
Now to explain what it is so that you learn something from this...
We are creating a trigger but using regular expressions to do the pattern matching instead of Zugg's own invention which can be quite limited when doing more advanced pattern matchings.

^ = Start of line as usual
(?:a|b|c) = Match a, b or c and don't store it in variables (such as %1, %2 etc)

You can read more about it here.
Reply with quote
BillyWiz
Newbie


Joined: 06 Feb 2006
Posts: 8

PostPosted: Thu Apr 20, 2006 3:23 pm   
 
Thats got it
Cheers thanks alot
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