All pastes #832205 Raw Edit

Untitled

public text v1 · immutable
#832205 ·published 2007-12-25 22:40 UTC
rendered paste body
<?
//set all necessary variables.
$server = 'irc.tibexpro.com';
$channel = '#bots';
$port = 6667;
$nick = 'pdbot'.rand(1,10000);
$name = 'pdbot';
// make sure we dont timeout
set_time_limit(0);
//connect to the server
$connect = fsockopen($server,$port, $errno, $errstr, 60);
echo "Connected\n";

// we want an infinite loop.
while (true) {
// get the stuff the server sends so we know wat we doin.
 while ($data = fgets($connect, 1025)) {
 //send info
   fputs($connect, "USER $name phadeddarkbot darkbot :Dark\n");
       fputs($connect, "NICK $nick\n");
$r = explode(' ',$data);
// send ping back that ur there
     if ($r[0] == "PING") {
   $pong = strstr($data, ":");
   fputs($connect, "PING $pong\n");
   } 
     echo $data;
   }
   }
?>