Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ General ➜ 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 page


Posted by Fiendish   USA  (2,558 posts)  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
Top

Posted by Nick Gammon   Australia  (23,173 posts)  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
Top

Posted by Nick Gammon   Australia  (23,173 posts)  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
Top

Posted by Fiendish   USA  (2,558 posts)  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
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.


13,698 views.

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

Go to topic:           Search the forum


[Go to top] top

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