|
Electron Wanderer
Joined: 20 Nov 2001 Posts: 72
|
Posted: Sun Dec 14, 2003 11:42 pm
helping out the automapper |
I want to make a trigger that has several conditions... one that matches once to the name of the room.. one that matches many lines for the description and one that matches a set phrase describing the exits and one that matches the exits... there may be junk in between the description and the line identifying the start of the exits such as stuff in the room, which I don't really care about
Now, I know how to do the ones that match just once, but how do I do the ones that match multiple times? I was using trigger states to try and do this, but there doesn't appear to be a trigger state condition that allows for repeat until no match and then goto next state. Is there a way to match an unknown number of lines in a trigger state, or should I do something different? Thx. |
|
|
|
Danlo Magician
Joined: 28 Nov 2003 Posts: 313 Location: Australia
|
Posted: Mon Dec 15, 2003 3:17 am |
You could do what you want using 2 triggers. When the first trigger pattern matches, set a variable to 1. Then use an expression trigger, so that while that variable equals 1, it captures all the lines until the variable equals 0.
It would work something like this:
#trigger {<Roomname-matching pattern>} {#var triggermatch 1;<any other commands you want>}
#trigger {@triggermatch=1} {#var matchingline {%line};#var triggermatch 0;<any other commands you want>}
To set the 2nd trigger to match the expression rather than the pattern, go to your Triggers editing window. Put in the expression it has to match, go to options, and select the Trigger Type: Expression |
|
|
|
Electron Wanderer
Joined: 20 Nov 2001 Posts: 72
|
Posted: Mon Dec 15, 2003 7:11 pm |
Doesn't %line cut out the ANSI codes. Sry I failed to mention it in the first post, but the only easy way to identify the room name and description are by the ANSI codes. If I turn on the matches ANSI option for the trigger will %line keep the ANSI codes in it?
|
|
|
|
Danlo Magician
Joined: 28 Nov 2003 Posts: 313 Location: Australia
|
Posted: Tue Dec 16, 2003 1:14 am |
I thought you parsed the Roomname/description/exits to the mapper from the results of the trigger? Eg. You match the Roomname based on the ANSI codes, so you know what the roomname is, you don't need the ANSI code any further, and you parse it to the mapper.
|
|
|
|
|
|