MegaHAL/Irssi

Having an artificial intelligence in your channel is sometimes fun, so here's a way of integrating MegaHAL with Irssi for fun and games. It uses four major components.

First, you'll need the MegaHAL Perl module installing. Grab the megahal-9.1.1 source and untar it. Change to megahal-9.1.1/Megahal (the Perl module directory), build it and install it using the Makefiles provided. That's the only part of the MegaHAL distribution you'll need.

Second of all, download and untar the latest AI::Megahal from CPAN. This version already includes the 0.06 patch I released that enables learning without generating a response. Proceed to build the module in the normal manner with Makefile.PL.

Finally, download MegaHAL_Irssi-2.0.tgz, untar it, and put it into your irssi scripts directory. Just load it like any other script and you should get a whole bunch of new, exciting configuration options. In summary, they are:

  • megahal_brain - The directory containing the megahal.brn or megahal.trn file
  • megahal_channels - A list of valid channels or targets to listen in, e.g. #megahal
  • megahal_antiflood - Prevent a user spamming the bot with requests. See the next two options:
  • megahal_flood_ratio - A string in the format X:Y, where X is the number of lines and Y is the number of seconds before ignoring somebody. For example, 10:60 means that if somebody says 10 things to the bot in 60 seconds they will be ignored
  • megahal_ignore_timeout - The number of seconds to ignore a user if they spam the bot

Set them as normal Irssi settings using /set.

In addition, there is a silly little poetical addition. In any channel listed in megahal_channels, type:

    !haiku <keywords>

The keywords can be anything you like. The bot will write a simple and badly formatted haiku about your chosen subject. Completely pointless, but occasionally hilarious!