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
graywolf
Apprentice


Joined: 21 Jul 2001
Posts: 116
Location: USA

PostPosted: Wed Aug 06, 2003 1:39 am   

Multi - line trigger
 
-- There are six obvious exits: north, south, west, east,
northwest and northeast.
>


#TRIGGER {^-- There [is|are] %w obvious [exit|exits]: *.} {#beep}

Works fine when the directions fot on one line, but doesn't work at all if its more than one line.

thanks for any help
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Wed Aug 06, 2003 7:54 am   
 
Right. So try to remove the excess stuff that makes it sometimes go over one line.
#TR {^-- There [is|are] %w obvious exit} {#beep}
Reply with quote
graywolf
Apprentice


Joined: 21 Jul 2001
Posts: 116
Location: USA

PostPosted: Wed Aug 06, 2003 4:21 pm   
 
thats a good idea except i didn't tell you the whole story. the next step i am going to do is to write a trigger that collects all the room contents and puts them in an array.

i was wondering if something like this would work...

#TRIGGER {^-- There [is|are] %w obvious [exit|exits]: [*.|*$*.]} {#beep}
Reply with quote
graywolf
Apprentice


Joined: 21 Jul 2001
Posts: 116
Location: USA

PostPosted: Wed Aug 06, 2003 4:36 pm   
 
I was able to get

#TRIGGER {^-- There [is|are] %w obvious [exit|exits]:*$*.} {#beep}

this to work on multiple line exit descriptions. but i can't see a way to make one trigger work for both instances of single line or multiple line exit descriptions.

thanks again for any insight into this :)
Reply with quote
Troubadour
GURU


Joined: 14 Oct 2000
Posts: 556
Location: USA

PostPosted: Wed Aug 06, 2003 6:22 pm   
 
You cannot place a wildcard in one of those [either|or] elements. You will have to make two triggers -- one for single line, one for double line.
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Wed Aug 06, 2003 9:10 pm   
 
#TR {^-- There {is|are} %w obvious exit{s|}: (*)$} {Exits="%1";#IF (%ends(@Exits,".")) {#BEEP;Exits=%leftback(@Exits,1)}}
#COND {^(*).$} {Exits=%concat(@Exits,"%1");#BEEP} {within|param=1}

I decided to go ahead and add the script to capture the exits, if you don't find it needed feel free to strip it.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Wed Aug 06, 2003 9:16 pm   
 
You should also note that {is|are} matches only "is" or "are". [is|are] matches any combination of "a", "e", "i", "r", "s", and "|". That is, "is", "are", "seer", "raise", "s|r", etc.
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