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


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Suggestions
. . -> [Subject]  Programmatically add menu items/ script 'plugins' directory

Programmatically add menu items/ script 'plugins' directory

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


Posted by Krenath   USA  (76 posts)  [Biography] bio
Date Mon 07 Jan 2002 10:31 PM (UTC)
Message
MUSHclient's existing menus house quite a large array of functionality. But I do thing it would be very convenient if it were possible to programmatically add new items to the menu.

This would allow script authors to create 'plugins'. For example, Magnus recently requested a feature which would allow exporting triggers and aliases to a file. It would not be very difficult to create some script code which would generate such a thing.

All that's missing is a way to add it to the menus. The command would need parameters to indicate what parent item the new item is attached to, and what the 'shortcut key' would be, and what script subroutine would be called.

While we're at it, it would be nice if there was a way to keep script plugins separate from each other, but still available to MUSHclient. What about a Plugins directory, whose contents are executed at MUSHclient startup? Then users would simply need to download a file, drop it in the Plugins Directory, and refresh/restart MUSHclient to benefit from code others create. No more tedious editing of each world's script file.

Additionally, if the script files in the Plugins directory all shared the same scope when executed, they could easily serve as 'include files', defining common code and variables which are used across all your world script files.

- Krenath from
bDv TrekMUSH
ATS TrekMUSH
TNG TrekMUSE
TOS TrekMUSE
[Go to top] top

Posted by Nick Gammon   Australia  (22,973 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Mon 07 Jan 2002 11:28 PM (UTC)
Message
Good idea, I have added that as suggestion #437.

I like the idea of plugins, because they allow extensibility over what the original designer might allow for.

Your suggestion is a good working idea of how it could be done.

It could be a problem if some plugins don't work, so we would need a method of reporting errors (eg. plugin 3, 6 and 8 have syntax errors). However that should be achievable.

Extensible menus probably go hand-in-hand with keystroke customisation.

I suppose I should ask, would this apply to MUSHclient as a whole or be specific to particular worlds? What would happen if certain menus only applied to certain worlds?

Would you expect all plugins to be in the same language?

- Nick Gammon

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

Posted by Krenath   USA  (76 posts)  [Biography] bio
Date Reply #2 on Mon 14 Jan 2002 06:05 AM (UTC)
Message
The easiest way I can think of to be completely customisable, but to allow for ease of configuration woud be to have a main Plugins directory under the Mushclient directory, then have PLugins directories under each world.

By doing this, you could just relocate the plugin and make it available across all worlds or confined to a specific one without much of anything in the way of configuration. The user, no matter their experience level, would simply download a script file and drop it where it would do the most good.

In my opinion, all the script files should be executed using the same scope, so they could share each others' subroutines, functions, classes, etc. Even if MUSHclient has to simply load them, concatenate them internally, and then execute the resulting script file.

Ideally, it should support multiple languages (active server pages manages this) because there may be many script authors in many languages. I have no idea of this would be compatible with the above idea of sharing scope (though active server pages does again manage this: Perl and java and vbscripts can make use of each others' subroutines)

Hey, I may not get my whole wish, but if I put all my ideas out front, I'll get more of it than I otherwise would :)

- Krenath from
bDv TrekMUSH
ATS TrekMUSH
TNG TrekMUSE
TOS TrekMUSE
[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.


11,276 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 HostDash]