|
Feanrath Newbie
Joined: 24 Feb 2007 Posts: 2
|
Posted: 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. |
|
|
|
Tech GURU
Joined: 18 Oct 2000 Posts: 2733 Location: Atlanta, USA
|
Posted: 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! |
|
|
|
Arminas Wizard
Joined: 11 Jul 2002 Posts: 1265 Location: USA
|
Posted: 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 |
|
|
|
|
|