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


Joined: 15 Jun 2010
Posts: 2

PostPosted: Tue Jun 15, 2010 8:28 pm   

This trigger keeps breaking
 
This trigger is meant to capture lines such as


(City): Bob says, "Hello."

Bob tells you, "Hello."

You tell Bob, "Hello."

and send them to a window called "communication."




When I initially create the trigger, it works 100% as intended. When I close and reopen cMUD, the trigger no longer works. None of my other triggers have stopped working, only this one. I have saved everything properly and am not losing anything but the functionality of this trigger. Any ideas?
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Tue Jun 15, 2010 9:01 pm   
 
Well, your pattern is broken. I don't see why it would work even once. You are trying to use several alternative patterns separated by a pipe, "|". That only works if the list of alternatives is enclosed in curly brackets, {}. However, in version 2.37, you cannot use wildcards like * and %s within those curly brackets. You can in the most recent beta version, but I really don't recommend using the beta just for this. Hopefully the new public 3.xx version will be out in a little while.

I think the only way to do this in 2.37 is with a regular expression. Click the "Regular Expression" checkbox at the bottom of the trigger. The pattern would be something like (this is off-the-cuff):
Code:
(?:\(.*\)\s*\a+\s+say(?:s|),\s+\"|you tell|tells you)
Reply with quote
Almaghest
Newbie


Joined: 15 Jun 2010
Posts: 2

PostPosted: Tue Jun 15, 2010 10:06 pm   
 
Thank you! I didn't realize I couldn't match patterns using a pipe if I wasn't using regular expressions - I'd rather make a different trigger for each pattern than try to figure out a new way of pattern matching, since I just barely got this figured out.

My biggest problem that I couldn't solve was really just capturing the channels and I realized I needed to use this instead:
Code:
%p%w%p: %a say?, "*


by using (*) to match (City) I think I was saving "City" as a parameter instead of matching (City), so the trigger wasn't firing. Changing it to the above code by itself and losing the other patterns and pipes has fixed my problem.
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Tue Jun 15, 2010 11:16 pm   
 
You _can_ put alternatives in a normal trigger pattern separated by pipes, but they have to be enclosed in curly brackets, like so: {a|b|c}. And you can't put wildcards inside those curly brackets, like *, %s, %a, etc. So, to do the specific task you wanted as a single trigger, it would have to be a regular expression. Glad you figured out an alternative.
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Wed Jun 16, 2010 12:27 am   
 
Quote:

However, in version 2.37, you cannot use wildcards like * and %s within those curly brackets. You can in the most recent beta version, but I really don't recommend using the beta just for this.


Actually, you can. This functionality was originally introduced to ZMud as an optional Preference setting, either in the 7.xx series or the 6.16+ series. When ZMud was originally rewritten into CMud, this optional Preference setting was removed and made a permanent feature of the trigger parser. Thus, in CMud, {%d|%w} automatically works in the same simplistic fashion that [%d%w] works.
_________________
EDIT: I didn't like my old signature
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