Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $host = "irc.focogaming.com";
- $port = 6667;
- $nick = "JamesPHP";
- $ident = "JamesPHP";
- $channel = "#exotic";
- $readbuffer = "";
- $realname = "James PHP - PHP bot";
- $connected = 0;
- $fp = fsockopen($host, $port, $erno, $errstr, 30);
- if (!$fp)
- {
- echo $errstr." (".$errno.")<br />\n";
- }
- else
- {
- if($connected == 0) {
- fwrite($fp, "NICK ",.$nick."\r\n");
- fwrite($fp, "USER ".$ident." ".$host." bla :".$realname."\r\n");
- }
- fwrite($fp, "JOIN ",.$channel."\r\n");
- fwrite($fp, "PRIVMSG ".$channel." :JamesPHP Alpha build loading...\r\n");
- fwrite($fp, "PRIVMSG ".$channel." :Ready to go!\r\n");
- while (!feof($fp)) {
- $line = fgets($fp, 128);
- echo $line."\n";
- $line = explode(":ping ", $line);
- echo $line[0]."\n";
- if ($line[1]) {
- fwrite($fp, "PONG ".$line[1]."\r\n");
- }
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement