<?
//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;
}
}
?>