All pastes #545419 Raw Edit

Stuff

public text v1 · immutable
·published 2007-06-06 19:44 UTC
rendered paste body
<?php
echo 'zbot';
//function nl(){echo('\r\n');}
function nl(){echo('<br />');}

//where to connect to
//$target = '127.0.0.1';
$t = gethostbyname('Rokscom.NL.EU.GameSurge.net');
$tp = 6667;
$nick = 'zbot';
$user = 'zbot';
$my_address = 'mijn ip';

$s = @fsockopen($t,$tp,$en,$es);
//creating socket
echo 'Attempting to create a socket..'.nl();
if($s){
	echo 'Succes!'.nl();
}else{
	die('Failed: reason: '.socket_strerror(socket_last_error()).nl());	
}
echo 'sending nick'.nl();
echo 'DEBUG - \'NICK '.$nick.'\''.nl();
fwrite($s, 'NICK '.$nick.'\r\n');
echo 'sending user'.nl();
echo 'DEBUG - \'USER '.$user.' '.$my_address.' '.$t.' :'.$user.'\''.nl();
fwrite($s, 'USER '.$user.' localhost '.$t.' '.$user.'\r\n');	
while(!feof($s)){
	$m = (fgets($s,128)).nl();
	echo($m);
}


?>