|
Kitana Newbie
Joined: 04 Jul 2002 Posts: 6 Location: Germany
|
Posted: Thu Jan 30, 2003 5:36 am
Need help on multiline-capturing |
I would like to know how to capture an unknown amount of text-lines (first line and last line are known) and finally put it to one string-var..
for example: MUD-Outpout looks like this:
Line 1: Summary:
Line x: This is some kind of
Line x: summary where the total lines
Line x: are unknown.
Line n: End Summary.
and now i want the x-lines in one variable. Any idea what kind of trigger i have to define? |
|
|
|
TonDiening GURU
Joined: 26 Jul 2001 Posts: 1958 Location: Canada
|
Posted: Thu Jan 30, 2003 6:19 am |
Concept:
Source
quote:
Resetting Triggers
What if you wanted to end the previous trigger before the 5 lines were up? For example, what if you wanted to collect the inventory until a blank line was received? Well, you can use the new #STATE command to set the current state of any trigger. Setting a trigger state back to zero resets the trigger. So, you could do the following:
#TRIGGER InvTrig {Inventory} {#VAR Inv "";#TEMP {^$} {#STATE InvTrig 0}}
#COND {} {#ADDITEM Inv %line} {LoopLines|Param=99}
So similarily:
#TRIGGER SummaryTrig {^Summary~:} {#VAR V_Summary "";#TEMP {^End Summary.} {#STATE SummaryTrig 0}}
#COND {} {#ADDITEM V_Summary %line} {LoopLines|Param=99}
Assumes all summaries smaller than 99 lines.
Ton Diening |
|
|
|
Kitana Newbie
Joined: 04 Jul 2002 Posts: 6 Location: Germany
|
Posted: Thu Jan 30, 2003 6:38 am |
Thx alot.. that really does the trick
|
|
|
|
|
|