in reply to Re^2: Quicky Aimbot question
in thread Quicky Aimbot question
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 }
|
|---|