User Control Panel
Advertisements

HELP US, HELP YOU!

ClientCaps Error

 
Post new topic   Reply to topic    Bot Depot Forum Index -> MSN Protocol
View unanswered posts
Author Message
Cer
Upgraded Agent
Upgraded Agent


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

PostPosted: Thu Jan 20, 2005 11:16 pm    Post subject: Reply with quote

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:

Quote:
!perl $chaos->{bots}->{'chaos@aichaos.com'}->{client}->setClientCaps ('Client-Name' => 'MSN Bot');


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/
Back to top
draget
Not Yet a God
Not Yet a God


Joined: 29 Dec 2004
Posts: 367
Location: Australia
Reputation: 32.2Reputation: 32.2Reputation: 32.2

PostPosted: Fri Jan 21, 2005 3:34 am    Post subject: Reply with quote

Have a look at the 'caps system on maya, worked first time for me!
Back to top
Mojave
Almost An Agent
Almost An Agent


Joined: 01 Nov 2003
Posts: 1434

Reputation: 66.4

PostPosted: Fri Jan 21, 2005 7:08 pm    Post subject: Reply with quote

I think you should call setClientCaps (and setMessageStyle for defaults) right after you create the $msn object.

I can't think why it wouldn't work from anywhere, including the Connected handler. We would need to do more testing or get more details from you.
Back to top
Cer
Upgraded Agent
Upgraded Agent


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

PostPosted: Fri Jan 21, 2005 7:40 pm    Post subject: Reply with quote

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. Laughing And that works for now.

_________________
Current Site (2008) http://www.cuvou.com/
Back to top
mattaustin
Sentinel
Sentinel


Joined: 19 Jul 2004
Posts: 556
Location: Los Angeles, CA
Reputation: 50.7
votes: 1

PostPosted: Fri Jan 21, 2005 9:23 pm    Post subject: Reply with quote

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 ]
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Bot Depot Forum Index -> MSN Protocol 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