world.UnloadPlugin

MUSHclient script function (Method) — introduced in version 4.73

Unloads an installed plugin

Prototype

long UnloadPlugin(BSTR PluginID);

Data type meanings

Description

Unloads (removes from MUSHclient world space) the specified plugin.

You can specify the plugin by unique ID, or by plugin name (assuming the name is unique in your list of plugins).

eg.

world.ReloadPlugin "chat"
world.ReloadPlugin "753ba7e011f3c8943a885f18"

However, a plugin cannot unload itself. That would mean the script was deleted out from under itself. If you try to work around that by having plugin A call plugin B, and plugin B unloads plugin A, you will probably get a crash. If you really want to make a "unload myself" function in a plugin, use something like DoAfterSpecial, to send the "UnloadPlugin" command to the script engine after a 1-second delay.

The check for plugin name or plugin ID is not case-sensitive.

VBscript example

UnloadPlugin "chat"
UnloadPlugin "753ba7e011f3c8943a885f18"

Jscript example

world.UnloadPlugin ("chat");
world.UnloadPlugin ("753ba7e011f3c8943a885f18");

PerlScript example

$world->UnloadPlugin ("chat");
$world->UnloadPlugin ("753ba7e011f3c8943a885f18");

Python example

world.UnloadPlugin ("chat")
world.UnloadPlugin ("753ba7e011f3c8943a885f18")

Lua example

UnloadPlugin ("chat")
UnloadPlugin ("753ba7e011f3c8943a885f18")

Return value

eNoSuchPlugin: Plugin is not currently installed
eBadParameter: Cannot unload ourselves
eOK: Unloaded OK

Return code meanings

Related topic

Plugins

See also

FunctionDescription
GetPluginInfoGets details about a specified plugin
GetPluginListGets a list of installed plugins.
IsPluginInstalledChecks to see if a particular plugin is installed
LoadPluginLoads a plugin from disk
ReloadPluginReloads an installed plugin