|
Lasivian Wanderer
Joined: 25 Jan 2002 Posts: 76 Location: USA
|
Posted: Sat Dec 22, 2007 8:47 am
Multi-line triggers |
I'm not sure how to make a trigger that will capture multiple lines at once.
I'm trying to make a database of Identified items, but since the format is like this:
Code: |
Object: luxuriant serpent valise Type: container
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Flags: none
Weight: 0 Value: 410 Level: 10
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
|
I don't know how to keep several lines together.
Thanks |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Sat Dec 22, 2007 12:07 pm |
Use a multistate trigger rather than a multiline trigger. Something like this perhaps:
#trig {Object: ([a-z ]) %s Type: (%w)} {do whatever}
#cond {Flags: ([a-z ])} {do whatever}
#cond {Weight: (%d) %s Value: (%d) %s Level: (%d)} {do whatever}
This creates a single trigger with three states. The first state is active to begin - once it's matched, the second state becomes active and the first state is no longer matched. Once 2 matches, 3 is active. Then it loops round. So if any of the lines are optional, this approach won't work, but if they're not, you're good. |
|
|
|
|
|