Script (v1.0)
|
PDF |
A very powerful plugin to allow scripting in various languages to add functionality to the bot.
This plugin uses the Bean Scripting Framework to
enable integration of various script languages into the bot framework. Currently, these languages
include Groovy,
Jython,
JRuby,
Beanshell, and
Jacl.
The configuration file for this plugin is system/Script/ScriptConfig.xml
Specify which path to look for the scripts in, which script engine(s) to load and what file name
extensions to use for that script language.
<scriptEngines path="../Script/scripts/">
<scriptEngine name="Groovy" extension="groovy" engine="org.codehaus.groovy.bsf.GroovyEngine"/>
<scriptEngine name="Jython" extension="py" engine="org.apache.bsf.engines.jython.JythonEngine"/>
<scriptEngine name="JRuby" extension="rb" engine="org.jruby.javasupport.bsf.JRubyEngine"/>
<scriptEngine name="BeanShell" extension="bsh" engine="bsh.util.BeanShellBSFEngine"/>
<scriptEngine name="Jacl" extension="tcl" engine="org.apache.bsf.engines.jacl.JaclEngine"/>
</scriptEngines>
This plugin allows you to create your own commands and additional functionality, as described above.
You will need to know how to use one of the script languages listed above to make your own scripts.
The scripts directory has a very short sample for each supported language. The hooks you have into the bot
are basically the same onXXX() events that are from the PircBot API, eg: onMessage(). Each of the parameters
are available in exactly the same way too. As well as these, the bot object itself is available and all public
methods are available for usage from the scripts.