omit_from_output and multi_line triggers?

Posted by Fiendish on Thu 18 Nov 2010 03:07 AM — 4 posts, 14,113 views.

USA Global Moderator #0
If I change from:
   
        <trigger
        enabled="y"
        match="^{chan ch=(?<channel>\w+)}(?<msg>.*)"
        regexp="y"
        script="chats"
        omit_from_output="y"
        sequence="100"
        ></trigger>


to

    <trigger
    enabled="y"
    multi_line="y"
    lines_to_match="2"
    match="^{chan ch=(?<channel>\w+)}(?<msg>.*)$\n$"
    regexp="y"
    script="chats"
    omit_from_output="y"
    sequence="100"
    ></trigger>

It seems to work (calls the chats function), but no longer omits from output. Am I doing it wrong?
Amended on Thu 18 Nov 2010 03:08 AM by Fiendish
Australia Forum Administrator #1
Multi-line triggers can't omit from output.

The way they are implemented, it gathers output lines (the last 200) into a deque, and then for multi-line triggers concatenates the required number into a string, then submits that string to the regexp handler.

This method ensures that any intervening note lines, or player input, are not counted as part of the multi-line sequence.

However since the multi-line triggers are not as immediate as single-line triggers (ie. they didn't *just* arrive) then omitting from output, and other things like colouring output, are disabled for them.

The only way you can omit a sequence of lines (eg. an inventory) is to detect the start of it, omit that, detect the middles lines, one by one, and then detect the end of it.

Australia Forum Administrator #2
See:

http://www.gammon.com.au/scripts/doc.php?dialog=IDD_EDIT_TRIGGER

Scroll down to "Limitations on multi-line triggers".

USA Global Moderator #3
Ah. I see. Thanks.