For some reason my bots don't seem to be setting their ClientCaps correctly. I programmed their Connected handler to set the caps, and the Answer handler to send them, but it either isn't setting them or it isn't sending them.
Top of Connected Handler
Code:
sub msn_connected {<br /> my ($msn) = @_;<br /><br /> # Get some data.<br /> my $stamp = &get_timestamp();<br /> my $sn = $msn->{Handle};<br /> $sn = lc($sn);<br /> $sn =~ s/ //g;<br /><br /> # Set our default sendmsg styles to our bot's font settings.<br /> my ($font,$color,$style) = &get_font ($sn,'MSN');<br /> $msn->setMessageStyle (<br /> Font => $font,<br /> Color => $color,<br /> Effect => $style,<br /> );<br /><br /> # Set our Client Caps.<br /> $msn->setClientCaps (<br /> 'Client-Name' => "AiChaos Leviathan (BOT)/$chaos->{version}",<br /> 'Chat-Logging' => '*lazy*',<br /> );
Top of Answer Handler
Code:
sub msn_answer {<br /> my ($self) = @_;<br /><br /> # Send ClientCaps.<br /> $self->sendClientCaps;
I tested inviting two of my bots together to see if they got eachothers' ClientCaps, and they didn't, so (to my Cody bot) I sent this:
And then invited them together again, and it got the ClientCaps this time and printed them out correctly.
First I figured the one in my Connected handler didn't work because I also had a Client-Type => 'BOT' in it, so I took that out and tested again... nothing.
I know the Connected handler is being called, because the bots are able to set their DP's, change their names back to normal, and set up their custom emoticons.
I'll keep trying at it for a while. If anybody knows what's wrong, reply here!
EDIT!
I edited the Connected handler to only set "Client-Name" but not "Chat-Logging", I then reloaded the subroutine, and redefined the handler on one of my bots, and then had it call that subroutine again.
After that, my other bots got its ClientCaps. I restarted the bot completely so that all bots would call that subroutine and set their ClientCaps, but it didn't work.
Do ClientCaps need to be set twice or something? _________________ Current Site (2008) http://www.cuvou.com/
Well from my experimenting with it, it wouldn't set it the first time (in the Connected handler), but everytime I tried to set them again after then it worked.
So my temporary cheap solution is to set them on each Answer handler. And that works for now. _________________ Current Site (2008) http://www.cuvou.com/
Joined: 19 Jul 2004 Posts: 556 Location: Los Angeles, CA votes: 1
Posted: Fri Jan 21, 2005 9:23 pm Post subject:
you hsould set them when you set your handlers....before the connection, and you should never have to call $self->sendClientCaps; its sent automatically on a JOI _________________ [ matt ]