Well I got my aimbot written.
I still had to rely on an event from the server to kick anything off, fortunately the act of logging on produces an event that I can use to kick off what I want.
The do one loop command loops the serve to see if there's anything there for the client.
As far as I can tell there is no way to simply initiate the client and send a message. You have to have an event from the server, like an IM, an error, a chat invitation, something, in order to to get the AimBot to do something.
Anyways thanks for tips, here is my shempy code below. It aint pretty but it does what I want. Namely read an OpenNMS database for outages and then sametime those outages to me:
#Aimbot to read outages in an OpenNMS database
#http://opennms.org) and IM outages to myself.
use DBI;
use Net::AIM;
$aim = new Net::AIM;
$conn = $aim->newconn(Screenname => 'mybot',
Password => 'mybotpassword');
$conn = $aim->getconn();
$conn->set_handler('config', \&on_config);
$aim->start;
sub on_config {
my ($self, $event) = @_;
my ($str) = $event->args;
my @things = subONMS();
$self->set_config($str);
foreach $things (@things){
$self->send_im($friend, $things);
$self->send_im('sk1nums', $things);
sleep(2);
}
exit;
}
sub subONMS{
my $dbh = DBI->connect("dbi:Pg:dbname=opennms;host=localhost",
"uname", "pword")
or die "Can't connect to postgres db: $!\n";
my $fullquery = "SELECT nodeid FROM outages where ifregainedse
+rvice is null";
my $sth = $dbh->prepare($fullquery)
or die "Can't prepare SQL statement: ", $dbh->errstr()
+, "\n";
$sth->execute()
or die "Can't execute SQL statement: ", $sth->errstr(), "\n"
+;
while(@rows = $sth->fetchrow_array()){
push(@data,@rows);
}
$sth->finish;
$dbh->disconnect;
return @data
}
| [reply] [d/l] |