E.1. The File Format

The plugin file is just a Perl file that is read and run by KildClient when the plugin is loaded. This file can call KildClient's functions to add triggers, aliases, macros or timers, to set permanent variables, etc. It usually also defines new subroutines for use in the triggers, etc, or to be called directly by the user.

However, the plugin file must with a header, which has a fixed format. If the header is not in this format, the plugin will not be recognized. The header is shown in Figure E.1, “The Plugin Header”.

Figure E.1. The Plugin Header
package NAME;
#: Version: VERSION

The first line defines the plugin's name, which will be used to refer to it later. It also starts a Perl package. All plugins define a package, so that one plugin's functions do not interfere with other plugin's ones.

The second line specifies the plugin's version. This is most informative, but is also used by KildClient to ensure that only one version of the plugin is loaded.

Next, there comes a short one-line description of the plugin. It should be brief but descriptive, and it is shown in the output of the $world->listplugin function.

Finally, it is possible to inform the author of the plugin. This line, however, is not required, but the author's name will appear in the plugin listing if it is informed.

After that, comes the plugin code. This is just Perl code, executed by KildClient when the plugin is loaded (with do).