Ever wanted to create your own 'bot to automate chatting over instant messaging? It sounds like a complex task, but it's as easy as downloading a single Perl module from CPAN and writing a short script. You will need an AIM or ICQ account as well, and it will be taken over by the bot when it is active, so you won't be able to use the same account for yourself at the same time.
More Perl Quick Tips
First, like all non-standard Perl modules, you will need to install Net::OSCAR from CPAN, and then you can include it at the top of your Perl programs with the use statement:
use Net::OSCAR qw(:standard);You can then use the module to create and activate a new bot:
my $aimbot = Net::OSCAR->new(capabilities => [qw(extended_status typing_status)]);The real power of the module is in it's capability to create callback subroutines that run on a specific action. For instance, let's say I want my bot to respond with the text 'hello there' every time it receives a message from someone else. First, I'll need to set a callback function for the on_im action.
$aimbot->signon(SCREEN_NAME, PASSWORD);
$aim->set_callback_im_in (\&say_hello);Then, later in the script, we define the say_hello function that is called on every reception of an instant message.
sub on_im {Module Links:
my ($aim, $sender, $message, $away) = @_;
$aim->send_im($sender, 'hello there');
}

