Sircbot
Sircbot is a Minimalistic IRC bot based in Lua script.
Install sircbot
# apk add sircbot lua-sircbot
Configure sircbot
Edit the configuration file located at /etc/conf.d/sircbot and change the name, server, and channel:
Contents of /etc/conf.d/sircbot
Create sircbot scripts folders and files
Sircbot will use an folder for the channel where is logged in. Lets say we will use it at the "test" channel. The folder path is: /etc/sircbot.d/#<channel>
Example
Lets see an example:
Our bot will be named kumquat and we will join at the #test channel in the irc.ddd.ddd server.
Contents of /etc/conf.d/sircbot
Create folder bot.
# mkdir /etc/sircbot.d/#test -p
Create the Lua script file for our bot.
Contents of /etc/sircbot.d/#test/commands
Make the script to be executable
# chmod +x /etc/sircbot.d/#test/commands
Giving life to the bot
Starting bot service and adding to boot.
# rc-service sircbot start && rc-update add sircbot default
Troubleshooting
If your bot is not responding as expected, an easy way to troubleshoot is to manually execute the script in /etc/sircbot.d/<#channelname>/<scriptname> with the three agruments.
$ /etc/sircbot.d/<#channelname>/<scriptname> username hi '<#channelname>'
If your bot responds as expected, then you know that your script works. The problem is that sircbot is not executing the script. Here are two likely causes:
- Sircbot is case-sensitive when looking for the channel directory for a script to execute. For example, if you have a channel named "#Alpine", sircbot will look for /etc/sircbot.d/#Alpine/*. If that pathway isn't exactly right, then sircbot will skip that folder. In our example, if you have /etc/sircbot.d/#alpine/script, sircbot will not execute anything in that folder. To fix, simply rename the folder to /etc/sircbot.d/#Alpine/
- Sircbot doesn't execute scripts that have a '.' in the name. For example a script named 'listen.lua' will not be executed. Simply rename the script to 'listen'.