User Control Panel
Advertisements

HELP US, HELP YOU!

Syntax Error With While Loop

 
Post new topic   Reply to topic    Bot Depot Forum Index -> General Programming Questions
View unanswered posts
Author Message
Cheater
Senior Member
Senior Member


Joined: 10 Jun 2005
Posts: 236

Reputation: 15.8Reputation: 15.8

PostPosted: Mon Jul 04, 2005 10:09 pm    Post subject: Syntax Error With While Loop Reply with quote

If I run my bot I get

Code:
Missing right curly or square bracket at bot.pl line 72, at end of line
syntax error at bot.pl line 72, at EOF
Execution of bot.pl aborted due to compilation errors.
Press any key to continue . . .


Line 72 is:
Code:
while(1) {


Here is the coding in that general area:

Code:


   #Sign into AIM
   $oscar->signon($screenname, $password);
        while(1) {
                $oscar->do_one_loop();
        }


It has a closing curly bracket for the while loop. I don't know why I get the syntax error. Any ideas?
Back to top
eric256
The Keymaker
The Keymaker


Joined: 03 May 2006
Posts: 2292
Location: Colorado
Reputation: 47Reputation: 47Reputation: 47Reputation: 47Reputation: 47

PostPosted: Mon Jul 04, 2005 11:04 pm    Post subject: Reply with quote

I'm not positive and have no perl on this computer, but you might need a space after while. Otherwise check the rest of your code too, those errors have a tendancy to crop up somewhere unrelated to the cuase.
_________________
Eric256
Proud previous owner and current admin of Bot-depot.com
Back to top
Cheater
Senior Member
Senior Member


Joined: 10 Jun 2005
Posts: 236

Reputation: 15.8Reputation: 15.8

PostPosted: Mon Jul 04, 2005 11:27 pm    Post subject: Reply with quote

no, the while space didn't matter. I checked earlier parts, and couldn't see anything. Here is the full code:

Code:
use Net::OSCAR qw(:standard);

      my $screenname = "botname";
      my $password = "password";
      my $master = "my name";


        sub im_in {
                my($oscar, $client, $msg, $is_away) = @_;
      $msg =~ s/<(.|\n)+?>//g;
                print "[AWAY] " if $is_away;
                print "$client: $msg\n";
      $reply = "I must repeat what $client says:\n$msg";
      print "$screenname: $reply\n";
      $oscar->send_typing_status ($client,TYPINGSTATUS_STARTED);
      sleep(3);
      $oscar->send_im ($sender,$reply);
      $oscar->send_typing_status ($client,TYPINGSTATUS_FINISHED);
        }
   sub buddy_in {
      my($oscar, $person, $group, $data) = @_;
      print "\n\n$person ($group) just signed in\n\n";
   }
   sub buddy_out {
      my($oscar, $person, $group) = @_;
      print "\n\n$person ($group just signed out\n\n";
   }
   sub signon_done {
      my($oscar) = @_;
      my $buddyprofile = "$screenname was made from scratch by $master";
      $oscar->set_info ($buddyprofile);
      $oscar->commit_buddylist();
      print "\n\n$screenname has finished signing into AIM\n\n";
      
       
   $oscar = Net::OSCAR->new(capabilities => [qw(extended_status buddy_icons

file_transfer file_sharing typing_status)]);

   $oscar->set_callback_im_in(\&im_in);
#   $oscar->set_callback_signon_done(\&signon_done);
   $oscar->set_callback_buddy_in(\&buddy_in);
   $oscar->set_callback_buddy_out(\&buddy_out);
#   $oscar->set_callback_buddylist_error(\&buddylist_error);
#   $oscar->set_callback_buddylist_ok(\&buddylist_ok);
#   $oscar->set_callback_new_buddy_icon(\&new_buddy_icon);
#   $oscar->set_callback_buddy_icon_download(\&buddy_icon_downloaded);
#   $oscar->set_callback_typing_status(\&typing_status);
#   $oscar->set_callback_im_ok(\&im_ok);
#   $oscar->set_callback_buddy_info(\&buddy_info);
#   $oscar->set_callback_admin_error(\&admin_error);
#   $oscar->set_callback_admin_ok(\&admin_ok);
#   $oscar->set_callback_buddy_icon_uploaded(\&buddy_icon_uploaded);
#   $oscar->set_callback_stealth_changed(\&stealth_changed);
#   $oscar->set_callback_extended_status(\&extended_status);
#   $oscar->set_callback_evil(\&evil);
#   $oscar->set_callback_connection_changed(\&connection_changed);
#   $oscar->set_callback_chat_buddy_in(\&chat_buddy_in);
#   $oscar->set_callback_chat_buddy_out(\&chat_buddy_out);
#   $oscar->set_callback_chat_im_in(\&chat_im_in);
#   $oscar->set_callback_chat_invite(\&chat_invite);
#   $oscar->set_callback_chat_joined(\&chat_joined);
#   $oscar->set_callback_chat_closed(\&chat_closed);
#   $oscar->set_callback_auth_challenge(\&auth_challenge);
#   $oscar->set_callback_error(\&error);
#   $oscar->set_callback_rate_alert(\&rate_alert);
#   $oscar->set_callback_snac_unknown(\&snac_unknown);


   #Sign into AIM
   $oscar->signon($screenname, $password);
        while(1) {
                $oscar->do_one_loop();
        }
Back to top
Cer
Upgraded Agent
Upgraded Agent


Joined: 03 Feb 2004
Posts: 3776
Location: Michigan
Reputation: 146.9
votes: 4

PostPosted: Tue Jul 05, 2005 12:58 am    Post subject: Reply with quote

Quote:
sub signon_done {
my($oscar) = @_;
my $buddyprofile = "$screenname was made from scratch by $master";
$oscar->set_info ($buddyprofile);
$oscar->commit_buddylist();
print "\n\n$screenname has finished signing into AIM\n\n";

Hmm, this subroutine doesn't have a closing bracket

$oscar = Net::OSCAR->new(capabilities => [qw(extended_status buddy_icons

_________________
Current Site (2008) http://www.cuvou.com/
Back to top
Cheater
Senior Member
Senior Member


Joined: 10 Jun 2005
Posts: 236

Reputation: 15.8Reputation: 15.8

PostPosted: Tue Jul 05, 2005 3:01 am    Post subject: Reply with quote

yep that did it
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Bot Depot Forum Index -> General Programming Questions All times are GMT
Page 1 of 1

 



Protected by phpBB Security phpBB-TweakS
phpBB Security Has Blocked 9 Exploit Attempts.
Antispam Captcha Mod by phpbb-security.com
Powered by phpBB © 2001, 2005 phpBB Group