Plugins | |
otlib | |
GetPlugins | A table of the plugins, indexed by plugin name. |
InitPlugins | Intended to be called only once by the application-specific implementation after running all plugin files. |
CreatePlugin | Creates a plugin by name. |
otlib. | |
SetVersion | Set the version and version suffix of the plugin. |
Init | Override this function if you want to run some functionality when the plugin initializes. |
Start | Start the plugin. |
Stop | Stop the plugin. |
AddCommand | Adds a command on behalf of this plugin. |
AddHook | Adds a hook on behalf of this plugin. |
GetPlugins | A table of the plugins, indexed by plugin name. |
InitPlugins | Intended to be called only once by the application-specific implementation after running all plugin files. |
CreatePlugin | Creates a plugin by name. |
function CreatePlugin( name, description, author )
Creates a plugin by name. It’s safe to call this function multiple times, it will return the ‘old’ plugin table on successive calls.
name | The string name of the plugin. Try to keep it short. |
description | The string description of the plugin. What does it do? |
author | The string author of the plugin. |
The plugin table. You should stick any information you want to persist across plugin reloads in this table since the same table will be kept across reloads. Any functions being called by commands also need to be put in this table.
v1.00 | Initial. |
SetVersion | Set the version and version suffix of the plugin. |
Init | Override this function if you want to run some functionality when the plugin initializes. |
Start | Start the plugin. |
Stop | Stop the plugin. |
AddCommand | Adds a command on behalf of this plugin. |
AddHook | Adds a hook on behalf of this plugin. |
function Plugin:SetVersion( version, version_suffix )
Set the version and version suffix of the plugin.
version | The number that represents the version of the plugin. |
version_suffix | The optional string that represents the version suffix of the plugin. IE, “Alpha”. |
Self.
v1.00 | Initial. |
function Plugin:AddCommand( console_command, say_command, callback, access )
Adds a command on behalf of this plugin.
console_command | An optional string of the console command to add. |
say_command | An optional string of the say command to add. |
callback | The function to call if this command is called and passes access tests. The callback receives the player calling the command followed by the arguments specified in the access object. |
access | The otlib.access object associated with this command. |
Self.
v1.00 | Initial. |
A table of the plugins, indexed by plugin name.
function GetPlugins()
Intended to be called only once by the application-specific implementation after running all plugin files.
function InitPlugins()
Creates a plugin by name.
function CreatePlugin( name, description, author )
Set the version and version suffix of the plugin.
function Plugin:SetVersion( version, version_suffix )
Override this function if you want to run some functionality when the plugin initializes.
function Plugin:Init()
Start the plugin.
function Plugin:Start()
Stop the plugin.
function Plugin:Stop()
Adds a command on behalf of this plugin.
function Plugin:AddCommand( console_command, say_command, callback, access )
Adds a hook on behalf of this plugin.
function Plugin:AddHook( hook, callback, priority )