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


Joined: 08 Jan 2003
Posts: 60

PostPosted: Sat Mar 29, 2003 1:51 am   

Preconditional Trigger - Help Requested
 
First of all, I have a prompt. Depending on the situation, there can be lines before the prompt, in any of the following ways.

prompt

pattern A
prompt

pattern B
prompt

pattern A
pattern B
prompt

Unfortunately, a trigger cannot exclusively match on pattern A; it can occur in other places in the game as well. What I want the trigger to do is this.

"Every time the prompt comes in, capture values from the prompt and #substitute it to {}. If pattern B is present, capture values from it and #gag it, and note its presence. If pattern A is present, capture values from it and #gag it, and note its presence."

If patterns A and B came after the prompt, this'd be easy, but they come before. Anyone have ideas on how to do this, please?
Reply with quote
Emit
Magician


Joined: 24 Feb 2001
Posts: 342
Location: USA

PostPosted: Sat Mar 29, 2003 2:03 am   
 
yes, i think you will find the system variables %line2 and %line3 will solve the problem.

#tr {prompt} {
#var gagnum 0
#if (%line2 =~ "pattern A") {
#NOOP parse line2 with some string functions to extract data
#var gagnum -1}
#if (%line2 =~ "pattern B") {
#NOOP parse line2 with some string functions to extract data}
#if (%line3 =~ "pattern A") {#NOOP ditto above;#var gagnum -2}
#NOOP other trigger tasks
#if (@gagnum) {#gag @gagnum} {#gag}
}


--------

moon.icebound.net:9000
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