User Control Panel
Advertisements

HELP US, HELP YOU!

Signs off

 
Post new topic   Reply to topic    Bot Depot Forum Index -> AIM Protocol & questions
View unanswered posts
Author Message
xiloki
Newbie
Newbie


Joined: 28 Mar 2005
Posts: 12
Location: pa
Reputation: 13.8

PostPosted: Tue Mar 29, 2005 8:04 am    Post subject: Reply with quote

Hello,

I am using net::OSCAR and I'm trying to write a bot. I'm using perl and everytime I send my bot an im it signs off. The following is the code to my bot :
Code:
<br />#!/perl/bin/perl/<br /><br />$screenname = "";<br />$password = "";<br /><br />use File::Basename;<br />chdir(dirname($0));<br /><br />use Net::OSCAR qw(:standard);<br />use LWP::Simple;<br /><br />my $aim = Net::OSCAR->new (capabilities => [qw(typing_status buddy_icons)]);<br /><br />$aim->set_callback_im_in (\&on_im);<br /><br />$aim->signon ($screenname,$password)<br />      or die "Cannot connect to AIM Server";<br />      <br />print "\nlokiBOT loaded successfully...\n\n";<br /><br /><br />while (1) {<br />   $aim->do_one_loop();<br />}<br /><br />

with the screenname and password vars filled in appropriately..


my on_im script is this :
Code:
<br />sub on_im{<br />   my ($aim,$client,$msg,$away) = @_;<br />   <br />   my $screenname = aim->screenname();<br />   <br />   aim->send_im($screenname, "lokiBOT");<br /><br />}<br />1;<br />


I hope this isn't totally stupid because I'm not too sure about perl syntax. I know many other languages but I'm not sure why it's doing this.
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: Tue Mar 29, 2005 8:45 am    Post subject: Reply with quote

seems like on_im is in an external file.

you need to require it.

please get us some error messages


go run
type cmd

then navigate in dos to your bot folder, run the bot and find out whats wrong.
Back to top
xiloki
Newbie
Newbie


Joined: 28 Mar 2005
Posts: 12
Location: pa
Reputation: 13.8

PostPosted: Tue Mar 29, 2005 9:35 am    Post subject: Reply with quote

QUOTE(draget @ Mar 29 2005, 03:45 AM)
seems like on_im is in an external file.

you need to require it.

please get us some error messages


go run
type cmd

then navigate in dos to your bot folder, run the bot and find out whats wrong.
[right][snapback]47321[/snapback][/right]


My bot signs on and then in the dos console I get:

Couldn't set win32 blocking : unknown error

lokiBOT loaded successfully

Couldn't set win32 blocking : unknown error

basic OSCAR service: unknown extended info request

I read something about that win32 blocking request and changing code in connection.pm from die to warn. It already said warn so I don't know what's goin on with that.

It is an external file. It's in the same directory as the bot.
Back to top
dubbeld
Newbie
Newbie


Joined: 23 Jan 2005
Posts: 9

Reputation: 15.8Reputation: 15.8

PostPosted: Tue Mar 29, 2005 10:09 am    Post subject: Reply with quote

You have this:
Code:
sub on_im{<br />my ($aim,$client,$msg,$away) = @_;<br /><br />my $screenname = aim->screenname();<br /><br />aim->send_im($screenname, "lokiBOT");<br /><br />}


isn't it:

Code:
sub on_im{<br />my ($aim,$client,$msg,$away) = @_;<br /><br />my $screenname = $aim->screenname();<br /><br />$aim->send_im($screenname, "lokiBOT");<br /><br />}
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: Tue Mar 29, 2005 11:02 am    Post subject: Reply with quote

require 'external file.pl';

you need to require it.
Back to top
Cer
Upgraded Agent
Upgraded Agent


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

PostPosted: Tue Mar 29, 2005 5:25 pm    Post subject: Reply with quote

Also:

Code:
sub on_im{<br />my ($aim,$client,$msg,$away) = @_;<br /><br />my $screenname = $aim->screenname();<br /><br />$aim->send_im($screenname, "lokiBOT");<br /><br />}


You set $screenname to $aim->screenname();
This returns the screenname of your *bot*
You then send an IM to $screenname (your bot), with the message "lokiBOT"

And so then your bot will receive another on_im from itself and the message "lokiBOT", putting your bot on an infinite loop which will devour its rate limits and punt it offline.

I think what you wanted to do was this:

Code:
$aim->send_im ($client, "lokiBOT");

Quote:
$aim = Net::OSCAR object
$client = the user's screenname who sent the message
$msg = the message they sent to your bot
$away = whether or not the user sent an away message
$screenname = your bot's screenname


And yeah, you need to require the external files.

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


Joined: 28 Mar 2005
Posts: 12
Location: pa
Reputation: 13.8

PostPosted: Tue Mar 29, 2005 7:45 pm    Post subject: Reply with quote

Ok I got it to im the client. Thank You. And I assure you that my IQ is over 30.
I'm still getting those errors though when I start my bot through the command prompt. Any Ideas?
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: Wed Mar 30, 2005 9:35 am    Post subject: Reply with quote

Don't worry about them they mean nothing.

If you really dont like them then edited the module.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Bot Depot Forum Index -> AIM Protocol & questions 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