my IRC bot

It accepts one command, !stats USERID_HERE, it requires the user_parse.php from the download sections on that whatpulse site.

<?php
# USER CONFIGURATION

$server = 'irc.server.net';
$port = 6667;
$Owner = 'Shawn!Shawns@bunny.army.is.preparing.for.world.domination';
$mynick = 'WhatPulse';
$rlname = 'WhatPulse Stats Bot';
$mynickpass = 'fjdlsdFASfjkljaSDAFAEWAsd';
$channel = '#Testing';
$uModes ='+pBT';

# END OF CONFIGURATION

set_time_limit(0);
require("user_parse.php");
$socket = fsockopen($server,$port);
stream_set_timeout($socket,600);
fputs($socket,"USER $mynick somestuff here :$rlname\n");
fputs($socket,"NICK $mynick\n");
fputs($socket,"MODE $mynick $uModes\n");
fputs($socket,"PRIVMSG NickServ :IDENTIFY $mynickpass\n");
fputs($socket,"JOIN $channel\n");
while($data = fgets($socket)) {
   flush();
   $ex = explode(' ', $data);
   $command = str_replace(array(chr(10), chr(13)), '', $ex[3]);
   if($ex[0] == 'PING'){ fputs($socket, "PONG :$ex[1]\n"); }
   if(($command == ':!die')&&($ex[0] == ":$Owner")){ die(); }
   if((preg_match("/(!stats)/Si",$command) == 1)&&($ex[4])){
      if(preg_match("/([0-9]+)/",$ex[4]) == 1) {
         PulseStats($ex[4], &$socket, &$channel);
      } else {
         fputs($socket,"PRIVMSG $channel :Please use the UserID of the person, not the account name. Ex: !stats 227041\n");
      }
   }
}
function PulseStats($StatID, &$socket, &$channel){
   $WP_stats = new WP_stats;
   $stats = $WP_stats->get($StatID);
   fputs($socket,"PRIVMSG $channel :[$stats->AccountName]: [Total Keys: $stats->TotalKeyCount/Total Clicks: $stats->TotalMouseClicks/Total Miles: $stats->TotalMiles/Rank: $stats->Rank] [Team: $stats->TeamName/Team Rank: $stats->TeamRank]\n");
}
?>