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
rob
Novice


Joined: 12 Oct 2000
Posts: 30
Location: Australia

PostPosted: Sat Jul 27, 2002 4:21 am   

Need Help With a Multiple Line Trigger
 
Well first this is the text I am trying to store in a variable:
--> Trigger to match this pattern turned on
Text Line 1
Text Line 2
Text Line 3
Text Line 4
Blank Line
Text
Trigger Turned off here

Now I had no problem matching the 4 lines of text, I used:

#TR {(*)$(*)$(*)$(*).} {#ADDKEY ItemDesc {%1 %2 %3 %4}

Now the problem is I need to match the four lines, the blank line and the next line all in one pattern because the lines of text i want to store can be anywhere between 1 and 10 lines so I will need 10 triggers and I only want one to trigger at once (depending on how many lines). I tried some different patterns but cant seem to match the blank line.
This is what i tried for 4 lines, 1 blank, 1 more line:

(*)$(*)$(*)$(*).$(*)$(*)
(*)$(*)$(*)$(*).$$$(*)
(*)$(*)$(*)$(*).$($)$(*)
(*)$(*)$(*)$(*).$(^)$(*)
(*)$(*)$(*)$(*).$^$(*)

and some others none will match a null line any ideas please??

Of course the best way to do it is with one trigger to match any where between 1 and 10 lines and store it, cant get that working either.
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Sat Jul 27, 2002 1:05 pm   
 
Yes, you are right, the best way is to make it so it matches any amount of lines. You can have this trigger:
#TRIGGER "getDesc" {(*)} {VAR desc %concat("%1", " ")}

Now, use a trigger to enable this one and also add this to that trigger:
#TEMP {$} {#T- getDesc}

This will create a temporary trigger that will fire when it sees a blank line and disable the getDesc trigger.

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