Posted: Thu Jun 29, 2006 9:02 pm Post subject: msn->call problem
Hello everybody,
I've a problem with a MSN.pm call method.
I want to send a message to a ~50 users, when my bot is connected to the server, but when i'm getting a contact list, and then starting to send a message, i don't have any answer from a server, my code is:
Code:
$msn->setHandler('Connected' => sub {
open (F , "contactlist.txt");
while (defined(my $cnt = <F>)) {
$msn->call($cnt , 'Hellow');
foreach (my $i = 0; $i <= 200; $i++) { $msn->do_one_loop; }
}
close F;
});
And all i'm getting, is:
>XFR 10 SB
Connecting to a SwitchBoard at 64.4.36.21:1863
>USR 11 mybot@dot.com 1115856733.54160250.268079
>CAL 12 adr@adr.com
>XFR 13 SB .....
And so on
But when I'm giving a single email, it answer's with smth like
"Error: adr@adr.com isn't online" when user isn't online
What I need to do to inform all my contact list when my bot is up?
Joined: 05 Jul 2004 Posts: 31 Location: Almere, The Netherlands
Posted: Sat Jul 01, 2006 9:56 am Post subject:
why are you saving this in a text file? Your contact list is automaticly downloaded when you connect using msn.pm
Code:
while (my $cnt = $msn->getContactList('FL')) {
if($msn->getContactStatus($email) ne 'FLN')
{
$msn->call($cnt , 'Bot online');
}
}
}
I think this should work, but I haven't tested it.
To use this you need to add all the contacts to your forward list, otherwise the status check won't work. _________________ 3D chat program I'm making