Code: Select all
<?php
set_time_limit(0);
$channels = '#testddt';
$nick = 'hereiam';
$server = 'irc.gamersrealm.org';
//$username = 'username';
//$password = 'password';
$resource = @fsockopen($server, 6667, $errno, $errstr, 30);
if (!$resource) {
echo 'There was an error with the connection! Error ' . $errstr . ' - Number: ' . $errno;
}
else {
fwrite($resource, 'NICK ' . $nick . "\r\n");
fwrite($resource, 'USER ' . $nick . ' "adelphia.net" "127.0.0.1" :botr' . "\r\n");
while (!feof($resource)) {
$data = fgets($resource, 1000);
$parray = explode(' ', $data);
$na = explode('!', $parray[0]);
$address = explode(' ', $na[1]);
$address = explode('@', $address[0]);
$address = $address[1];
$channel = $parray[2];
if ($parray[0] == 'PING') {
fwrite($resource, 'PONG ' . $parray[1] . "\r\n");
}
if (eregi("END OF MESSAGE", $data)) {
fwrite($resource, 'MODE ' . $nick . ' +xB' . "\r\n");
//fwrite($resource, 'AUTHSERV auth ' . $username . ' ' . $password . "\r\n");
sleep(5);
fwrite($resource, 'JOIN ' . $channels . "\r\n");
}
if (trim($parray[3]) == ':.test') {
fwrite($resource, 'PRIVMSG ' . $channel . ' :What is it that you want to test?' . "\r\n");
}
if (trim($parray[3]) == ':.quit')
{
fclose($resource);
}
}
}
?>or ill getThere was an error with the connection! Error The operation completed successfully. - Number: 0
There was an error with the connection! Error Success - Number: 0
anyone see any problems?