|
The problem that I'm running into is that when I run the script, my aim account logs on, but when I try to change what the bot is going to say, it doesn't update it. When I message the bot, it continues to say what I told it to say when I first ran the script.
Here's my script below:
[PHP]
#!/usr/bin/perl
use warnings;
use strict;
use Net::OSCAR qw(:standard);
use DBI;
# Config
my $screenname = 'username';
my $password = 'pass';
my $oscar;
$oscar = Net::OSCAR->new();
$oscar->set_callback_im_in(\&im_in);
$oscar->signon($screenname, $password);
while(1)
{
$oscar->do_one_loop();
}
sub im_in {
my($oscar, $sender, $message, $is_away) = @_;
# Some AIM clients send HTML, we need
# to convert it to plain text
$message =~ s/<(.|\n)+?>//g;
$oscar->send_im($sender, "Hello");
sleep(1);
if ($message == "signoff[code]") {
sleep(1);
$oscar->send_im($sender, "Signing Off...");
sleep(1);
$oscar->signoff();
} else {
sleep(1);
$oscar->send_im($sender, "Hmm...");
}
}[/PHP]
What's happening is that the bot always signs off no matter what I write. Also, the page seems to keep loading forever.
Anyways, thanks for the help in advanced.
|