[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]  General
. . -> [Subject]  Plugin triggers called before Client triggers = problem..
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Plugin triggers called before Client triggers = problem..

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


Posted by Trevize   (21 posts)  [Biography] 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.


[Go to top] top

Posted by Worstje   Netherlands  (899 posts)  [Biography] 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.
[Go to top] top

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] 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
[Go to top] top

Posted by Worstje   Netherlands  (899 posts)  [Biography] 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.
[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.


4,151 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 FutureQuest]