CallPlugin
Script function world.CallPlugin Read about scripting Type Method Summary Calls a routine in a plugin Prototype `long CallPlugin(BSTR PluginID, BSTR Routine, BSTR Argument);` View list of data type meanings Description `Calls a nominated routine in a nominated plugin, supplying a string argument. The intention here is to allow plugins to interact with each other, to a certain extent. For instance, you might write a plugin that logs text to a log file, and want to share it between other plugins. Hence you might log a message like this: world.CallPlugin "80cc18937a2aca27079567f0", "LogIt", "Data to be logged" The above example would locate plugin with the ID 80cc18937a2aca27079567f0 (if installed) and then call the routine "LogIt" in that plugin, with the argument "Data to be logged". In this example, the LogIt routine would look like this: Sub LogIt (sText) world.WriteLog sText End Sub You should exercise caution when using this technique. It will be annoying for plugin users if plugins become overly dependent on each other, particularly if they cannot find the one that is required. Also, be careful you do not set up circular dependencies (eg. A needs B, and B needs A). You can use "world.PluginSupports" to see if a particular routine is implemented in a plugin. For example: If world.PluginSupports ("80cc18937a2aca27079567f0", "LogIt") <> eOK then world.Note "Required 'LogIt' routine is not available" End If If you want to send a message to all installed plugins you might consider using BroadcastPlugin instead.` VBscript example
    world.CallPlugin "80cc18937a2aca27079567f0", "LogIt", "Data to be logged"
Jscript example
    world.CallPlugin ("80cc18937a2aca27079567f0", "LogIt", "Data to be logged");
PerlScript example
    $world->CallPlugin ("80cc18937a2aca27079567f0", "LogIt", "Data to be logged");
Python example
    world.CallPlugin ("80cc18937a2aca27079567f0", "LogIt", "Data to be logged")
Lua example
    CallPlugin ("80cc18937a2aca27079567f0", "LogIt", "Data to be logged")
Lua notes
    The Argument parameter is optional, and defaults to an empty string.
Return value
    eNoSuchPlugin: Plugin not installed
    ePluginDisabled: Plugin is disabled
    eNoSuchRoutine: Specified routine cannot be found in that plugin
    eErrorCallingPluginRoutine: Error when calling routine (eg. syntax error)
    eOK: Called OK
View list of return code meanings See Also ... Topics Aliases Arrays Plugins Scripting Timers Triggers Variables Functions BroadcastPlugin (Broadcasts a message to all installed plugins) EnablePlugin (Enables or disables the specified plugin) GetPluginID (Returns the 24-character ID of the current plugin) GetPluginInfo (Gets details about a specified plugin) GetPluginList (Gets a list of installed plugins.) GetPluginName (Returns the name of the current plugin) GetPluginTimerInfo (Gets details about a named timer for a specified plugin) GetPluginTimerList (Gets the list of timers in a specified plugin) GetPluginVariable (Gets the contents of a variable belonging to a plugin) GetPluginVariableList (Gets the list of variables in a specified plugin) IsPluginInstalled (Checks to see if a particular plugin is installed) LoadPlugin (Loads a plugin from disk) PluginSupports (Checks if a plugin supports a particular routine) ReloadPlugin (Reloads an installed plugin) SaveState (Saves the state of the current plugin) (Help topic: function=CallPlugin) Documentation contents page