| Message |
I was just browsing some other forums with references to MUSHclient, and I was very impressed with the level of support provided for MUSHclient there. :-)
Anyway, a question was asked about how to quickly reload a plugin after testing. I know I had an alias to do just that, but can't find it myself on this forum, so probably no-one else can either. :(
This is what I use when testing a new plugin:
<aliases>
<alias
match="rl"
enabled="y"
send_to="12"
sequence="100"
>
<send>
local plugin_id = "0abe0dab0170ede5f1ea0650"
local plugin_file = "/Program Files/MUSHclient/worlds/plugins/PLUGIN_NAME_HERE.xml"
local status = ReloadPlugin (plugin_id)
if status == error_code.eBadParameter then
Note ("Cannot reload ourself.")
elseif status == error_code.eNoSuchPlugin then
check (LoadPlugin (plugin_file))
end
if GetPluginInfo (plugin_id, 1) then
Note (GetPluginInfo (plugin_id, 1) .. " reloaded.")
end -- if have it now
</send>
</alias>
</aliases>
Basically this tries to reload the plugin (with ReloadPlugin) - this reloads an existing plugin, thus letting you test changes. However if the reason you are reloading is a syntax error in the plugin, then it won't exist in the first place, so as a fallback it calls LoadPlugin to load the plugin back in from disk.
So, for your own plugins you need to change two things:
- The plugin ID (this is from the line id="0abe0dab0170ede5f1ea0650" in the plugin header)
- The actual file name of the plugin, whatever that is.
Once you have done this, just type "rl" to reload the plugin and test your changes.
Thanks to Zarquan, Isuka, Esano and everyone else who is working hard to support MUSHclient on other forums. :)
[EDIT] Modified 31 August 2011 to test for a plugin attempting to reload itself.
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | top |
|