go Back

Documents
Projects
File Archive

About Me
Some Links
Fun stuff

Login - Mail




access(2) OpenSolaris

MaBot is an IRC bot which is hacked in perl, it requires the Net::IRC module which can be downloaded from sourceforge.

The idea with this bot is to be modular, stable and dynamic, unfortunatley its not more stable than its most unstable module ;-).

The Bot framework:

The latest framework can be downloaded here. It consists of three mainfiles, the script (mabot), the configure file (etc/<name>cfg) and the dynamics file (etc/*.dyn). The config file contains the non-dynamic settings, whereas the dynamic files contains those settings which are dynamic (those are channels, modules and users, which maybe be set during runtime). To start the bot you simply type ./mabot -c <configure file> for example ./mabot -c etc/sample.cfg.

The framework itself doesn't contain that many features except those mentioned, one feature which is built in to it is a link eater, if a link is to long it will store it in a text file, so you can make a annoyingly long link shorter. Another feature is a !last command, which, if its enabled, prints the last messages from the channel.

Once the bot is up and running you give it unstructions over PRIVMSG, for example /msg <botname> list, to see what modules it have loaded.

Modules:

Its fairly easy to write modules for this bot, its descriped in the docs and there is also a template for modules.

Here are some modules i wrote:
dns !dns <argument>, resolves the argument, it currently depending on two shellscripts, which you might have to customize.
epoch !epoch <argument> will convert the epoch to realtime.
friday !friday, a sample how to make something count down, this script shows the remaining time til friday 5 pm.
morse !morse is another stupid script, it takes an ASCII string as argument and tells you what it would be in morse...
rate !rate, this script uses yahoo.com to calculate exchange rates, there are two ways of usage, !rate from_currency to_currency, which will tell you the current exchange rate, or !rate from_currency to_currency amount, which will calculate the amount for you.
reverse !reverse, it will reverse the argument, for example "!reverse hello there" would return "ereht olleh". Its a stupid module, but i wrote it when i was bored.
smiley !smiley, it will display a random smiley from the smileyfile, if you run !smiley <argument> it will add the argument to the file, !smiley status will show the number of smileys stored
time !time <argument>, where argument should be either a town or a major city, the argument may also be a nickname, if the user have a domain in the form <something>.<country>.<something>.domain, unless you customise the script.
vote A votescript, it has a lot of subcommands, i suggest that you load the module and then types !vote help

Documentation:

There is some documentation in the docs/ directory. Its still in its evolving phase thou.

09:37 15/Aug/2010
footer image