All pastes #432027 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-04-10 00:48 UTC
rendered paste body
<?php

$host = "irc.hackthissite.org";
$port=6667;
$nick="sodab0t";
$ident="sodab0t";
$chan="#argh";
$readbuffer="";
$realname ="sodab0t";


$fp = fsockopen($host, $port, $erno, $errstr, 30);


if (!$fp) {
    echo $errstr." (".$errno.")<br />\n";
} else {
    
    fwrite($fp, "NICK ".$nick."\r\n");
    fwrite($fp, "USER ".$ident." ".$host." bla :".$realname."\r\n");
    fwrite($fp, "JOIN :".$chan."\r\n");
    
    
    fwrite($fp, "PRIVMSG ".$chan." :All other bots are inferior to me. \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"); 
        
while ($line=fgets($fp)) 
echo $line; 

 if (stripos($line, "PRIVMSG ".$chan " :hello ")>0) {
    
     fwrite($fp, "PRIVMSG ".$chan." :  hey, whats up \r\n");
{

}

  }
      
    }
    
    fclose($fp);
}
?>