User Control Panel
Advertisements

HELP US, HELP YOU!

Developer's Reference bot

 
Post new topic   Reply to topic    Bot Depot Forum Index -> Promote A Bot or Site
View unanswered posts
Author Message
Mojave
Almost An Agent
Almost An Agent


Joined: 01 Nov 2003
Posts: 1434

Reputation: 66.4

PostPosted: Tue Dec 09, 2003 10:21 pm    Post subject: Reply with quote

I pulled an old bot out of mothballs and I'm going to start building him up again. It's a simple developer assistant bot that searches developer websites and returns the best links.

It only runs on AIM right now with screenname: DeveloperRef.

You can search three different things: Msyql, PerlDoc and CPAN. Try typing the following lines in an IM with DeveloperRef:

Code:
msyql select<br /><br />cpan AIM<br /><br />perldoc uc<br />


If anybody wants more functionality added, just let me know what you want. The bot is a work in progress, I plan to add a lot more soon.
Back to top
Nytshadow
Newbie
Newbie


Joined: 09 Dec 2003
Posts: 6

Reputation: 29.5Reputation: 29.5Reputation: 29.5

PostPosted: Wed Dec 10, 2003 10:27 pm    Post subject: Reply with quote

Can you add searching for PHP? That would be nice Smile. www.php.net
Back to top
Mojave
Almost An Agent
Almost An Agent


Joined: 01 Nov 2003
Posts: 1434

Reputation: 66.4

PostPosted: Thu Dec 11, 2003 12:23 am    Post subject: Reply with quote

OK, I added searching for PHP functions. Just type php followed by the function name like this:

Code:
php print


I also added quick links to the various reference sites. Type any of the following for a quick link.

Code:
cpan<br /><br />mysql<br /><br />perl<br /><br />php
Back to top
Nytshadow
Newbie
Newbie


Joined: 09 Dec 2003
Posts: 6

Reputation: 29.5Reputation: 29.5Reputation: 29.5

PostPosted: Thu Dec 11, 2003 2:31 pm    Post subject: Reply with quote

Noticed an issue with the php searching. Running a search for preg_match attempts to return the page function.preg_match.php. The actual page is function.preg-match.php. You may have to do a conversion on underscores.
Back to top
Nate
God Like
God Like


Joined: 12 Nov 2003
Posts: 553

Reputation: 41.3Reputation: 41.3Reputation: 41.3Reputation: 41.3

PostPosted: Thu Dec 11, 2003 2:35 pm    Post subject: Reply with quote

Yeah, that's easy.

Code:
$var =~ s/\_/\-/g;
Back to top
Nytshadow
Newbie
Newbie


Joined: 09 Dec 2003
Posts: 6

Reputation: 29.5Reputation: 29.5Reputation: 29.5

PostPosted: Thu Dec 11, 2003 2:43 pm    Post subject: Reply with quote

Another suggestion, you may also want to look for ref pages. For example, if I type in php mysql, it returns a 404. When I search through the php site, mysql returns ref.mysql.php because there is no function called mysql. However, there are pages for specific mysql functions such as mysql_affected_rows (function.mysql-affected-rows.php).

Also wanted to say that I think the bot is very kewl. I'm new to IM bots and my head is spinning with possibile applications for these :blink: .
Back to top
Mojave
Almost An Agent
Almost An Agent


Joined: 01 Nov 2003
Posts: 1434

Reputation: 66.4

PostPosted: Fri Dec 12, 2003 2:57 am    Post subject: Reply with quote

OK, I fixed those problems.

It converts _ to - as you suggested and works great.

It now finds functions in the functions pages and the ref pages and finally defaults to a regular search.

Thanks for the suggestions! Keep them coming.
Back to top
Nate
God Like
God Like


Joined: 12 Nov 2003
Posts: 553

Reputation: 41.3Reputation: 41.3Reputation: 41.3Reputation: 41.3

PostPosted: Fri Dec 12, 2003 1:54 pm    Post subject: Reply with quote

You might also want to have it translate :: to - also, as in CPAN. For example, Net::AIM is shown like Net-AIM or something.
Back to top
Mojave
Almost An Agent
Almost An Agent


Joined: 01 Nov 2003
Posts: 1434

Reputation: 66.4

PostPosted: Fri Dec 12, 2003 6:36 pm    Post subject: Reply with quote

Actually, searching CPAN for modules, you can use either :: or - and since :: is the correct way to show module hierarchies, it makes more sense to search with :: so I'm going to leave that as is.

Thanks
Back to top
Tony_shu
God Like
God Like


Joined: 12 Nov 2003
Posts: 624

Reputation: 42.9Reputation: 42.9Reputation: 42.9Reputation: 42.9

PostPosted: Thu Jan 08, 2004 4:40 pm    Post subject: Reply with quote

Maybe you should take down DeveloperRef for a day or two, until its warning goes down.

This is my on_login.pl
Code:
######################################<br />#                                    #<br />#                            ##      #<br />#           ###########     # #      #<br />#          #           #     #       #<br />#         #     ###     #   ###      #<br />#        #     #  #      #           #<br />#        #      ###      #           #<br />#        #     #  #      #           #<br />#         #    ##########            #<br />#          #                         #<br />#           ###########              #<br />#                                    #<br />#                                    #<br />######################################<br /><br />sub on_login {<br /><br /> my $self = shift;<br /><br />#Goes through block list, and blocks screennames when bot signs on.<br /> open(FILE, "clients/list.txt");<br /> my @block = <FILE>;<br /> close(FILE);<br /> chomp(@block);<br /><br /> my $i = 0;<br /> my $*lazy* = scalar(@block);<br /><br /> foreach my $bad (@block) {<br />  $self->add_deny(1, 'buddies', $block[$i]);<br />  print "I have blocked $block[$i]!\n";<br />  sleep(1);<br />  if ($i < $*lazy*) {<br />   $i++;<br />  }<br /> }<br /> print "Finished blocking idiots!\n\n";<br /><br />#Messages admin screennames, that the bot has signed on.<br /> open(ADMIN, "commands/admin.txt");<br /> my @admin = <ADMIN>;<br /> close(ADMIN);<br /> chomp(@admin);<br /><br /> foreach my $admin (@admin) {<br />  $self->send_im($admin, "Hello $admin, I am online and ready for use!");<br /> }<br /><br />}<br />1;
I have it load when the bot signs on...just add
Code:
on_login()
at the end of your on_config.pl code.

AIM bots don't seem to keep blocked people blocked. When someone warns the bot, the on_evil() adds them to "list.txt" and blocks them. However, they are only blocked for the duration of the bot's online time. When the bot signs on again, they are no longer blocked. My on_login() function will block the list of individuals again. It also messages all the admins that it is online.

_________________
Anthony Arslan
@-Squared Enterprises
MacroHard Corporation
Back to top
Mojave
Almost An Agent
Almost An Agent


Joined: 01 Nov 2003
Posts: 1434

Reputation: 66.4

PostPosted: Thu Jan 08, 2004 6:16 pm    Post subject: Reply with quote

There's no reason to take a bot offline if he's got a high warning level.

DeveloperRef (and all of my bots) uses a system that bans users that warn him. Ban length increases each time a users warns him, resulting ultimately in a complete ban. He doesn't warn back and doesn't add users to a block list.

The unfortunate thing is there is an endless supply of warners.

Also, back in the day when I did use warning and denying, I don't remember having any problems with denying users. I believe you have to call something else after you deny a user in order for it to stay on the list when your bot signs on again. Check the AIM protocol docs.
Back to top
Nate
God Like
God Like


Joined: 12 Nov 2003
Posts: 553

Reputation: 41.3Reputation: 41.3Reputation: 41.3Reputation: 41.3

PostPosted: Thu Jan 08, 2004 8:11 pm    Post subject: Reply with quote

Hm... I know how to make the buddy list permanent...

On Net::OSCAR use the command:
$oscar->commit_buddylist()
That makes any changes you make to your buddy list/blocked list/allow list/allow preferences (which are like buddies-only, everyone, etc)

I (think) the Net::AIM command looks like this...
$aim->send_buddylist or
$aim->send_buddies but I'm not sure.

Although I personally like the "Warn and block, warn and block, warn and block" over and over again because it's so funny to watch the lowest form of human intelligence do it OVER and OVER and OVER again (especially when you have 3 bots, they try talking to all of them one after another every time you restart it and get warned 3 times) Razz
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Bot Depot Forum Index -> Promote A Bot or Site 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