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


Joined: 24 Feb 2007
Posts: 2

PostPosted: Wed May 09, 2007 1:11 am   

Triggering on a random line.
 
My issue is this, I have one line of text that is always the same, and a second line of text that is always the same, which 90% of the time follow each other:

Code:
This is the first line to trigger from.
This is the second line.

However very rarely, something will be interposed between them, the trouble is, this is an utterly random string.

Code:
This is the first line to trigger from.
A blue rabbit.
This is the second line.


Code:
This is the first line to trigger from.
Yellow is my favourite time of the year.
This is the second line.


What I need to do is fire an #echo when one of these random lines comes up.

I tried:
Code:
#trigger (^(*)$) {#if (%1 = "This is the second line.") {#t- linecapture} {@gotone = 1}}

Which was enabled by the first line, and the second line would then disable and fire the echo if @gotone = 1, however all that did was fire the echo every time.
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Wed May 09, 2007 5:28 am   
 
Sounds like you need a basic conditional trigger #CONDITION.

#TRIGGER {This is the first line to trigger from. } {Do Stuff for first line}
#COND {This is the second line.} {gotone=1;//Do Stuff for the second line}
_________________
Asati di tempari!
Reply with quote
Arminas
Wizard


Joined: 11 Jul 2002
Posts: 1265
Location: USA

PostPosted: Wed May 09, 2007 2:21 pm   
 
Even easier than that.

#TRIGGER {This is the first line to trigger from.$(*)$This is the second line.} {#echo %1}
_________________
Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram
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