<?php
set_time_limit(0);
class bot {
var $sock;
var $server = "irc.devcollective.com";
var $port = 6667;
var $nick = 'pdbot';
var $ident = 'bot';
var $name = 'pdbot';
var $chan = '#devcol';
function connect() {
$this->sock = fsockopen($this->server, $this->port);
fputs($this->sock, "USER $this->ident 127.0.0.1 localhost :$this->name\n\r");
fputs($this->sock, "NICK $this->nick\n\r"); // You should just create a send function (example below..)
//fputs($this->sock, "JOIN #devcol");
while (!feof($this->sock)) {
$data = fgets($this->sock,512);
echo "-> $data";
}
}
function send($Data) {
fputs($this->sock,$Data."\n\r");
}
}
$connect = new bot;
$connect->connect();
?>