All pastes #510230 Raw Edit

Mine

public text v1 · immutable
·published 2007-05-25 20:18 UTC
rendered paste body
<?php
set_time_limit(0);
/*
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$$$$$$$$$    Configuration    $$$$$$$$$
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
*/
$conf[1] = "Ooooo"; // Default IDENTD
$conf[2] = "fireZ bot"; // Default Real Name
$conf[3] = "blablablaa"; // Default Nick
$conf[4] = "FireZ"; // Owner
$conf[5] = "#php"; // Channel to Join when connects!
$conf[6] = "a.az.us.undernet.org"; // IRC to connect
$conf[7] = 6667; // Port to connect
/*
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$$$$$$$$     Code Starts!     $$$$$$$$
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
*/
$log = fopen("log.html",'w');
$date = Date("d/m/Y");
fwrite($log,"Starting log of data for date: ".$date." (server time).<br>");

$sock = fsockopen(gethostbyname($conf[6]),$conf[7]) or die("Couldnt create the socket to the server.<br>");
fwrite($log,"Socket connected to the server, attempting to authenticate.<br>");

fputs($sock,"USER ".$conf[1]." firez.com ".$conf[1]." :".$conf[2]."\n") or die("Socket error.<br>");
fputs($sock,"NICK ".$conf[3]."\n") or die("Socket error.<br>");
fwrite($log,"Authenticated, bot is fully operating.<br>");
fputs($sock,"JOIN ".$conf[5]) or die("Socket error.<br>");

while(1) {
        while ($data = fgets($sock)) {
                fwrite($log,$data);

                $info = explode(" ",$data);
                if ($info[0] == "PING") {
                        fputs($sock,"PONG ".$info[1]."\n");
                }


        }
}
?>