Globster scriptsProjects home
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.
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:
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:
The table below shows tags which can be used in the XML configuration file. Most of them are mandatory for the script to work.
|config||Start tag of the configuration, can be replaced by any tag except other tags described here.||-|
|hub||New hub object.||config|
|bottalk||Chat message containing this pattern starts responder. If user is not in the array of botauthority message will be ignored.||hub|
|botmute||Chat message containing this pattern stops responder. If user is not in the list of botauthority message will be ignored.||hub|
|bottalkresponse||Message sent by bot to announce responder is starting.||hub|
|botmuteresponse||Message sent by bot to announce responder is stopping. No other message will be sent as a response until bottalk pattern is triggered.||hub|
|botauthority||List of nicks able to start/stop responder seperated by comma.||hub|
|repeatresponse||Message sent by bot announcing user is added to ignorelist.||hub|
|responder||New responder set of keyword and responses.||hub|
|keyword||Regular expression to be searched for in chat message. If found bot sends one of related responses.||responder|
|response||Response 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.
|dbusaddr||DBUS_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|
|hubid||Globster hub id to link.||hub|
|state||Initial state of the responder (0 off, 1 on). State is changed by sending bottalk/botmute pattern to chat.||hub|
|maxrepeat||Maximum number of same keyword pattern repats before user is added to ignorelist.||hub|
|ignoretime||Period of time in seconds for which ignored user will recieve no responses from bot.||hub|
|respdelay||Time delay in seconds after which response is sent. Gives a feeling the bot is a real user.||hub|
Sample configuration can be found here.