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
cingulli
Wanderer


Joined: 30 Aug 2001
Posts: 53
Location: Finland

PostPosted: Thu Nov 08, 2001 2:50 pm   

Help in pattern-matching
 
Need to make #trigger with a pattern-match: likes ' duck !%1!{$| %2}' to work.
It should match 'duck !down!' and 'duck !down! deep' texts. But how do you put them into
one pattern-match?
Reply with quote
Acaila
Apprentice


Joined: 30 Aug 2001
Posts: 187
Location: Netherlands

PostPosted: Thu Nov 08, 2001 3:15 pm   
 
No idea how to put them into a single trigger, but you can make two:

#TRIGGER {duck ~!(%w)~!$} {StuffToDo}
#TRIGGER {duck ~!(%w)~! (%w)$} {StuffToDo}

Acaila
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Thu Nov 08, 2001 4:42 pm   
 
#TR {duck ~!down~!} {your response}

This will match:
Duck !down!
Watch out! There's a duck !down! there.
duck !down! deep

or anything else that has the phrase "duck !down!" somewhere in the line.

LightBulb
Reply with quote
Troubadour
GURU


Joined: 14 Oct 2000
Posts: 556
Location: USA

PostPosted: Thu Nov 08, 2001 6:23 pm   
 
Placing a wildcard inside a bracketed OR pattern will never work.

#TR {duck ~!(%w)~! {$|(%w)}} {whatever} is just illegal, sorry. You'll have to make two triggers if you wish to capture the parameters.

Troubadour
Reply with quote
Castaway
GURU


Joined: 10 Oct 2000
Posts: 793
Location: Swindon, England

PostPosted: Fri Nov 09, 2001 9:17 am   
 
Alternatively, you could just trigger on "duck ~!(*)" and take the resulting string apart afterwards :)

Lady C.
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