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

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Python
. . -> [Subject]  When is DeleteLines() fully processed?
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

When is DeleteLines() fully processed?

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


Pages: 1  2  3 

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] bio   Forum Administrator
Date Reply #30 on Sat 23 Feb 2013 09:25 PM (UTC)
Message
Fixed in version 4.89.

https://github.com/nickgammon/mushclient/commit/58e00450d071

- Nick Gammon

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

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] bio   Forum Administrator
Date Reply #31 on Sat 23 Feb 2013 09:29 PM (UTC)
Message
Smorly said:

I any trigger processing code can signal trigger processing to stop for the given line. How could I do this in MUSHclient's triggers?


If the triggers are in the same plugin (or in the main world file) then when one matches it stops further matches (unless keep evaluating is set) which is intended to let the "higher priority" match take effect.

For plugins, plugins are independent, by design. Even if a trigger fires in one plugin, the others are still handled. The intention is that (say) if blindness is detected by one plugin, it doesn't stop another plugin, perhaps by a different author, of handling it. Also the plugin evaluation order is not strongly defined, so you cannot really rely on plugin evaluation order.

- Nick Gammon

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

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] bio   Forum Administrator
Date Reply #32 on Sat 23 Feb 2013 09:34 PM (UTC)
Message
Smorly said:

It is a shame that the behaviour of DeleteLines is not fully documented or intuitive, but the alternative is wading through a mire of other problems and things I cannot control.


You found a bug. Thanks for the bug report. It's been fixed. It looks like some of my explanations about the "last blank line" were (whilst correct) not the actual problem.

There was already a test in the code to not show that last, empty, line, so that was not the real problem.

- Nick Gammon

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

Posted by Smorly   (31 posts)  [Biography] bio
Date Reply #33 on Sat 23 Feb 2013 09:37 PM (UTC)
Message
Awesome, thanks for the quick fix!

re: Triggers: Exactly. A trigger cannot dynamically cause trigger processing to stop. It either continues processing or not depending on whether keep_evaluating is true.

In the system I use, I can return True from any trigger handling code, denoting 'terminality', and no further handlers will be called.

So in the blindness case, casting gets assigned a higher priority, then if it is able to cure the blindness, it returns True, and the pill, salve, etc. triggers will not be processed.

This is much simpler than disabling triggers/groups and re-enabling them later. It's also more efficient and reliable.
[Go to top] top

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] bio   Forum Administrator
Date Reply #34 on Sat 23 Feb 2013 09:41 PM (UTC)
Message
I can see some sense to that, but in your case you are using a single match-all trigger anyway, so it wouldn't make any difference if this was added?

- Nick Gammon

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

Posted by Smorly   (31 posts)  [Biography] bio
Date Reply #35 on Sat 23 Feb 2013 09:49 PM (UTC)
Message
You asked why I was using DeleteLines(), I responded that it was because the trigger system was inadequate, and this was an example of how.

I'm not asking you to add that feature. It was merely part of my explanation. :)

Thank you again for the quick bug fix. How often do you update the binaries?
[Go to top] top

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] bio   Forum Administrator
Date Reply #36 on Sat 23 Feb 2013 10:12 PM (UTC)
Message
I usually do it the same day a major bug (such as this one) is uncovered. However I'm exploring the idea of allowing triggers to stop evaluation, to save doing two releases when one would do.

- Nick Gammon

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

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] bio   Forum Administrator
Date Reply #37 on Sun 24 Feb 2013 12:45 AM (UTC)
Message
Version 4.89 now released:

http://www.gammon.com.au/forum/?id=11950

Also added the stuff about stopping trigger evaluation, in case someone found it useful.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[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.


19,902 views.

This is page 3, subject is 3 pages long:  [Previous page]  1  2  3 

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 FutureQuest]