[Home] [Downloads] [Search] [Help/forum]


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  omit_from_output and multi_line triggers?

omit_from_output and multi_line triggers?

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Posted by Fiendish   USA  (2,514 posts)  [Biography] bio   Global Moderator
Date Thu 18 Nov 2010 03:07 AM (UTC)

Amended on Thu 18 Nov 2010 03:08 AM (UTC) by Fiendish

Message
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?

https://github.com/fiendish/aardwolfclientpackage
[Go to top] top

Posted by Nick Gammon   Australia  (22,988 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Thu 18 Nov 2010 03:58 AM (UTC)
Message
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.


- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Nick Gammon   Australia  (22,988 posts)  [Biography] bio   Forum Administrator
Date Reply #2 on Thu 18 Nov 2010 04:07 AM (UTC)
Message
See:

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

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


- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Fiendish   USA  (2,514 posts)  [Biography] bio   Global Moderator
Date Reply #3 on Thu 18 Nov 2010 04:48 AM (UTC)
Message
Ah. I see. Thanks.

https://github.com/fiendish/aardwolfclientpackage
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


9,578 views.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at HostDash]