PluginAPI refrance

To see example of how the API is used please read the Example Plugin page.

The formating and functionality of plugin function has changed dramaticly since 1.6.3 so I am creating this API page to help plugin developers learn how to use the new format to it's fullest potential. The first change is all plugin functions have moved to a class, this helps encapsulate the plugin code and make it slightly more readable. The second major change is the way new slash commands are added for plugins. Other changes include increased functionality and incorperation into the core code.

Plugin Functions

Required functions

plugin_enabled

This is where you should set set your predefined variables value, add new slash commands, create message handlers, and add any setting you want stored in the settings.xml file.

Adding new slash commands

Creating Message Handlers

This is a way you can have plugins talk to eachother over the network. So if two people are running the same plugin, the plugins can talk to eachother. Currently noone has made use of this feature yet, but I am working on a Card dealer plugin that will make use of this.

Adding Settings to the Settings.xml file

This is used for setting that you want the user to beable to change via the settings window, NOT to store data or long strings of stuff.

plugin_disabled

This is where you remove slash commands, message handlers, and do other clean up calls for you plugin

Removing Slash Commands

Removing Message Handlers

Optional Functions

pre_parse

This grabs messages that you are trying to send before they get parsed by OpenRPG's ParsePost function. You should use this function if you wish to do some formating of messages you are about to send before the system gets ahold of them. To see an example of how it can be used look at the Hidden Dice Plugin

send_msg

This grabs a message right before it is sent to the server, but after it has been parsed for dice rolls, and other parse functions, but before it's general format has been changed

plugin_incoming_msg

This grabs all chat messages you recive, here you can change the format of the recived message. To see an example of how this can be used check out the URL to link conversion plugin.

post_msg

This grabs messages right before they are to be displaied to your chat window after they have been though the full processing of the core system. Any changes you make to a message here are only shown to you.

refresh_counter

This is called once every second by the core system and is usefull if you want your plugin to preform operations every x amount of time. To see an example of this check out the Idle Time or the Name Sound plugins


CategoryPlugins

PluginAPI (last edited 2006-06-13 06:03:52 by DjGilcrease)