The problem that I keep running into is that when I run this file to load the aim bot, the file just continues to load. I understand that it has something to do with the "while(1)" loop, but I'm not sure how to fix it. Here's my code below. #!/usr/bin/perl use warnings; use strict; use Net::OSCAR qw(:standard); # Config my $screenname = ''; my $password = ''; 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 eq "signoff[code]") { sleep(1); $oscar->send_im($sender, "Signing Off..."); sleep(1); $oscar->signoff(); } else { sleep(1); $oscar->send_im($sender, "Hmm..."); } } PHP: Thanks for the help in advanced.
I don't think it needs fixing, the loop will never stop and so it will always load :S Syntax of any loop while(condition is true) { } 1 is true ..... i'm not perl expert at all, but I'm not wrong about the loop thing, if you have copied and example it's doing exactly what it's supposed to
I don't understand this line: my $oscar; $oscar = Net::OSCAR->new(); Code (markup): You declared a variable and then made an new oscar object. ... and then you made the $oscar variable local to the im_in subroutine. Try deleting the my $oscar Code (markup): part.