globster-responder

This script is supposed to make chat funny on your hub. It is easy to configure and use. Configuration is saved in XML format, keywords are PCRE patterns and there is support for multiple responses for each of them.

Dependency

Installation and usage

Download the script and move it to any location on your filesystem. Then create config XML file and save it in the same directory as globster-responder.xml, you can use the example configuration at the bottom of this document.

To start the script:

cd /path/to/script
./globster-responder.pl [<config>]

If no config file is given, the script searches for globster-responder.xml in the script path or /etc/globster. We changed the directory to the script path and we have the config in the same directory so we can leave this argument empty.

To run in background:

./globster-responder.pl &

XML configuration

The table below shows tags which can be used in the XML configuration file. Most of them are mandatory for the script to work.

TagDescriptionContainer tag
configStart tag of the configuration, can be replaced by any tag except other tags described here.-
hubNew hub object.config
bottalkChat message containing this pattern starts responder. If user is not in the array of botauthority message will be ignored.hub
botmuteChat message containing this pattern stops responder. If user is not in the list of botauthority message will be ignored.hub
bottalkresponseMessage sent by bot to announce responder is starting.hub
botmuteresponseMessage sent by bot to announce responder is stopping. No other message will be sent as a response until bottalk pattern is triggered.hub
botauthorityList of nicks able to start/stop responder seperated by comma.hub
repeatresponseMessage sent by bot announcing user is added to ignorelist.hub
responderNew responder set of keyword and responses.hub
keywordRegular expression to be searched for in chat message. If found bot sends one of related responses.responder
responseResponse to keyword. Use %[userNI] to fill in user's nick. Can be used multiple times for one keyword to achieve random responses.responder

The table below shows attributes which can be used in the XML configuration file. Most of them are mandatory for the script to work.

AttributeDescriptionTag
dbusaddrDBUS_SESSION_BUS_ADDRESS of the Globster bus session. Script uses this address to identify the session of Globster in case of script restart. This attribute is optional.config
hubidGlobster hub id to link.hub
stateInitial state of the responder (0 off, 1 on). State is changed by sending bottalk/botmute pattern to chat.hub
maxrepeatMaximum number of same keyword pattern repats before user is added to ignorelist.hub
ignoretimePeriod of time in seconds for which ignored user will recieve no responses from bot.hub
respdelayTime delay in seconds after which response is sent. Gives a feeling the bot is a real user.hub

Example configuration

Sample configuration can be found here.