Does anyone have any idea why that might not be working? I suspect it may have something to do with Tk's flow of code clashing with the thread I established to do the other work. (I'm new to Tk as well, just to complicate matters further.) I also considered that it's possible that this module can ONLY send IM's in response to incoming ones -- but that seemed like it would be a horrible waste, as implementing an on-command send function after implementing the reflexive send function should've been fairly simple. Thanks for any help anyone can offer!use Tk; use Net::OSCAR qw(:standard); use threads; my $aimbot = Net::OSCAR->new(capabilities => [qw(extended_status typin +g_status)]); ###############TK SETUP############################# my $main = MainWindow->new( -title => 'AimTk', -background => 'black' ); $main -> bind('<Key-Escape>', sub { exit }); $main->Button(-text => "Connect", -command => \&connect)->pack; $main->Button(-text => "Send", -command => \&sendMessage)->pack; $txt = $main -> Entry(-width=>40, -textvariable=>\$outGoing) -> pack() +; ############################################# MainLoop; ############SUBROUTINES################### sub on_im { my ($aim, $sender, $message, $away) = @_; $aimbot->send_im($sender, "Hiya."); print "They Said: $message.\n"; } sub done { $aimbot->send_im("NameToSendTo", "Check, check."); } sub sendMessage { print "$outGoing\n"; $aimbot->send_im("NameToSendTo", "Words go here."); } sub connect { $aimbot->set_callback_im_in(\&on_im); $aimbot ->set_callback_signon_done(\&done); $aimbot->signon("myUserName", "myPassword"); my $listenThread = threads->new(\&listening); $listenThread->detach; } sub listening { while(1) { $aimbot->do_one_loop(); } }
2006-06-27 Retitled by Corion, as per Monastery guidelines
Original title: 'Net::OSCAR'
In reply to using the send_im function in Net::OSCAR in Tk outside of a Net::OSCAR callback by fridayjones85
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |