|
Larkin Wizard
Joined: 25 Mar 2003 Posts: 1113 Location: USA
|
Posted: Fri Apr 04, 2003 8:07 pm
Multiline trigger for variable lines |
I'm working on a trigger that can diagnose my afflictions.
I have setup a trigger for Command Input on "diag" and the output looks something like...
<prompt>diag
You are:
ablaze.
sensitive to pain.
violently ill.
reckless.
<prompt>
The lines vary depending on my affliction, and I want to be sure to catch them all.
I've tried setting up a state trigger with each affliction using a WithinLines|10 parameter. That didn't seem to do it.
I then tried each with a Duration|3000 and that didn't work exactly, either.
Any help on this would be greatly appreciated.
Thanks! |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Sat Apr 05, 2003 12:18 am |
Something similar to this should work.
#AL diag {#STATE afflictions 0;#T+ afflictions;~diag}
#TR afflictions {^You are:} {#VAR afflictions ""} {} {disable}
#COND afflictions {^({@afflicts}).} {#ADDI afflictions {%1}} {Looplines|Param=10}
#COND afflictions {} {#T- afflictions} {Looplines|Param=1}
#VAR afflicts {ablaze|sensitive to pain|violently ill|reckless}
LightBulb
Advanced Member
Edited by LightBulb to move the disable option from the alias to the trigger, where it belongs. |
|
|
|
Larkin Wizard
Joined: 25 Mar 2003 Posts: 1113 Location: USA
|
Posted: Sat Apr 05, 2003 4:06 pm |
Is there a way to use a list of pairs and search for the first element in each pair in the trigger, but add the second element to my list of afflictions?
Something like:
#var afflicts {(ablaze|onfire)|(sensitive to pain|vernalius)|(reckless|recklessness)}
...
#cond afflictions {^(@afflicts.1).} {#additem afflictions {%1.2}} {LoopLines|Param=10}
...
Thanks again. |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Sat Apr 05, 2003 8:37 pm |
It would be much easier on both of us (and anyone else who decides to help) if you provide the entire problem and let it all get solved at once. The approach selected often varies depending on the problem being solved, so that starting with a small piece and then patching it to work differently may result in using a less desirable method.
Add the new variable. You still need the the original one. Be sure to include an entry for every affliction in the original list. Replace the first condition of the original trigger.
#ADDK realafflicts {ablaze=onfire|sensitive to pain=vernalius|reckless=recklessness|violently ill=violently ill}
#COND afflictions {^({@afflicts}).} {#ADDI afflictions {%db( @realafflicts, %1)}} {Looplines|Param=10}
LightBulb
Advanced Member |
|
|
|
|
|