All pastes #628710 Raw Edit

Anonymous

public text v1 · immutable
·published 2007-07-21 15:54 UTC
rendered paste body
<?php
class createBot {
	function createBots($address,$port,$nick) {
		$channel='#devcol';
		$link=socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
		$connect = socket_connect($link, $address, $port);
		if (!$connect) {
			die("Dude i cant connect?");
		}
		socket_write($link, "USER Dark D A R K :DARK\r\n");
		socket_write($link, "NICK $nick\r\n");
while (true) {
	$data = socket_read($link, 800);
	$data=trim($data,"\r\n");
	$tok = explode(' ', $data);
	if ($tok[0] == 'PING') {
		$pong = $tok[1];
		socket_write($link, "PONG $pong\r\n");
	}
	if ($tok[1] == 376 || $tok[1] == 372) {
		socket_write($link, "JOIN $channel\r\n");
	}
}
	}
}
$start = new createBot();
$start->createBots('irc.devcollective.com',6667,'IDK?');
  ?>