[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]  Why are plugins global?
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Why are plugins global?

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


Posted by ERogue   (2 posts)  [Biography] bio
Date Mon 22 Feb 2016 03:51 AM (UTC)
Message
Greetings. After a week or of using MUSHClient 5.01, I've made good progress learning, imo, but I still have a few basic issues (I think I'll only post one at a time, tho). Please accept my apologies if I've failed at searching. And upfront allow me to offer thanks for any support from anybody.

Firstly, I'd expect plugins to be local to a world rather than a global setting. A practical case is the AddNewLineToPrompt plugin to enable prompt triggers on servers that don't have newline in their prompt. Obviously, this is very frequently customized to each server, so having it global has little practical value as I use multiple worlds.

I can see that it could be extended to switch cases per connection (if I knew how), but regardless I'm just wondering if I'm overlooking something more direct.

Good evening.
[Go to top] top

Posted by Nick Gammon   Australia  (21,324 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Mon 22 Feb 2016 04:16 AM (UTC)
Message
Plugins are intended to be useful files in their own right, and therefore loaded into multiple world files (and even given to friends so they can use them as well).

However a plugin is only "applied" to a particular file if you load it (using File menu -> Plugins).

There is a provision for global plugins in the File menu -> Global Preferences, but you would only use that for plugins that you happened to want in every world.

I'm not sure if that answers your question, but perhaps it does. Are you by any chance accidentally using the Global Plugins option rather than world-by-world plugins?

- Nick Gammon

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

Posted by Fiendish   USA  (1,641 posts)  [Biography] bio   Global Moderator
Date Reply #2 on Mon 22 Feb 2016 11:16 AM (UTC)

Amended on Mon 22 Feb 2016 11:29 AM (UTC) by Fiendish

Message
Quote:
A practical case is the AddNewLineToPrompt plugin to enable prompt triggers on servers that don't have newline in their prompt. Obviously, this is very frequently customized to each server, so having it global has little practical value as I use multiple worlds.

The entire point of a plugin is that the code stays the same no matter what world you load it into. If this is a problem then you're customizing wrong. Plugin state is saved per world. If you have different worlds needing different effects but basically the same code, don't customize the code per world! Genericize the code to load the relevant parameters from variables so that the same code can run in any world with customized variable data.

https://github.com/fiendish/aardwolfclientpackage
[Go to top] top

Posted by ERogue   (2 posts)  [Biography] bio
Date Reply #3 on Tue 23 Feb 2016 06:33 AM (UTC)

Amended on Tue 23 Feb 2016 07:28 AM (UTC) by ERogue

Message
Nick Gammon said:

However a plugin is only "applied" to a particular file if you load it (using File menu -> Plugins).

There is a provision for global plugins in the File menu -> Global Preferences.


Oh, great, indeed I only saw the option for File menu / Global Preferences, I completely overlooked File menu / Plugins!

I was in fact missing the obvious, thanks!

[Edit to add:]
Resolved.

Testing is so much quicker now that I can just reload a world pluging rather than restarting the client.

For what it's worth, I assumed non-global plugins didn't exist because there's no plugin section in the World Properties screen. Perhaps such a section could be added.

Have fun.
[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.


2,220 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]