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


Joined: 05 Dec 2002
Posts: 1
Location: United Kingdom

PostPosted: Thu Dec 05, 2002 7:16 pm   

using trigger text
 
If you have a trigger that uses wildcards, and matches part of the trigger line, how do you extract the text that set off the trigger? %trigger gives the whole line, but I just want the part of %trigger that matched.


blooga
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Thu Dec 05, 2002 11:39 pm   
 
If you surround wildcards in parenthesis, the text that matched the wildcard is available through %1..%n. The rest of the text that is not wildcards, is already known to you. Example:
#TRIGGER {gets a (*) from (*).} {#SH The first wildcard matched: %1;#SH The second wildcard matched: %2;#SH The part of the line that fired the trigger was: gets a %1 from %2.} "" {notrig}

Kjata
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