ChrisMartino Posted January 12, 2010 Share Posted January 12, 2010 Ok, So i have my php bot working on my vps, It connects to the server , it logs in just doesn't do anything yet haha, How would i make it send welcome messages to people that join?, Heres the code: <?php // Prevent PHP from stopping the script after 30 sec set_time_limit(0); // Edit these settings $chan = "#Christopher"; $server = "irc.gtanet.com"; $port = 6667; $nick = "MrRobot"; $pass = "password"; // STOP EDITTING NOW. $socket = fsockopen("$server", $port); fputs($socket,"USER $nick $nick $nick $nick :$nick\n"); fputs($socket,"NICK $nick\n"); fputs($socket,"identify $pass\n"); fputs($socket,"JOIN ".$chan."\n"); while(1) { while($data = fgets($socket)) { echo nl2br($data); flush(); $ex = explode(' ', $data); $rawcmd = explode(':', $ex[3]); $oneword = explode('<br>', $rawcmd); $channel = $ex[2]; $nicka = explode('@', $ex[0]); $nickb = explode('!', $nicka[0]); $nickc = explode(':', $nickb[0]); $host = $nicka[1]; $nick = $nickc[1]; if($ex[0] == "PING"){ fputs($socket, "PONG ".$ex[1]."\n"); } $args = NULL; for ($i = 4; $i < count($ex); $i++) { $args .= $ex[$i] . ' '; } if ($rawcmd[1] == "!sayit") { fputs($socket, "PRIVMSG ".$channel." :".$args." \n"); } elseif ($rawcmd[1] == "!md5") { fputs($socket, "PRIVMSG ".$channel." :MD5 ".md5($args)."\n"); } } } ?> Quote Link to comment https://forums.phpfreaks.com/topic/188271-php-irc-bot-welcome-message/ Share on other sites More sharing options...
Catfish Posted January 13, 2010 Share Posted January 13, 2010 is there a manual for this irc bot? or are you making it? Quote Link to comment https://forums.phpfreaks.com/topic/188271-php-irc-bot-welcome-message/#findComment-994089 Share on other sites More sharing options...
ChrisMartino Posted January 13, 2010 Author Share Posted January 13, 2010 Just making it. Quote Link to comment https://forums.phpfreaks.com/topic/188271-php-irc-bot-welcome-message/#findComment-994297 Share on other sites More sharing options...
Lamez Posted January 13, 2010 Share Posted January 13, 2010 This might help you: http://www.dreamincode.net/forums/showtopic82278.htm Quote Link to comment https://forums.phpfreaks.com/topic/188271-php-irc-bot-welcome-message/#findComment-994310 Share on other sites More sharing options...
ChrisMartino Posted January 13, 2010 Author Share Posted January 13, 2010 That don't work i've tried it. Quote Link to comment https://forums.phpfreaks.com/topic/188271-php-irc-bot-welcome-message/#findComment-994346 Share on other sites More sharing options...
RussellReal Posted January 13, 2010 Share Posted January 13, 2010 dude if a user joins the channel the server will tell you he joins, find out how you can figure out how to know when a user joins and then parse the information and use it in php I'm gonna make a php IRC bot I was gonna make one in mIRC(mSL) but I forgot it, so imma make mine pro n stuff in php lol Quote Link to comment https://forums.phpfreaks.com/topic/188271-php-irc-bot-welcome-message/#findComment-994351 Share on other sites More sharing options...
ChrisMartino Posted January 13, 2010 Author Share Posted January 13, 2010 The bot don't login either dose anybody know how to solve this? Quote Link to comment https://forums.phpfreaks.com/topic/188271-php-irc-bot-welcome-message/#findComment-994358 Share on other sites More sharing options...
ChrisMartino Posted January 14, 2010 Author Share Posted January 14, 2010 anyone? Quote Link to comment https://forums.phpfreaks.com/topic/188271-php-irc-bot-welcome-message/#findComment-994874 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.