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
➜ Plugin triggers called before Client triggers = problem..
Plugin triggers called before Client triggers = problem..
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Trevize
(21 posts) Bio
|
Date
| Sun 06 Dec 2009 02:18 PM (UTC) |
Message
| Alright, so I have two trigger that goes through on this "Many golden sovereigns spill from the corpse." for example. One is within a plugin, the other in mushclient own triggers.
The problem I'm having is that the plugin trigger is -always- called first even though it's sequence is higher then the one in mushclient. I'm guessing sequences in mushclient and plugins dont work with each other?
Is there any easy fix for this? I dont want stuff like "DoAfterSpecial (0.1, "get gold", 12)" fixes. I was more hoping for a hidden button in mushclients settings that makes it trigger mushclient before plugins^^
Thanks.
| Top |
|
Posted by
| Worstje
Netherlands (899 posts) Bio
|
Date
| Reply #1 on Sun 06 Dec 2009 03:41 PM (UTC) Amended on Sun 06 Dec 2009 03:42 PM (UTC) by Worstje
|
Message
| I have in the past requested that triggers get executed in the order of their sequence regardless of their plugins, which Nick wasn't in favor of due to me being the only one to run into this issue. The only workaround (in the case of two different plugins) is to load the one that needs to execute its triggers first, LAST. (If I recall properly, anyway.)
I guess you could hack around the issue with CallPlugin but that'd create dependancies etc. Sadly, there is no good fix. | Top |
|
Posted by
| Nick Gammon
Australia (23,140 posts) Bio
Forum Administrator |
Date
| Reply #2 on Sun 06 Dec 2009 07:48 PM (UTC) |
Message
| Plugins are supposed to be independent. If the order of execution matters, then they aren't independent. And if you make it so you can change the order, and someone wants A to be run before B, and someone else wants B to be run before A then it won't work.
It is easy to turn the internal trigger into a plugin, the plugin wizard does that for you, but you still have the issue of the order.
If it isn't a huge problem, you can put that trigger into the plugin with the other trigger, then the sequence number will be honoured. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Worstje
Netherlands (899 posts) Bio
|
Date
| Reply #3 on Sun 06 Dec 2009 08:00 PM (UTC) |
Message
| The fact you want to have one plugin execute a certain trigger after another isn't a matter of it being independant. The two can run seperately just fine. :)
The problem is in pacifying the two entities so they will not clash. Prompt triggers are the most famous example I believe (one plugin to replace it with a custom prompt), another to get a specific detail out of a prompt, and yet another which uses it for a EOF marker. Depending on the exact implementations, these triggers can very much block eachother and make getting multiple plugins to work side-by-side a pain.
I always thought the merging was a nice solution, together with some kind of guideline for proper sequence numbers.
0-50: High priority. Use for preventing the execution of other triggers on this line (Keep Evaluating flag). Never omits from output.
50-100: High priority with omittance. (Some plugins use GetLineInfo etc, and deleting lines, omitting etc can cause surprising effects; that's experience talking...)
100-150: Medium priority: for all casual run of the mill triggers.
150-200: Low priority: for stuff you want executed as a very last resort.
It could probably be made a bit more fine with eye for other potential conflicts amongst triggers in different plugins, but that's a basic idea anyway. | 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.
15,544 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top