A plugin is a specialized script which is loaded by the plugin system. Plugins and the plugin system made a legacy system used during the lifetime StealthBot version 2.6, where many of the current features of the script system did not exist.
The idea of the plugin system was originally from Xellos. In 2006, Swent rewrote the plugin system, later incorporating an update plugin by FiftyToo and a help plugin by Hdx into the core functionality of the system. When development for version 2.7 was opened to more people, Swent incorporated some of the plugin system into the bot itself, adding a new UI feature: the menu system. Later Eric redid the script system, making the plugin system obsolete due to the ability of the enhanced script system to do everything the plugin system could and more.
Plugins, due to the nature of the system, had to avoid conflicting variable names with other plugins and the plugin system itself. Therefore, plugins are required to give a prefix and prepend this prefix to all used script events. Also, in order to do version checking with the update system, plugins also must provide their version number. Optional phelp parameters are also providable in the plugin header.
The plugin header consists of two to six lines of information the plugin is providing to the plugin system. It is formed like this:
'prefix 'major.minor '&plugin name:plugin author:plugin description '&plugin command:plugin command:... '&helptopicnumber '&important note:important note:...
The prefix has to be unique, or the plugin is not loaded. It is often an abbreviated version of the plugin's name. The prefix is then used to form plugin events with the subroutine signature of:
It is recommended that global variables, custom functions, and classes be named with the prefix prepended as well, to avoid conflicting with other plugins' global varialbes, custom functions, and classes.
The plugin system has a built in plugin help (also known as "phelp") system which is used to provide users with the ability to get quick help on loaded plugins.
The lines in the header beginning with '& are optional and provide the information the phelp command uses to display plugin help.
The plugin name should be anything describing the plugin in a word or two. The plugin author field should be used for the author's name. The plugin description, new in plugin system version 0.98, should provide a more extensive plugin description in a sentence or two.
The list of plugin commands is separated by : and should list the commands the plugin uses.
The help topic number provides a topic number for the old /board/ forum where more informaton on the plugin can be found.
The list of important notes is separated by : and should list things that are important to note.
Plugins rely on many plugin system provided functions in order to use a standard setting system, timer system, menu system (in version 0.98 available to StealthBot version 2.7 only), and display system, since those features were not well made for multiple scripts until the script system in version 2.7.