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.
Entire forum
➜ MUSHclient
➜ Python
➜ When is DeleteLines() fully processed?
When is DeleteLines() fully processed?
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
Pages: 1
2
3
Posted by
| Nick Gammon
Australia (23,120 posts) Bio
Forum Administrator |
Date
| Reply #30 on Sat 23 Feb 2013 09:25 PM (UTC) |
Message
| |
Posted by
| Nick Gammon
Australia (23,120 posts) 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 | Top |
|
Posted by
| Nick Gammon
Australia (23,120 posts) 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 | Top |
|
Posted by
| Smorly
(31 posts) 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. | Top |
|
Posted by
| Nick Gammon
Australia (23,120 posts) 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 | Top |
|
Posted by
| Smorly
(31 posts) 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? | Top |
|
Posted by
| Nick Gammon
Australia (23,120 posts) 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 | Top |
|
Posted by
| Nick Gammon
Australia (23,120 posts) Bio
Forum Administrator |
Date
| Reply #37 on Sun 24 Feb 2013 12:45 AM (UTC) |
Message
| |
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.
109,228 views.
This is page 3, subject is 3 pages long:
1
2
3
It is now over 60 days since the last post. This thread is closed.
Refresh page
top