|
cromaine Beginner
Joined: 27 Feb 2010 Posts: 15
|
Posted: Sat Apr 03, 2010 9:37 pm
Multiline Capture |
CMUD 2.37. My first time to try a multistate trigger. I'm just trying to capture tells. A tell looks like this:
Joe calls to Brigands: "Hello there".
It always ends in a period, so that is what I am using to tell whether the tell is one line or more than one line.
My trigger pattern is: %x calls to Brigands: "(*)
The trigger pattern works fine.
Here's what the script for my trigger looks like:
#CAP BrigandCalls
#GAG
#IF (%ends("%1",".")) {#STATE BrigandCall 0} {#STATE BrigandCall 1}
Then, the #COND, which triggers on (*), looks like this:
#IF (!%null("%1")
{IF (%ends("%1",".")))
{#CAP BrigandCalls
#GAG
#STATE BrigandCall 0}
{#CAP BrigandCalls
#GAG
#STATE BrigandCall 1}
{STATE BrigandCall 0}
What happens is that when I get a tell, everything from then on gets captured and sent to the BrigandCalls window. So it seems as though the state variable never gets reset to 0. What am I doing wrong?
Thanks. |
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Sat Apr 03, 2010 11:06 pm |
Remove the quotation marks from around %1, throughout your script. Also, in one line you have IF instead of #IF, and in another line, STATE instead of #STATE.
|
|
|
|
Danlo Magician
Joined: 28 Nov 2003 Posts: 313 Location: Australia
|
Posted: Sun Apr 04, 2010 7:05 am |
Wouldn't the problem be that the trigger triggers off (*), and that means it doesn't fire when it receives a null line?
Hence, it does not reset the state of the trigger. A better trigger would be:
#COND {(!%null(%line))} {#CAP BrigandCalls;#GAG;#if (%ends(%line,".")) {#state 0}} "" {LoopExp|Param=99} |
|
|
|
cromaine Beginner
Joined: 27 Feb 2010 Posts: 15
|
Posted: Sun Apr 04, 2010 4:46 pm |
Thanks. Removing the quotation marks did the trick. I haven't tried the other way of writing the condition, but it looks like it might be more efficient.
|
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Sun Apr 04, 2010 8:24 pm |
Pretty sure * fires off of an empty line.
|
|
_________________ EDIT: I didn't like my old signature |
|
|
|
|
|