world.LoadPlugin

MUSHclient script function (Method) — introduced in version 3.23

Loads a plugin from disk

Prototype

long LoadPlugin(BSTR FileName);

Data type meanings

Description

Loads a plugin file from disk. This is intended to let plugins load other plugins if desired. For example, you could make a "scan plugin directory" plugin, that loads all plugins found in a particular directory.

You might use "IsPluginInstalled" to see if a particular plugin is already installed.

If the plugin cannot be loaded an error window will open describing the problem with the plugin (eg. XML parsing error).

However if the problem is simply that the plugin file cannot be found, then no window will open.

You can use ReloadPlugin to reinstall a plugin once it is loaded, if you have changed it.

VBscript example

LoadPlugin "c:/mushclient/plugins/plugin_list.xml"

Jscript example

LoadPlugin ("c:/mushclient/plugins/plugin_list.xml");

PerlScript example

$world->LoadPlugin ("c:/mushclient/plugins/plugin_list.xml");

Python example

world.LoadPlugin ("c:/mushclient/plugins/plugin_list.xml")

Lua example

LoadPlugin ("c:/mushclient/plugins/plugin_list.xml")

Return value

ePluginFileNotFound: Plugin file not found
eProblemsLoadingPlugin: Parsing or other problem in plugin file - see error window
eOK: Loaded 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
ReloadPluginReloads an installed plugin