Basic PHP IRC Bot
PHP Code
+ 3 likes
Please Register to submit score.
| Average Score | 7.8 (of 5 scores) |
| Date Added | Nov 08, 2008 |
| Last Updated | Apr 05, 2009 |
| Tags | bot codes furby irc irc bot irc server php php irc bot server xstatic xstatic codes |
Introduction
Commands are:
!sayit <Your message here> - The bot just repeats your message.
!md5 <your message here> - The bot just says the md5 sum of your message.
How to run it, you change the variables to which i said to edit. then you save it as whatever you want.php then just double click it on windows, or on linux type php filename.php...
you must have php installed.
PHP Snippet:
Basic PHP IRC Bot
Posted on Nov 8, 2008 6:46 pm
Posted on Nov 8, 2008 6:46 pm
me loves my other one more =)
36 php pages does everything you could wish for =)
36 php pages does everything you could wish for =)
PHP Snippet:
Basic PHP IRC Bot
Posted on Nov 9, 2008 7:53 pm
Posted on Nov 9, 2008 7:53 pm
This would make a very nice foundation for a much more advanced PHP IRC bot.
PHP Snippet:
Basic PHP IRC Bot
Posted on Nov 10, 2008 5:23 am
Posted on Nov 10, 2008 5:23 am
on my other one, the one with 36 php pages, it has a !hawkee function that gets last 10 comments (Or what it used to be ;)
was fun making them =)
was fun making them =)
PHP Snippet:
Basic PHP IRC Bot
Posted on Nov 11, 2008 9:56 am
Posted on Nov 11, 2008 9:56 am
| Quote: |
| double click it on windows, or on linux type php filename.php... |
PHP Snippet:
Basic PHP IRC Bot
Posted on Nov 24, 2008 2:45 pm
Posted on Nov 24, 2008 2:45 pm
Wow, extremely helpful. Thanks.
PHP Snippet:
Basic PHP IRC Bot
Posted on Jan 6, 2009 11:07 am
Posted on Jan 6, 2009 11:07 am
Furby how abt posting your 35 pages one :) if not maybe personally sned it 2 me
find me: AdA9 @ quakenet
curiousity of a PhP nub:D
find me: AdA9 @ quakenet
curiousity of a PhP nub:D
PHP Snippet:
Basic PHP IRC Bot
Posted on Jan 7, 2009 12:17 am
Posted on Jan 7, 2009 12:17 am
ODD, atm, I'm rewriting it to make it so others can have it, and have it easy. but I'll be sure to let you have it once its rewritten
PHP Snippet:
Basic PHP IRC Bot
Posted on Jan 7, 2009 5:34 pm
Posted on Jan 7, 2009 5:34 pm
thanks furby goodluck with rewriting and waiting that script:)
PHP Snippet:
Basic PHP IRC Bot
Posted on Jan 8, 2009 8:07 am
Posted on Jan 8, 2009 8:07 am
it connects to the irc server i put used quakenet, but it dont join channel ..
PHP Snippet:
Basic PHP IRC Bot
Posted on Jan 9, 2009 5:27 am
Posted on Jan 9, 2009 5:27 am
some networks do not allow instant channel join so you would have to use a while loop before you join the channel with a sleep in it and some pong back inorder not to get disconnected from server
this should be placed right under the :
NOTE to furby :I guess you should use some sleep commands inorder to save the pain from cpu leaks and server pressure a "sleep(1);" would be good but if you want you can use "usleep():" for milliseconds:)
| Quote: |
while($logincount < 10) { $logincount++; $data = fgets($socket, 128); echo nl2br($data); // Separate all data $ex = explode(' ', $data); // Send PONG back to the server if($ex[0] == "PING"){ fputs($socket, "PONG ".$ex[1]."\n"); } flush(); } sleep(1); |
this should be placed right under the :
| Quote: |
| fputs($socket,"NICK $nick\n"); |
NOTE to furby :I guess you should use some sleep commands inorder to save the pain from cpu leaks and server pressure a "sleep(1);" would be good but if you want you can use "usleep():" for milliseconds:)
PHP Snippet:
Basic PHP IRC Bot
Posted on Jan 9, 2009 6:59 am
Posted on Jan 9, 2009 6:59 am
thanks i'll give it a try now.
PHP Snippet:
Basic PHP IRC Bot
Posted on Jan 9, 2009 1:12 pm
Posted on Jan 9, 2009 1:12 pm
Thanks ODD that fixed it :)
PHP Snippet:
Basic PHP IRC Bot
Posted on Jan 12, 2009 10:52 am
Posted on Jan 12, 2009 10:52 am
um when i double click it opens notepad for editing.. help?
PHP Snippet:
Basic PHP IRC Bot
Posted on Jan 13, 2009 12:30 am
Posted on Jan 13, 2009 12:30 am
Windows: right click it, and go open as.. then select the PHP CGI or what ever it is....
Linux: Open up a terminal window, navigate to the dir where the php irc bot is, then type php filename.php
Linux: Open up a terminal window, navigate to the dir where the php irc bot is, then type php filename.php
PHP Snippet:
Basic PHP IRC Bot
Posted on Mar 5, 2009 10:23 am
Posted on Mar 5, 2009 10:23 am
| Quote: |
Hawkee: This would make a very nice foundation for a much more advanced PHP IRC bot. |
Would it be possible to make a forum topic or section for this bot. with download links for the complete stand alone versions? Because, i would like to help develop it into a huge beast :P
PHP Snippet:
Basic PHP IRC Bot
Posted on Mar 5, 2009 10:28 am
Posted on Mar 5, 2009 10:28 am
I'm currently reworking the script section in order to allow for PHP script uploads. Once that's complete you'll be able to maintain a version there.
PHP Snippet:
Basic PHP IRC Bot
Posted on Apr 5, 2009 4:17 pm
Posted on Apr 5, 2009 4:17 pm
bone282:
when I use this, the MD5 will always be the same?!
did i copy something wrong?
/edit: oh, the $args string was in singlequotes
I did'nt see that
when I use this, the MD5 will always be the same?!
did i copy something wrong?
/edit: oh, the $args string was in singlequotes
I did'nt see that
PHP Snippet:
Basic PHP IRC Bot
Posted on Apr 18, 2009 2:14 pm
Posted on Apr 18, 2009 2:14 pm
PHP Snippet:
Basic PHP IRC Bot
Posted on Apr 29, 2009 7:23 am
Posted on Apr 29, 2009 7:23 am
im quite noob so bare with me. when i start it , it will be on the channel few minutes and then it will quit. when i put it into empty channel it stays few hours :S
PHP Snippet:
Basic PHP IRC Bot
Posted on May 2, 2009 2:13 pm
Posted on May 2, 2009 2:13 pm
if you are getting "connection reset by peer". try running it NOT from your brower. just drop it in the same dir as php.exe and run from there. or add:
/* Prevent Script Stopping. */
ignore_user_abort(true);
set_time_limit(0);
/* Prevent Script Stopping. */
ignore_user_abort(true);
set_time_limit(0);
PHP Snippet:
Basic PHP IRC Bot
Posted on May 3, 2009 5:16 am
Posted on May 3, 2009 5:16 am
when run via command line, a CTRL + C also causes a "connection reset by peer" message,
I wonder how I can make a "Client exited" message...
mean peer.. always resets my connection :D
I wonder how I can make a "Client exited" message...
mean peer.. always resets my connection :D
PHP Snippet:
Basic PHP IRC Bot
Posted on May 3, 2009 12:41 pm
Posted on May 3, 2009 12:41 pm
by closing the socket. try using socket_ functions in php. example here http://www.hawkee.com/snippet/6076/
by the way killwithme, if you launch the script with a .bat file it uses cmd.exe as the bot window.
by the way killwithme, if you launch the script with a .bat file it uses cmd.exe as the bot window.
PHP Snippet:
Basic PHP IRC Bot
Posted on May 3, 2009 6:53 pm
Posted on May 3, 2009 6:53 pm
I'm already doing this bone282,
but yeah I have to get a closer look to the socket functions
but yeah I have to get a closer look to the socket functions
PHP Snippet:
Basic PHP IRC Bot
Posted on Jul 15, 2009 8:02 pm
Posted on Jul 15, 2009 8:02 pm
WOW!!!
It's very nice man...
Lol just don't run it on a external webserver that uses linux and on a irc server that you dont own because then you will have to restart the webserver =) it just kept running the php for along time...
Lol
It's very nice man...
Lol just don't run it on a external webserver that uses linux and on a irc server that you dont own because then you will have to restart the webserver =) it just kept running the php for along time...
Lol
PHP Snippet:
Basic PHP IRC Bot
Posted on Aug 20, 2009 3:38 pm
Posted on Aug 20, 2009 3:38 pm
Hi, first off im new to php sockets and secondly i run this from my website and it works fine.
My question is how do i add more commands ?
I have tryed to copy the triggers and rewrite them with no sucess :/
Commands for an example a !join $chat trigger.
Thanks
Gemster
My question is how do i add more commands ?
I have tryed to copy the triggers and rewrite them with no sucess :/
Commands for an example a !join $chat trigger.
Thanks
Gemster














