How To Create A Plugin For Mushclient

This page will detail how to go about with creating a plugin for mushclient. The easiest way is to use the plugin wizard found in the 'File' menu which will create the plugin with the triggers and effects from the client itself. It is also possible to manually create a plugin which in my humble opinion is the way to do it.

First you have to generate a pluginid for the plugin which should be unique in the world. You can do this from the client itself by running the command: /world.note getuniqueid which will display an id which is unique for the world.

eg: a44ade22bb1db56e27037e3e (I don't suggest using this one, generate your own to make sure it is unique!)

then you would copy paste the following text into a new textfile:

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>
<muclient>
<plugin
    name="<plugin name>"
    author="<plugin author>"
    id="<plugin id>"
    language="VBscript"
    purpose="<plugin purpose>"
    date_written="2009-1-2 15:08:12"
    requires="3.42"
    version="<plugin version>"
    >
<description trim="y">
<![CDATA[
 
]]>
</description>
</plugin>
<triggers>
 
</triggers>
 
<script>
<![CDATA[
 
]]>
</script>
<aliases>
 
</aliases>
<script>
<![CDATA[
Sub OnHelp (name, line, wildcards)
  world.Note world.GetPluginInfo (world.GetPluginID, 3)
End Sub
]]>
</script>
</muclient>

Where you have to fill in the name, author, id (which you just generated), purpose and the version.

<description trim="y">
<![CDATA[
 
]]>
</description>

In the CDATA field between the description tags you can add the description of the plugin which should contain what the plugin is supposed to do and which commands you can use (if any).

<triggers>
 
</triggers>

This block contains the triggers for the plugin.

<script>
<![CDATA[
 
]]>
</script>

Here you would add all the functions and subroutines making up the plugin. Depending on the coding language the plugin is in this would be different.

<aliases>
 
</aliases>

Between the aliases tags you would contain all the aliases used in the plugin.

This is the framework of a plugin, filled with your own code. This plugin would be saved with the extension .xml You can then load this plugin into your client by going to File->Plugins->Add in your client.

Remember before you distribute a plugin (by posting it here or sending it to someone) make sure to test it thoroughly!

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License