I'm trying to write a bot using the Net::OSCAR module, and I keep getting this wierd error.
syntax error at bot.pl line 14, near ")
{"
syntax error at bot.pl line 18, near "else"
Execution of bot.pl aborted due to compilation errors.
here's basically that whole bot.pl
Code:use PHP::Strings; use Net::OSCAR qw(:standard); $users = ("some users i wanna give access to commands"); $aim = Net::OSCAR->new(); $aim->set_callback_im_in(\&im_in); $aim->set_callback_evil(\&evil); $aim->signon(username, password); while(1) { $aim->do_one_loop(); } sub im_in($aim, $from, $msg) { $from = lc($from); $from =~ s/ //g; $test_user = strchr($users, $from) if (!$test_user) { $aim->send_im($from, "nice try"); return; } else { $msg =~ s/<(.|\n)+?>//g; $warn = strchr($msg, "/warn "); if ($warn) { $victim = str_replace("/warn ", "", $msg); $aim->evil($victim); return; } } } sub evil($from) { $aim->send_im($from, "don't warn me"); while(1) { $aim->evil($from) } }
This thing is probably riddled with errors, I'm a complete perl newbie
[edit:gorn]added code tags[/edit]


Reply With Quote
Bookmarks