SourceForge Logo

NAME

Boucherot::Plugin - A Mother class for Boucherot plugins

SYNOPSIS

DESCRIPTION

This is class is the parent for all the plugins that the boucherot bot can use.

A plugin is a perl module (.pm) that can be loaded at run time, or unloaded at run time.

It's also a Module for Boucherot, that mean it can be manipulated by the ``ModuleManager''.

So the Plugin class implement the ``mid'' attribut and interface.

GISSUML MODEL

class Boucherot::Plugin

Attributs:

 -  context : SCALAR

Methods:

 +$ new ( args : HASH ) : Boucherot::Plugin

 +$ init ()
 +$ end ()

 +$ on_load ()
 +$ on_unload ()

 +  add_message_handler ( 
      event : SCALAR, 
      methodName : SCALAR, 
      other_args : HASH 
    ) 
 +  add_timeout_handler ( interval : SCALAR, methodName : SCALAR, ... ) :
 +  add_timer_handler ( interval : SCALAR, methodName : SCALAR, ... ) :
 +  add_at_handler ( at : SCALAR, methodName : SCALAR, ... ) :
 +  log ( message : SCALAR )
 +  command ( command : SCALAR )
 #  DESTROY () :

METHODS

new

 +$ new ( args : HASH ) : Boucherot::Plugin

Create a new instance of Boucherot::Plugin.

init end

 +$ init ()
 +$ end ()

on_load on_unload

 +$ on_load ()
 +$ on_unload ()

add_message_handler

 +  add_message_handler ( 
      event : SCALAR, 
      methodName : SCALAR, 
      other_args : HASH 
    )

Add a new ``message handler''. A message handler is executed each time a message of the type event is received from server or DCC.

add_timeout_handler

 +  add_timeout_handler ( interval : SCALAR, methodName : SCALAR, ... )

Add a new ``timeout handler''. A timeout handler is executed once, at time+interval/1000 (interval is in ms).

add_timer_handler

 +  add_timer_handler ( interval : SCALAR, methodName : SCALAR, ... )

Add a new ``timer handler''. A timer handler is executed several time, each interval (interval is in ms).

add_at_handler

 +  add_at_handler ( at : SCALAR, methodName : SCALAR, ... )

Add a new ``at handler''. A timeout handler is executed once, at at (at is a time, like the time function can return).

plugin plugout

  ???

log

 +  log ( message : SCALAR )

Add a log line into the ``plugin'' log.

command

 +  command ( command : SCALAR )

Execute a command (a / command, like ``/msg __wheel__ hey, you're a mushroom'' )

handlers

 #  handlers ( ) : ARRAY
 #  handlers ( context1 : SCALAR, context2 : SCALAR, ...  ) : ARRAY

Return the list of all the handlers linked with the Plugin or corresponding to the given arguments

DESTROY

 #  DESTROY () :

Destroy an instance.

AUTHORS

This class was written by Arthibus Gissehel <gissehel@vachefolle.com> in 2000.

NOTES

This class is part of the Boucherot project.