In trying to make a small setup for channeling chat out of my output window and into a notepad one I stumbled upon something that surprised me - I use a prompt trigger with a sequence of 0 to disable a * trigger with a sequence of 1, and both triggers call the same script sub. It seems that this script is called only after all triggers have matched on a line, so the sequence 1 trigger is disabled already after it matches, even though it is being disabled by a trigger with sequence 0. Here's the actual setup:
And the script:
The problem goes away if the prompt trigger sends its portion of the job to scripting, instead of calling the sub directly. This seems odd and I don't think it worked that way previously, though I might be wrong. In any case - the problem isn't major or immediate in this particular case, just wanted to clarify what is happening.
<triggers>
<trigger
keep_evaluating="y"
match="^[0-9]+h, [0-9]+m \D*?-.*$"
name="chat_end"
regexp="y"
script="ChannelChat"
>
</trigger>
<trigger
match="^(.*)$"
name="chat_middle"
omit_from_output="y"
regexp="y"
script="ChannelChat"
sequence="1"
>
</trigger>
<trigger
enabled="y"
lines_to_match="2"
match="^(?:[0-9]+h, [0-9]+m \D*?-|)([A-Z][a-z]+? (?:say|says), ".*)$"
name="chat_start"
omit_from_output="y"
regexp="y"
script="ChannelChat"
sequence="100"
>
</trigger>
</triggers>
And the script:
sub ChannelChat(name, output, wildcs)
select case name
case "chat_start"
world.AppendToNotepad "Chat", wildcs(1) & vbCRLF
world.EnableTrigger "chat_middle", 1
world.EnableTrigger "chat_end", 1
case "chat_middle"
world.AppendToNotepad "Chat", wildcs(1) & vbCRLF
case "chat_end"
world.AppendToNotepad "Chat", vbCRLF
world.EnableTrigger "chat_middle", 0
world.EnableTrigger "chat_end", 0
end select
end sub
The problem goes away if the prompt trigger sends its portion of the job to scripting, instead of calling the sub directly. This seems odd and I don't think it worked that way previously, though I might be wrong. In any case - the problem isn't major or immediate in this particular case, just wanted to clarify what is happening.