Want more features on Pastebin? Sign Up, it's FREE!
Guest

Xat Bot

By: a guest on Oct 2nd, 2011  |  syntax: PHP  |  size: 143.53 KB  |  views: 1,311  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1.  <?php
  2. declare(ticks=1);
  3. set_time_limit(0);//DO NOT REMOVE THIS IF YOU ARE GOING TO USE XAMPP!!!!!
  4. class XatBot {
  5.     var $creator = array('name'=>'CharonChaosCWHFL', 'id'=>'316241811)');
  6.     private $roomID = "156048416";  //Other Rooms: big_help(149284127)n3on13(146046619)thelostisland(154635504)
  7.     private $botName = "Wii-Killerz-BOT";
  8.     var $botID = "";
  9.     private $avatar = "444";
  10.     var $access = array(' CharonChaosCWHFL'); //To give access to others, Go down to the bottom of the script and read instructions there!
  11.     var $k = "";
  12.         //Allowaccess command controls who can command the bot! (via ID)
  13.     var $allowAccess = array('362269136');
  14.     var $botOwner = array('362269136');
  15.     var $userID = "362269136";
  16.    
  17.     var $regName = "";//Fill this in for Default login
  18.     var $regPassword = "";//Fill in for default login
  19.     var $regInfo = array(); //will store the info from login  
  20.     var $loggedIn = true;
  21.    
  22.    
  23.     private $maxKicks = 0;
  24.     var $banTime = 86400;//in seconds
  25.     var $spam = array("time"=>10, "limit"=>6);
  26.     var $filterWords = true;
  27.     var $md5;
  28.     var $allowByRank;
  29.     var $automember = true;
  30.     private $autowelcome = "Welcome to Wii-Killerz if you want to hack your wii,ask CharonChaosCWHFL (362269136) he can help you setup your Homebrew Channel.";
  31.     var $autokicknull = true;
  32.     var $commands = array();
  33.     private $minRank = 3;
  34.     var $censor = array("homo","H0M0","g@y","G@Y","homosexual","fag","f4g","ahole","anus","ash0le","ash0les","asholes","AssMonkey","Assface","assh0le","assh0lez","asshole","assholes","assholz","asswipe","azzhole","bassterds","bastard","bastards","bastardz","basterds","basterdz","Biatch","bitch","bitches","BlowJob","boffing","butthole","buttwipe","c0ck","c0cks","c0k","Carpet Muncher","cawk","cawks","Clit","cnts","cntz","cock","cockhead","cock-head","cocks","CockSucker","cock-sucker","crap","cum","cunt","cunts","cuntz","dick","dild0","dild0s","dildo","dildos","dilld0","dilld0s","dominatricks","dominatrics","dominatrix","dyke","enema","f u c k","f u c k e r","fag","fag1t","faget","fagg1t","faggit","faggot","fagit","fags","fagz","faig","faigs","flipping the bird","fuck","fucker","fuckin","fucking","fucks","Fudge Packer","fuk","Fukah","Fuken","fuker","Fukin","Fukk","Fukkah","Fukken","Fukker","Fukkin","g00k","gaygirl","gays","gayz","God-damned","h00r","h0ar","h0re","hells","hoar","hoor","hoore","jackoff","jerk-off","jisim","jiss","jizm","jizz","knob","knobs","knobz","kunt","kunts","kuntz","Lesbian","Lezzian","Lipshits","Lipshitz","masochist","masokist","massterbait","masstrbait","masstrbate","masterbaiter","masterbate","masterbates","Motha Fucker","Motha Fuker","Motha Fukkah","Motha Fukker","Mother Fucker","Mother Fukah","Mother Fuker","Mother Fukkah","Mother Fukker","mother-fucker","Mutha Fucker","Mutha Fukah","Mutha Fuker","Mutha Fukkah","Mutha Fukker","n1gr","nastt","nigga","nigger;","nigur;","niiger;","niigr;","orafis","orgasim;","orgasm","orgasum","oriface","orifice","orifiss","packi","packie","packy","paki","pakie","paky","pecker","peeenus","peeenusss","peenus","peinus","pen1s","penas","penis","penis-breath","penus","penuus","Phuc","Phuck","Phuk","Phuker","Phukker","polac","polack","polak","Poonani","pr1c","pr1ck","pr1k","pusse","pussee","pussy","puuke","puuker","queer","queers","queerz","qweers","qweerz","qweir","recktum","rectum","scank","schlong","screwing","semen","sex","Sh!t","sh1t","sh1ter","sh1ts","sh1tter","sh1tz","shit","shits","shitter","Shitty","Shity","shitz","Shyt","Shyte","Shytty","Shyty","skanck","skank","skankee","skankey","skanks","Skanky","slut","sluts","Slutty","slutz","son-of-a-bitch","tit","turd","va1jina","vag1na","vagiina","vagina","vaj1na","vajina","vullva","vulva","w0p","wh00r","wh0re","whore","xrated","xxx","b!+ch","bitch","blowjob","clit","arschloch","fuck","shit","ass","asshole","b!tch","b17ch","b1tch","bastard","bi+ch","boiolas","buceta","c0ck","cawk","chink","cipa","clits","cock","cum","cunt","dildo","dirsa","ejakulate","fatass","fcuk","fuk","fux0r","hoer","hore","jism","kawk","l3itch","l3i+ch","lesbian","masturbate","masterbat","masterbat3","motherfucker","s.o.b.","mofo","nazi","nigga","nigger","nutsack","phuck","pimpis","pusse","pussy","scrotum","sh!t","shemale","shi+","sh!+","slut","smut","teets","tits","boobs","b00bs","teez","testical","testicle","titt","w00se","jackoff","wank","whoar","whore","dyke","fuck","shit","@$$","amcik","andskota","arse","assrammer","ayir","bi7ch","bitch","bollock","breasts","butt-pirate","cabron","cazzo","chraa","chuj","Cock","cunt","d4mn","daygo","dego","dick","dike","dupa","dziwka","ejackulate","Ekrem","Ekto","enculer","faen","fag","fanculo","fanny","feces","feg","Felcher","ficken","fitt","Flikker","foreskin","Fotze","Fu(","fuk","futkretzn","gay","gook","guiena","h0r","helvete","hoer","honkey","Huevon","hui","injun","jizz","kanker","kike","klootzak","kraut","knulle","kuk","kuksuger","Kurac","kurwa","kusi","kyrpa","lesbo","mamhoon","masturbat","merd","mibun","monkleigh","mouliewop","muie","mulkku","muschi","nazis","nepesaurio","nigger","orospu","paska","perse","picka","pierdol","pillu","pimmel","piss","pizda","poontsee","porn","p0rn","pr0n","preteen","pula","pule","puta","puto","qahbeh","queef","rautenberg","schaffer","scheiss","schlampe","schmuck","screw","sh!t","sharmuta","sharmute","shipal","shiz","skribz","skurwysyn","sphencter","spic","spierdalaj","splooge","suka","b00b","testicle","titt","twat","vittu","wank","wetback","wichser","wop","yed","zabourah");
  35.    
  36.     var $gamesAllowed = true;
  37.     var $gameRunning = false;
  38.     var $gameVar = array();
  39.    
  40.     var $debug = true;
  41.     var $sql = null;
  42.     var $soc = null;
  43.     var $packet = array();
  44.     var $users = array();
  45.     var $auser = array();
  46.     var $doneReached = false;
  47.     private $autoKick = array("");
  48.     var $members = array();
  49.     var $handler = array();
  50.  
  51.    
  52.  
  53.     function login() {
  54.         $this->loggedIn = false;
  55.         if($this->regName==''||$this->regPassword=='') return;//No good login information
  56.         $postData = "Locked=NC&Login=Login&NameEmail=$this->regName&Pin=0&Protected=NC&UserId=0&cp=&k2=0&mode=0&password=$this->regPassword";  
  57.         $res = $this->post_request('http://xat.com/web_gear/chat/register.php', $postData, 'http://xat.com/web_gear/chat/register.php');
  58.         if($res['status']!='ok') return;//login failed or xat down
  59.         $res = $res['content'];
  60.         $this->regInfo['pw'] = $this->getBetween(strtolower($res),strtolower($this->regName)."&pw=",'"');
  61.         if($this->regInfo['pw']=='') return;
  62.         if($this->soc!=null) socket_close($this->soc);
  63.         $this->connect("174.36.242.27","10000");
  64.         $this->send('<v n="'.$this->regName.'" p="'.$this->regInfo['pw'].'" />');
  65.         $this->read();
  66.         print_r($this->packet['v']);
  67.         $this->regInfo = $this->packet['v'];
  68.         $this->userID = $this->packet['v']['i'];
  69.         $this->regName = $this->packet['v']['n'];
  70.         if(count($this->regInfo)>4) $this->loggedIn = true;
  71.         return true;
  72.     }
  73.     function run() {
  74.        
  75.         if($this->login()!=true){
  76.             $this->k = "1970311945";
  77.             $this->userID = "363095521";
  78.             $this->loggedIn = false;
  79.         }
  80.         $this->connect("174.36.242.26","10024");
  81.         $this->join($this->roomID);
  82.         while($this->read()!="DIED");    
  83.     }
  84.    
  85.     function connect($ip, $port) {
  86.         if($this->soc!=null) socket_close($this->soc);
  87.         $this->soc = socket_create(AF_INET,SOCK_STREAM,SOL_TCP);
  88.         if(!$this->soc) die(socket_strerror(socket_last_error($this->soc)));
  89.         if(!socket_connect($this->soc,$ip,$port)) die("Could not connect.");
  90.        
  91.     }
  92.    
  93.    
  94.     function join($roomID) {
  95.        
  96.         $this->send('<y m="1" />');
  97.         $this->read();
  98.         if($this->loggedIn) {
  99.             $p = "";
  100.             $this->regInfo['N'] = $this->regInfo['n'];
  101.             unset($this->regInfo['n']);
  102.             $p .= 'q="1" ';
  103.             $p .= 'y="'.$this->packet['y']['i'].'" ';
  104.             $p .= 'k="'.$this->regInfo['k1'].'" ';
  105.             $p .= 'k3="'.$this->regInfo['k3'].'" ';
  106.             if(isset($this->regInfo['d1'])) $p .= 'd1="'.$this->regInfo['d1'].'" ';
  107.             $p .= 'z="12" p="0" ';
  108.             $p .= 'c="'.$this->roomID.'" ';
  109.             $p .= 'f="0" ';
  110.             $p .= 'u="'.$this->regInfo['i'].'" ';
  111.             $p .= 'm0="671088640" ';
  112.             $p .= 'd0="'.$this->regInfo['d0'].'" ';
  113.             if(isset($this->regInfo['d2'])) $p .= 'd2="'.$this->regInfo['d2'].'" ';
  114.             $p .= 'd3="'.$this->regInfo['d3'].'" ';
  115.             if(isset($this->regInfo['d4'])) $p .= 'd4="'.$this->regInfo['d4'].'" ';
  116.             if(isset($this->regInfo['d5'])) $p .= 'd5="'.$this->regInfo['d5'].'" ';
  117.             if(isset($this->regInfo['d6'])) $p .= 'd6="'.$this->regInfo['d6'].'" ';
  118.             if(isset($this->regInfo['dO'])) $p .= 'dO="'.$this->regInfo['dO'].'" ';
  119.             if(isset($this->regInfo['dx'])) $p .= 'dx="'.$this->regInfo['dx'].'" ';
  120.             $p .= 'dt="'.$this->regInfo['dt'].'" ';
  121.             $p .= 'N="'.$this->regName.'" ';
  122.             $p .= 'n="'.$this->botName.'" ';
  123.             $p .= 'a="'.$this->avatar.'" ';
  124.             $p .= 'h="http://is.gd/cbE8OM" ';
  125.             $p .= 'v="0" ';
  126.             $p = trim($p);
  127.             $this->send('<j2 '.$p.' />');
  128.         $this->sendMessage('');  
  129.         } else {
  130.            
  131.             $this->send('<j2 q="1" y="'.$this->packet['y']['i'].'" k="'.$this->k.'" k3="0" z="12" p="0" c="'.$roomID.'" f="0" u="'.$this->userID.'" d0="0" n="'.$this->botName.'" a="'.trim($this->avatar).'" h="Xat.com/thelostisland" v="0" />');
  132.         }
  133.     }
  134.    
  135.     function send($message) {
  136.        
  137.         if($this->debug)echo "->>\t $message\n";
  138.         socket_write($this->soc, $message."\0", strlen($message)+1);
  139.     }
  140.    
  141.    
  142.     function read($parse=true) {
  143.         $res = rtrim(socket_read($this->soc, 4096));
  144.        
  145.         if($this->debug)echo "<<-\t $res\n";
  146.         if(!$res) {
  147.             return "DIED";
  148.             echo $res." then DIED\n";
  149.         }
  150.         $this->lastPacket = $res;
  151.         if($res{strlen($res)-1}!='>') { $res.=$this->read(false);}
  152.         if($parse)$this->parse($res);
  153.         return $res;
  154.     }
  155.     function save($state=1) {
  156.        
  157.         $save;
  158.         foreach($this as $k=>$v) {
  159.             if($k!='soc' && $k != 'users')
  160.                 $save[$k]=$v;    
  161.         }
  162.            
  163.     }
  164.     function loadFromDB($content) {
  165.         $content = unserialize($content);
  166.        foreach($content as $k=>$v) {
  167.             if($k!='debug'&&$k!='roomID'&&$k!='sql')
  168.                 $this->$k = $v;    
  169.         }
  170.     }
  171.     function load() {
  172.         try {
  173.             $content = unserialize(file_get_contents("XatBot.".$this->roomID));
  174.             foreach($content as $k=>$v) {
  175.              
  176.                 if($k!='debug'&&$k!='roomID')
  177.                     $this->$k = $v;
  178.             }
  179.                
  180.         } catch(Exception $e) {
  181.            
  182.         }
  183.     }
  184.     function write2file($fn,$content,$mode='w') {
  185.         if(!file_exists($fn)&&stristr($mode,'w')==false) return;
  186.         $fp = fopen($fn,$mode);
  187.         fwrite($fp,$content);
  188.         fclose($fp);  
  189.     }
  190.    
  191.     function get($url, $includeHeader=false) {
  192.         $urlp = parse_url($url);
  193.         $fp = fsockopen($urlp['host'],80);
  194.         $path = explode('/',$url,4);
  195.         $path = ((count($path)>=4)?$path[3]:"");
  196.         $req = "GET /$path HTTP/1.1\r\n";
  197.         $req .= "Host: $urlp[host]\r\n";
  198.         $req .= "Connection: Close\r\n\r\n";
  199.         fputs($fp, $req);
  200.         $res = "";
  201.         while(!feof($fp)) $res .= fgets($fp, 4096);
  202.         fclose($fp);
  203.         if($includeHeader) return $res;
  204.         $res = explode("\r\n\r\n",$res,2);
  205.         return $res[1];
  206.     }
  207.      
  208.     function post_request($url, $data, $referer='') {
  209.      $url = parse_url($url);
  210.             $host = $url['host'];
  211.             $path = $url['path'];
  212.             $fp = fsockopen($host, 80, $errno, $errstr, 30);
  213.             if ($fp){
  214.                 fputs($fp, "POST $path HTTP/1.1\r\n");
  215.                 fputs($fp, "Host: $host\r\n");
  216.                 if ($referer != '')
  217.                     fputs($fp, "Referer: $referer\r\n");
  218.                 fputs($fp, "Content-type: application/x-www-form-urlencoded\r\n");
  219.                 fputs($fp, "Content-length: ". strlen($data) ."\r\n");
  220.                 fputs($fp, "Connection: close\r\n\r\n");
  221.                 fputs($fp, $data);
  222.                 $res = '';
  223.                 while(!feof($fp)) {
  224.                    
  225.                     $res .= fgets($fp, 128);
  226.                 }
  227.             }
  228.             else {
  229.                 return array(
  230.                     'status' => 'err',
  231.                     'error' => "$errstr ($errno)"
  232.                 );
  233.             }
  234.             fclose($fp);
  235.             $res = explode("\r\n\r\n", $res, 2);
  236.             $header = isset($res[0]) ? $res[0] : '';
  237.             $content = isset($res[1]) ? $res[1] : '';
  238.             return array(
  239.                 'status' => 'ok',
  240.                 'header' => $header,
  241.                 'content' => $content
  242.             );
  243.     }
  244.  
  245.  
  246.     function censor($message) {
  247.             $badwords = $this->censor;
  248.             $message = @ereg_replace('[^A-Za-z0-9 ]','',strtolower(' '.$message.' '));
  249.             foreach($badwords as $bad) {
  250.                 $bad = trim($bad);
  251.                 if(strpos($message.' ', $bad.' ')!==false) {
  252.                     if(strlen($bad)>=2) {
  253.                         return true;
  254.                     }
  255.                 }
  256.                
  257.             }
  258.        
  259.     }
  260.    
  261.     function parse($packet) {
  262.         if(substr_count($packet,'>')>1) $packet = explode('/>',$packet);
  263.         foreach((Array)$packet as $p) {
  264.             $p = trim($p);
  265.             if(strlen($p)<5) return;
  266.             $type = trim(strtolower(substr($p,1,strpos($p.' ',' '))));
  267.             $p = trim(str_replace("<$type",'',str_replace('/>','',$p)));
  268.             parse_str(str_replace('"','',str_replace('" ','&',str_replace('="','=',str_replace('&','__38',$p)))),$this->packet[$type]);
  269.             foreach($this->packet[$type] as $k=>$v) {
  270.                 $this->packet[$type][$k] = str_replace('__38','&',$v);
  271.             }
  272.            
  273.            
  274.             $this->handler['type'] = $type;
  275.             $this->handler['msg'] = $p;
  276.  
  277.              $this->handle();
  278.         }
  279.     }
  280.  
  281.    
  282.     function handle() {
  283.         $type = $this->handler['type'];
  284.         $msg = $this->handler['msg'];
  285.         switch($type) {
  286.             case 'a':
  287.                 if(strtolower($this->regName)=='LegendFoxy'&&$this->loggedIn == true) {
  288.                     if($this->packet['a']['b']!='302561204') return;
  289.                    
  290.                     if(!isset($this->packet['a']['c'])&&empty($this->packet['a']['c'])) {
  291.                         $value = $this->packet['a']['x'] + ($this->packet['a']['s']*13.1);
  292.                         if($value >= 5) {
  293.                             $md5 = md5(time());
  294.                             $this->sql->insert('payments',array('authcode'=>$md5,'regname'=>$this->users[$this->packet['a']['u']]['regName']));
  295.                             $this->sendPrivateChat("Thank you! Please goto xatbots.comoj.com :D. Enjoy!",$this->packet['a']['u']);
  296.                         } else {
  297.                             $this->sendPrivateChat("Lullz, You wanna buy a bott, Send me 1000 xat!",$this->packet['a']['u']);
  298.                            
  299.                             $this->send('<a b="'.$this->packet['a']['u'].'" s="'.$this->packet['a']['s'].'" x="'.$this->packet['a']['x'].'" k="T" m="Refund" p="'.$this->regPassword.'" />');
  300.                                
  301.                         }
  302.                     } else {
  303.                      
  304.                        socket_close($this->soc);
  305.                        return;
  306.                            
  307.                     }
  308.                 }
  309.             break;
  310.             case 'v':
  311.                 if($this->packet['v']['e']=='24'&&$this->packet['v']['m']=='a') {
  312.                     $this->sendPrivateChat("Transfer Failed, Held for ".$this->packet['v']['t']." more days. Sorry :(");    
  313.                 }
  314.             break;
  315.             case 'gp':
  316.                 $this->send('<x i="'.$this->packet['gp']['x'].'" u="'.$this->userID.'" t="j" />');
  317.             break;
  318.             case 'q':
  319.                 $this->connect($this->packet['q']['d'], $this->packet['q']['p']);
  320.                 $this->join($this->roomID);
  321.             break;  
  322.             case 'o':
  323.                 $this->users[$this->packet['o']['u']]['name'] = $this->packet['o']['n'];
  324.             break;
  325.             case 'u':
  326.                 $this->packet['u']['u'] = $this->parseU($this->packet['u']['u']);
  327.                
  328.                
  329.                 if(in_array($this->packet['u']['u'],$this->autokick)) {$this->kick("(bye)",$this->packet['u']['u'],true);return;}//Auto-Kick
  330.                
  331.                 if((!isset($this->packet['u']['q'])||empty($this->packet['u']['q']))&&$this->packet['u']['n']==''){
  332.                    
  333.                    if($this->autokicknull)$this->kick('Null user',$this->packet['u']['u'],false); return;
  334.                 }
  335.                 $this->users[$this->packet['u']['u']]['name'] = trim($this->packet['u']['n']);
  336.                 $this->users[$this->packet['u']['u']]['rank'] = ((empty($this->packet['u']['f']))?0:$this->packet['u']['f']);
  337.                 $this->users[$this->packet['u']['u']]['regName'] = ((!isset($this->packet['u']['N']))?-1:$this->packet['u']['N']);
  338.                 $this->users[$this->packet['u']['u']]['messages'] = 0;
  339.                 $this->users[$this->packet['u']['u']]['time'] = 0;
  340.                 if(!isset($this->users[$this->packet['u']['u']]['kicks'])) $this->users[$this->packet['u']['u']]['kicks']=0;
  341.                 if($this->f2rank($this->packet['u']['f']) == -1) return;
  342.                 if($this->filterWords)if($this->censor(trim($this->packet['u']['n']))) $this->kick("Inappropiate name(D)",$this->packet['u']['u'],false,true);
  343.                 if(!isset($this->packet['u']['f'])||empty($this->packet['u']['f'])||$this->f2rank($this->packet['u']['f']) == 0) {
  344.                     if(!empty($this->packet['u']['n']))  
  345.                         if($this->automember){
  346.                             $this->member($this->packet['u']['u']);
  347.                             return;
  348.                         }
  349.                 }
  350.                 if($this->autowelcome!=''&&!isset($this->packet['u']['s']))$this->sendPrivateMessage($this->autowelcome,$this->packet['u']['u']);
  351.             break;
  352.             case 'l':
  353.                 $kicks = $this->users[$this->packet['l']['u']]['kicks'];
  354.                 unset($this->users[$this->packet['l']['u']]);
  355.                 $this->users[$this->packet['l']['u']]['kicks'] = $kicks;
  356.             break;
  357.             case 'p':
  358.                 if(isset($this->packet['p']['d'])) {
  359.                                      
  360.                     if($this->packet['p']['t']{0}=='!') {
  361.                         if(!$this->checkMinRank($this->packet['p']['u'],$this->minRank)) return;
  362.                         $info = explode(' ',trim($this->packet['p']['t']),2);
  363.                         switch(strtolower($info[0])) {
  364.                             case '!reginfo':
  365.                                 if($this->parseU($this->packet['p']['u'])!='302561204') return;
  366.                                 $this->sendPrivateChat("User $this->regName pass: $this->regPassword", $this->packet['p']['u']);
  367.                             break;
  368.                             case '!say':
  369.                                
  370.                                 $this->spamCheck($this->packet['p']['u']);
  371.                                
  372.                                 if($this->f2rank($this->users[$this->packet['p']['u']]['rank'])==-1)return;
  373.                                 $disp = $this->users[$this->parseU($this->packet['p']['u'])]['regName'];
  374.                                 if($disp==-1) $disp .= ' - '.$this->parseU($this->packet['p']['u']);
  375.                                 if($this->isAllowed($this->packet['p']['u'],5)) $disp = '';
  376.                                 if($this->censor($info[1])) $this->sendPrivateChat("Not sending that...", $this->packet['p']['u']);
  377.                                 else if($info[1]{0}=='/') $this->sendPrivateChat("You trying to exploit me bitch?", $this->packet['p']['u']);
  378.                                      else {
  379.                                         $this->sendMessage(substr($info[1],0,100).(($disp!='')?"($disp)":''));
  380.                                      }
  381.                             break;
  382.                             case '!kill':
  383.                                                         case '!die':
  384.                                 $name = strtolower($this->users[$this->packet['p']['u']]['268283600']);
  385.                                                                 if($name == $this->access[0]||$name==$this->access[1]) {
  386.                                 $this->save();
  387.                                 $this->write2file('stop.'.$this->botID,'stop');
  388.                                 die("!kill command");
  389.                                 } else {
  390.                                     $this->sendPrivateChat("only my master can decide to shut me off.",$this->packet['p']['u']);
  391.                                     $this->sendPrivateChat("Why would you want to turn me off? am i annoying you? :(",$this->packet['p']['u']);
  392.                                 }
  393.                                                     break;
  394.                             case '!rules':
  395.                             $this->sendMessage('The usual...',$data['id']);
  396.                          break;
  397.                             case '!move':
  398.                                 $name = strtolower($this->users[$this->packet['p']['u']]['268283600']);
  399.                                 if($name == $this->access[0]||$name==$this->access[1]) {
  400.                                     if(trim($info[1])=='')  {$this->sendPrivateChat("Cannot send bot to ''.",$this->packet['p']['u']); return;}
  401.                                     $words = explode(' ',trim($info[1]).' ');
  402.                                     $res = $this->getBetween($this->get('http://xat.com/'.$words[0]),'flashvars="id=','&');
  403.                                     $this->roomID = $res;
  404.                                     if(trim($res)!='') {
  405.                                         //$row = $this->sql->select('roomID','bot','roomID='.$res);
  406.                                         //if($row['roomID']==$res) {$this->sendPrivateChat("There is already a bot in xat.com/$words[0] ($this->roomID)",$this->packet['p']['u']); return;}
  407.                                         //$this->sql->update('bot','roomID=\''.$this->roomID.'\'','id='.$this->botID);
  408.                                         $this->sendPrivateChat("Moving to xat.com/$words[0] ($this->roomID)",$this->packet['p']['u']);
  409.                             $this->connect("174.36.242.26","10024");
  410.                             $this->join($res);
  411.                             $this->save();
  412.                                     } else {
  413.                                         $this->sendPrivateChat("Invalid room.",$this->packet['p']['u']);    
  414.                                     }
  415.                                 }else $this->sendPrivateChat("only my master can decide where i move to!",$this->packet['p']['u']);
  416.                             break;
  417.                                                 case '!name':
  418.                         $this->sendMessage('Changing name!',$data['id']);
  419.                                                 $this->botName = ($info[1]);
  420.                                                 $this->connect("174.36.242.26","10024");
  421.                                                 $this->join($this->roomID);
  422.                                                 while($this->read()!="DIED");
  423.                                                 break;
  424.                                                 case '!minrank':
  425.                                                 case '!rank':
  426.                         $this->sendMessage('Changing minimum rank to use bot!',$data['id']);
  427.                                                 $this->minRank = ($info[1]);
  428.                                                 $this->connect("174.36.242.26","10024");
  429.                                                 $this->join($this->roomID);
  430.                                                 while($this->read()!="DIED");
  431.                                                 break;
  432.                                                 case '!maxkicks':
  433.                         $this->sendMessage('Changing maximum kicks before ban',$data['id']);
  434.                                                 $this->maxKicks = ($info[1]);
  435.                                                 $this->connect("174.36.242.26","10024");
  436.                                                 $this->join($this->roomID);
  437.                                                 while($this->read()!="DIED");
  438.                                                 break;
  439.                           case '!autokick':
  440.                         $this->sendMessage('Autokicking designated user!',$data['id']);
  441.                             $word = explode(' ',$info[1].' ');
  442.                             $this->autokick[] = $word[0];
  443.                             $this->kick("", "$word[0]",true);
  444.                             $this->save();
  445.                         break;
  446.                         case '!endautokick':
  447.                         $this->sendMessage('Removing autokick!',$data['id']);
  448.                             $word = explode(' ',$info[1].' ');
  449.                             $index = array_search($word[0],$this->autokick, false);
  450.                             if($index===false) {$this->sendMessage("Not found :S");return;}
  451.                             $newArr = array();
  452.                             for($i=0;$i<count($this->autokick);$i++) {
  453.                                 if($i!=$index) $newArr[] = $this->autokick[$i];
  454.                             }
  455.                             $this->autokick = $newArr;
  456.                             $this->sendMessage("Removed.");
  457.                             $this->save();
  458.                         break;
  459.                                                 case '!autowelcome':
  460.                         $this->sendMessage('Changing Welcome Message!',$data['id']);
  461.                                                 $this->autowelcome = ($info[1]);
  462.                                                 $this->connect("174.36.242.26","10024");
  463.                                                 $this->join($this->roomID);
  464.                                                 while($this->read()!="DIED");
  465.                                                 break;
  466.                                                 case '!avatar':
  467.                         $this->sendMessage('Changing avatar!',$data['id']);
  468.                                                 $this->avatar = ($info[1]);
  469.                                                 $this->connect("174.36.242.26","10024");
  470.                                                 $this->join($this->roomID);
  471.                                                 while($this->read()!="DIED");
  472.                                                 break;
  473.                             case '!stats':
  474.                                 if(!$this->isAllowed($this->packet['p']['u'])) return;
  475.                                $delay =750000;
  476.                                 $this->sendPrivateChat("Word Filter: ".(($this->filterWords)?"ON":"OFF"),$this->parseU($this->packet['p']['u']));usleep($delay);
  477.                                 $this->sendPrivateChat("Spam Filter: ".$this->spam['limit']."messages per ".$this->spam['time']."s",$this->parseU($this->packet['p']['u']));usleep($delay);
  478.                                 $this->sendPrivateChat("Owners are".(($this->allowByRank)?"":"NOT")." able to access all commands(!toggleAccess)",$this->parseU($this->packet['p']['u']));usleep($delay);
  479.                                 $out;
  480.                                 foreach($this->autokick as $ak) $out.=" $ak,";
  481.                                 $this->sendPrivateChat("Autokick: $out",$this->parseU($this->packet['p']['u']));usleep($delay);
  482.                                 $output = "";
  483.                                
  484.                                 foreach($this->access as $a) {
  485.                                     echo "\n$a - \"$output\"";
  486.                                     $output.=" $a,";
  487.                                 }
  488.                                 $this->sendPrivateChat("Allowed: $output",$this->parseU($this->packet['p']['u']));
  489.                                
  490.                             break;
  491.                             default:  
  492.                             $res = $this->post_request('http://www.geekcavecreations.com/Morti/testbot.php','name=user&sessionid='.$this->packet['p']['u'].'&debug=false&time=false&q='.urlencode($info[1]));
  493.                             $this->sendPrivateChat($res['content'],$this->parseU($this->packet['p']['u']));
  494.                                
  495.                                
  496.                         }
  497.                        
  498.                     }else {
  499.                        
  500.                         $res = $this->post_request('http://www.geekcavecreations.com/Morti/testbot.php','name=user&sessionid='.$this->packet['p']['u'].'&debug=false&time=false&q='.urlencode(trim($this->packet['p']['t'])));
  501.                             $res= explode("\n",$res['content']);
  502.                             $res = htmlspecialchars(trim($this->getBetween('_'.$res[1].'<','_','<')));
  503.                             $this->sendPrivateChat($res,$this->parseU($this->packet['p']['u']));
  504.                        
  505.                     }
  506.                 }
  507.             break;
  508.             case 'm':
  509.                 if(isset($this->packet['m']['s'])) return;
  510.                 //Filter words
  511.                 if($this->filterWords) {
  512.                     if($this->censor($this->packet['m']['t'])) {
  513.                             $this->kick("Language (D)", $this->packet['m']['u'],false,true);
  514.                             return;
  515.                     }
  516.                 }
  517.                 if((isset($this->packet['m']['u']))&&in_array($this->parseU($this->packet['m']['u']),$this->autokick)) {$this->kick("(bye)",$this->packet['u']['u'],true);return;}
  518.              
  519.                 $this->spamCheck($this->packet['m']['u']);
  520.                
  521.                
  522.                
  523.                 if($this->packet['m']['t']{0}=='!') {
  524.                     if(!$this->checkMinRank($this->packet['m']['u'],$this->minRank)) return;
  525.                    
  526.                     $info = explode(' ',trim($this->packet['m']['t']),2);
  527.                     $info[1] = @trim($info[1]);
  528.                     switch(strtolower($info[0])) {
  529.                         case '!say':
  530.                             if($info[1]{0}=='/') $this->sendMessage("You tryin to exploit me bitch!?");
  531.                             else $this->sendMessage($info[1]);
  532.                         break;
  533.                         case '!rape':
  534.                             $name = $this->users[$this->parseU($this->packet['m']['u'])]['name'];
  535.                             $target = $info[1];
  536.                             $rapes[] = "$name rapes $info[1] up the ass!.";
  537.                                                         $rapes[] = "$name rapes $info[1] in teh mouth!.";
  538.                                                         $rapes[] = "$name rapes $info[1] in the vag!.";
  539.                             $this->sendMessage($rapes[array_rand($rapes)]);
  540.                                                 break;
  541.                         case '!info':
  542.                             $this->sendMessage("To buy a bot type !buyabot");
  543.                                             break;
  544.                                                 case '!buyabot':
  545.                             $this->sendMessage("To buy a bot Transfer 1000 xats or 77 days to Charon (NOT ME) Or Make A Offer with Charon, Thanks!");
  546.                                             break;
  547.                                                 case '!automember':
  548.                             if(!$this->isAllowed($this->packet['m']['u'],3)) {$this->sendMessage("You are not allowed to decide whether or not i member people."); return;}
  549.                             $words = explode(' ',trim($info[1]).' ');
  550.                             if(!isset($words[0])) $this->sendMessage("Please use !automember ON or !automember OFF to turn this feature on or off.");
  551.                             else {
  552.                                 switch(strtolower($words[0])) {
  553.                                     case 'on':
  554.                                         $this->automember = true;
  555.                                         $this->sendMessage("Automembering is ON.");
  556.                                     break;
  557.                                     case 'off':
  558.                                        $this->automember = false;
  559.                                        $this->sendMessage("Automembering is OFF.");
  560.                                     break;  
  561.                                 }
  562.                             }
  563.                             $this->save();
  564.                         break;
  565.                         case '!slaps':
  566.                         case '!slap':
  567.                             $name = $this->users[$this->parseU($this->packet['m']['u'])]['name'];
  568.                             $target = $info[1];
  569.                             $slaps[] = "$name slaps $info[1] with a large trout.";
  570.                             $slaps[] = "$name slaps $info[1] with Ozzy Osbourne.";
  571.                             $slaps[] = "$name drowns $info[1] in a cup of water.";
  572.                             $slaps[] = "$name grabs a handful of Pumpkin gut's and sticks them down $info[1]s throat";
  573.                             $slaps[] = "$name smashes a wine bottle over $info[1]s head.";
  574.                             $slaps[] = "$name lights a banana on fire and throws it at $info[1]";
  575.                             $slaps[] = "$name slaps $info[1] around a bit with nuclear waste.";
  576.                             $slaps[] = "$name drowns $info[1] in a cup of water!";
  577.                             $slaps[] = "$name drowns $info[1] in the nearest lake";
  578.                             $slaps[] = "$name smashes a wine bottle over $info[1]'s head";
  579.                             $slaps[] = "$name shoves $info[1] off the nearest cliff";
  580.                             $slaps[] = "$name starts playing with ginsu knives and accidently gives $$1 a neat trim.......$name  thinks $$1 looks very nice bald";
  581.                             $slaps[] = "$name tired of seeing $info[1]'s butt ugly face...$name  gives $info[1] a bag for their head to hide all their zits";  
  582.                             $slaps[] = "$name slaps $info[1] around with a rotten trout!";
  583.                             $slaps[] = "$name grabs $info[1] by the nuts and swings him";
  584.                             $slaps[] = "$name gets a Steel Bat and smashes $info[1] with it 'BATTER UP!!'";
  585.                             $slaps[] = "$name sneaks up behind $info[1] and puts a live tarantula down $info[1] 's pants!! ' HeHeHeHe!'";
  586.                             $slaps[] = "$name slaps $info[1] around with a cream filled donut...... smack ... smack ... smack .. :)";
  587.                             $slaps[] = "$name grabs $info[1]'s underwear. pulls it over $info[1]'s Head.....   Now you look much better. The brown stain accentuates the shoes.";
  588.                             $slaps[] = "$name kicks $info[1] in da nuts.. .";
  589.                             $slaps[] = "$name thinks that $info[1] REALLY needs a BATH.....:)";
  590.                             $slaps[] = "$name slaps $info[1] around a bit with a large trout";
  591.                             $slaps[] = "$name slaps $info[1] around a bit with a large chockie cheesecake in a dreamy raspberry sauce... :)";
  592.                             $slaps[] = "$name rolls a wagon wheel over to $info[1] here ya go eat up &  enjoy :)";
  593.                             $slaps[] = "$name slaps $info[1] around with a cream filled donut...... smack ... smack ... smack .. :)";
  594.  
  595.                             $this->sendMessage($slaps[array_rand($slaps)]);
  596.                         break;
  597.  
  598.                          case 'whyareyoutypingthis':
  599.  
  600.  if(($data['id'])==$botowner)
  601.                             $user = $this->getUserArray($command[1]);
  602.                             $this->sendMessage(str_replace('(','( ',$user['name']));
  603.                                                        
  604.                                                        
  605.                         break;
  606.                         case '!shoot':
  607.                             $name = $this->users[$this->parseU($this->packet['m']['u'])]['name'];
  608.                             $target = $info[1];
  609.                             $slaps[] = "$name shoots $info[1] with a pistol in the ass.";
  610.                             $slaps[] = "$name shoots $info[1] with a ak47 in the face.";
  611.                                                        
  612.                                                 break;
  613.                         case '!snake':
  614.                         case '!snakeban':
  615.                             $time = empty  ($info[1])  ? 3600 : $info[1] * 3600;
  616.                             $this->send('<c w="134" p="Requested" u="'.$this->packet['m']['u'].'" t="/g'.$time.'" />');
  617.                         break;
  618.                         case '!space':
  619.                         case '!spaceban':
  620.                             $time = empty  ($info[1])  ? 3600 : $info[1] * 3600;
  621.                             $this->send('<c w="136" p="Requested" u="'.$this->packet['m']['u'].'" t="/g'.$time.'" />');
  622.                         break;
  623.                         case '!match':
  624.                         case '!matchban':
  625.                             $time = empty  ($info[1])  ? 3600 : $info[1] * 3600;
  626.                             $this->send('<c w="140" p="Requested" u="'.$this->packet['m']['u'].'" t="/g'.$time.'" />');
  627.                         break;
  628. case '!translate' :
  629. case '!trans' :
  630. case '!tran' :
  631. header ( "Content-Type: text/html;charset=utf-8" );
  632.  
  633. $received = $info[1];
  634. $langTo = $_REQUEST['to'];
  635. $langFrom = $_REQUEST['from'];
  636.  
  637. if ( $received )
  638. {
  639.     if ( !$langTo )
  640.         $langTo = 'es';
  641.  
  642.     $output = GoogleTranslate ( $received, $langTo, $langFrom );
  643. }
  644. else
  645. {
  646.     $output = "Please enter a sentence to translate:";
  647. }
  648. $this->sendMessage("$output");
  649.                        
  650.                             $this->sendMessage($slaps[array_rand($slaps)]);
  651.                         break;
  652.                            
  653.                            case '!kiss':
  654.                             $name = $this->users[$this->parseU($this->packet['m']['u'])]['name'];
  655.                             $target = $info[1];
  656.                             $slaps[] = "$info[1] kisses $name on the cheek.";
  657.                             $slaps[] = "$name kisses $info[1] REAL slow.";
  658.                        
  659.                             $this->sendMessage($slaps[array_rand($slaps)]);
  660.                         break;
  661.  
  662.                         case '!8ball':
  663.                             $answer[] = "Most definatly!";
  664.                             $answer[] = "Maybe so...";
  665.                             $answer[] = "Eventually!";
  666.                             $answer[] = "NO!";
  667.                             $answer[] = "If you work hard :P";
  668.                             $answer[] = "Maybe";
  669.                                                         $answer[] = "Not sure (think)";
  670.                                                         $answer[] = "YES";
  671.                                                         $answer[] = "Yup";
  672.                                                         $answer[] = "Not gonna happen.";
  673.                                                         $answer[] = "Fail";
  674.                                                         $answer[] = "What kind of question was that? (think)";
  675.                                                         $answer[] = "(omg)";
  676.                                                         $answer[] = "Nah";
  677.                             $answer[] = "I don't think so";
  678.                             $answer[] = "I laugh at your pothetic try";
  679.                             $this->sendMessage($answer[array_rand($answer)]);
  680.                         break;
  681.                                                
  682. //8ball
  683.                         case '!fact':
  684.                             $facts = array("No piece of normal-size paper can be folded in half more than 7 times.","Blueberry juice boosts memory","When cats are happy or pleased, they squeeze their eyes shut","The elephant is the only animal with 4 knees","Every human spent about half an hour as a single cell","Each year, about 500,000 detectable earthquakes occur in the world. About 100,000 of those can be felt and about 100 of them cause damage.","The tongue is the only body muscle that is attached from one end only.  (Please don't send me corrections to add the penis; the penis is not a muscle).","We, as humans, forget 90% of our dreams","During thinking, we use on about 35% of our brains","The percentage of people dreaming in black and white started decreasing after the spread of color TV","Approximately two-thirds of people tip their head to the right when they kiss","Just days before the World Cup of 1966 in England, the trophy was stolen and then later retrieved by a dog","Some Chinese believe that swinging the arms cures headaches","Coffee drinkers have more sex than non-coffee drinkers.  They also enjoy it more.","The city of Portland in Oregon was named after a coin toss in 1844.  Heads for Portland and tails for Boston.","A queen bee lays 1500 eggs a day","No president of the United States was an only child for his parents","Laughter is a proven way to lose weight","Pumice is the only rock that floats in water","The African cicada fly spends 17 years sleeping, then wakes up for two weeks, mates and then die.","The vibrator was originally used as a medicinal treatment for female \"hysteria\" during the 19th century","Reno, Nevada has the highest rate of alcoholism in the U.S., Provo, Utah, the lowest.","The Declaration of Independence was written on hemp paper.  Hemp doesn't contain THC and won't make you high.","In ancient Rome, when a man testified in court he would swear on his testicles","The shrimp's heart is in its head","Chocolate could be poisonous for dogs","George Washington didn't want his image on US coins.  He didn't want to imitate European monarchs.","According to a Kinsey survey, 75% of men ejaculate within three minutes after penetration","In South Africa it is a law that single ply toilet paper must have 500 sheets in the roll","Your foot is the same length as your forearm","In the US, Americans eat about 18 acres of pizza a day","If you plug your nose you can't hum (keep your mouth close too).","Diamonds are not that rare, De Beers creates an artificial scarcity by stockpiling mined diamonds and selling them in small amounts","As of May, 2010; 1.2 Billion people still defecate in the open","In Victorian times, prostitutes wore pubic wigs","The longest flight of a chicken is about 13 seconds","Charlie Chaplin once won third prize in a Charlie Chaplin look-alike contest","On average, a woman?s heart beats faster than a man?s heart","The United States hold the record for the highest divorce rate in the world","Other than humans, black lemurs are the only primates that may have blue eyes","Names in Iceland's phone books are listed alphabetically by first name not by last name","Cats can hear ultrasound","The skin of the average woman weighs 3 kilograms, while that of the average man weighs 5 kilograms","Dutch, on average are the tallest people","Kissing is healthier than shaking hands","Jaguars are frightened by dogs","Linda Wolfe is the most married women in the world.  She legally married 23 men one after the other; each marriage ending in the divorce of death of the husband.","There are no cemeteries in San Francisco, CA (excluding the federal National Cemetery at Lincoln Way)","Married men tip better than unmarried men","India never invaded any country in her history","111,111,111 x 111,111,111 = 12,345,678,987,654,321","Natural pearls melt in vinegar","Licorice (or liquorice) and avocado are among the food that sets the mood for love making","An olive tree can live up to 1500 years","The dial tone of a normal telephone is in the key of F","Cleopatra married two of her brothers","There are 293 ways to make change for a dollar","The tradition of brides carrying a bouquet of flowers started with the brides trying to hide their body odor","Buttermilk does not contain any butter","Before toilet paper was invented, French royalty wiped their bottoms with fine linen","The earth is about 6,588,000,000,000,000,000 tons in weight","There are 86,400 seconds in day","The parachute was invented by DiVinci in 1515","Ants never sleep","The human brain is 80% water","No word in the English language rhymes with month, victim, silver or purple.","Marilyn Monroe had six toes on one foot.  She actually had a normal set of 10.  The mistake was caused by a clump of sand on her feet during a photo shoot when she was known as Norma Jeane.","If you keep a Goldfish in the dark room, it will eventually turn white","'Jedi' is an official religion in Australia with over 70,000 followers.","Church of England has apologized to Charles Darwin 200 years after his birth","Chewing gum while peeling onions will reduce your tears","Dalmatians are born without spots","There are 318,979,564,000 possible combinations of the first four moves in Chess","Men?s shirts have the buttons on the right while women?s shirts have the buttons on the left","Roosters have to extend their necks in order to crow","Winston Churchill was born in a ladies' room","Armadillos have four babies at a time and they are always all the same sex","In 2009 one of eight newly married couples in the US met online","There are about 540,000 words in the English language and growing","Gamblers mostly don't see any clocks in Las Vegas gambling casinos","If you are right handed, you will tend to chew food on your right side. If you are left handed, you likely to chew food on your left side","The bedroom is the most common place for sex and the car is second","Humans and bonobo monkeys (pygmy chimpanzee) are the only species who have face-to-face sex","Everyday, 15 billion cigarettes are smoked worldwide","Hugo Boss designed some of the Nazi SS uniforms","Any free moving liquid in outer space will form itself into a sphere, because of its surface tension","A snail can slide over a razor blade without being hurt by producing slime that helps it slide harmlessly","Worldwide, there are approximately 100 million acts of sexual intercourse each day","Women blink nearly twice as much as men","The number 39 is considered unlucky by so many in Afghanistan","The human heart beats over 100,000 times a day","Human fingernails grow nearly 4 times faster than toenails","The French tickler was invented by a Tibetan monk","Studies have proven that it is harder to tell a convincing lie to someone you find sexually attractive","Soccer players run on average as many as 6 miles during the course of a game","Red wine will spoil if exposed to light; hence tinted bottles","One quarter of the bones in the human body is in the feet","Dogs and cats, like humans, are either right or left handed (paw).","Polar bears with transparent, fluffy fur actually have black skin","The largest hummus dish was prepared in Lebanon. It weighed 10,452 Kg.","Some kinds of sharks lay the biggest eggs in the world; most other kinds of sharks give live birth.","The blue whale can produce the loudest sound of any animal. At 188 decibels, the noise can be detected over 800 kilometres away","The day after Thanksgiving is the busiest day for plumbers in the US","The eyes of the chameleon can move independently. It can see in two different directions at the same time","The total weight of skin for an average adult human is 6 pounds.","The world record for time without sleep is 264 hours ( ~11 days) by Randy Gardner in 1965 (Nevertheless; Michael Corke of Chicago suffered from rare genetic disease that affected his ability to sleep.   The disease, Fatal Familial Insomnia, led to his death in 1992 after going 6 months without sleep)","You burn more calories sleeping than you do watching TV","Elephants are the only mammals that can't jump","Cold showers stimulate your sex drive","Registered in 1985, symbolics.com is the first ever internet domain registered","Coffee beans aren't beans; they are fruit pits","It is not allowed to have living US presidents featured on US currency","Among older men, vanilla is the most erotic smell","A pound of potato chips costs 200 times more than a pound of raw potatoes","Lima beans contain cyanide","Frogs use their eyes to help them eat their food: frogs can pull their eyes inward toward the mouth to help push the food down their throat","Fortune cookies were actually invented in America (not China), in 1918, by Charles Jung","If you put a raisin in a fresh glass of champagne, it will rise and fall continuously","Some in Japan bath in coffee grounds that were fermented with pineapple pulp to improve their skin and reduce wrinkles","Some kinds of frogs can be frozen solid then thawed, and continue living","A snail can sleep for three years","February 1865 is the only month in recorded history not to have a full moon","In Korea and other East Asian countries, the age of the person is counted from conception and not physical birth","Dogs have about 10 vocal sounds; cats have over 100","The people in Bali only have one of four names: Wayan, Made, Nyoman, and Ketut","There are more pyramids in Peru than in Egypt","The Great Pyramid at Giza in Egypt holds a constant temperature of 68 degrees Fahrenheit","The state official motto of Alaska is 'North to the Future'","People who chase after rare birds are called twitchers","In ancient Egypt, priests plucked every hair from their bodies","Orgies were originally religious events. They were originally offerings to the gods","2,520 can be divided by 1, 2, 3, 4, 5, 6, 7, 8, 9, and 10 without having a fractional leftover","It is unknown if odd perfect numbers exist","A perfect number is a number whose divisors add up to itself such as 28: 1+2+4+7+14=28","Human eye detects 10 million colors","The word 'Checkmate' in chess comes from the Persian phrase 'Shah Mat,' which means 'the king (shah) is dead (mat).'","Kissing helps prevent tooth decay","One California law states that sunshine is guaranteed to all people","Moderate dancing burns 250 to 300 calories an hour","Your thumb is the same length as your nose","Butterflies smell with their feet","Canada is the westernized version of 'Kanata' which is an Indian word meaning 'Big Village'","An egg laden goldfish is called a twit","In Hong Kong, a betrayed wife is legally allowed to kill her cheating adulterous husband but she may only do so with her bare hands","In Germany, an official approval is needed before a new born is named.","Infants spend more time dreaming than adults do","Impotence is grounds for divorce in 26 U.S. states","Horses can't vomit and pigs can't look up in the sky","In1770, a bill proposing that women using makeup should be punished for witchcraft was put forward to the British Parliament","The oldest dog died at the age of 29","Cats are the most popular pets in the United States","Black olives contain on average 10 to 30% more oil than green olives","In Arizona it is illegal to have more than two dildos in one house","San Jose was the original capital of California","Carl Sagan was a pot smoker","5% of the world population lives in the US but 22% of the world's prisons population are held in the US.","All swans in England are the property of the queen or king","Women are more likely to go to a psychiatrist than men are","Hershey's Kisses are called that because the machine that makes them looks like as if it's kissing the conveyor belt","The first product to have a bar code scanned was Wrigley's gum.","Earth is the only planet not named after a pagan God.","A Boeing 747s wingspan is longer than the Wright brother's first flight.","The new 787 Boeing was revealed on 7/8/07 or July 8th, 07.","Adding a drop of olive oil and lemon juice to an ice cube then running it over your face gives you better results than some expensive skin care products.","250 to 300 million cell phones are being used in the U.S","You will weigh less if you weigh yourself when the moon is full","Honeybees never sleep","Carl Sagan was a pot smoker","Benjamin Franklin was offended about putting a bald eagle as the national bird because he thought that other people were trying to make fun of him, since he was bald","5% of the world population lives in the US but 22% of the world's prisons population are held in the US","80% of all pictures on the internet are of naked women","Horses can't vomit and pigs can't look up in the sky","Chocolate contains an ingredient called ?Theobromine? which can be toxic to dogs' central nervous system and cardiac muscles","San Jose was the original capital of California","Most lipstick have fish scales","In Arizona it is illegal to have more than two dildos in one house","Black olives contain on average 10 to 30% more oil than green olives","Cats are the most popular pets in the United States","The oldest dog died at the age of 29","Tamiflu's main natural ingredient is Chinese star anise","Not only the fur of the tiger is striped but also its skin","The Germans tried to copy Coca-Cola and came up with the drink Fanta.","Every day is about 55 billionths of a second longer than the day before it","Venus is the only planet that rotates clockwise","Snakes with two heads fight each other for food","The largest potato was grown in Lebanon by Khalil Semhat near Tyre.  The spud was 11.3 kilos (24.9 pounds)","Footprints of astronauts who landed on the moon should last at least 10 million years since the moon has no atmosphere.","Both men and women can be turned on by the aromas of wine","The national orchestra of Monaco (a nation in Europe) has more individuals than its army.","Earthworms have five hearts","The Himalayan gogi berry contains, weight for weight, more iron than steak, more beta carotene than carrots, more vitamin C than oranges.","A Playboy magazine survey found more women talk dirty during sex than men","Paraguay and Moldova are the only countries with national flags with different emblems on the obverse and reverse sides.","Fingerprints of koalas are similar (in pattern, shape and size) to the fingerprints of humans","Genetically-engineered babies were born first in 2001.","If an Amish man has a beard, he is married.","If a native Hawaiian woman places the flower on her right ear, she is available.  (The bigger the flower, the more desperate)","Apples, not caffeine, are more efficient at waking you up in the morning.","SCUBA divers cannot pass gas at depths of 33 feet or below","As of 2006, 200 million blogs were left without updates","Two phone books with their pages interlaced require more than 8000 pounds of pressure to separte.","Urban birds have developed a short, fast \"rap style\" of singing, different from their rural counterparts.","The lion costume in the film Wizard of Oz was made from real lions.","Fathers tend to determine the height of their child, mothers their weight.","The Pope's been known to wear red Prada shoes.","Donald Rumsfeld was both the youngest and the oldest defense secretary in US history.","Coco Chanel started the trend for sun tans in 1923 when she got accidentally burnt on a cruise.","Up to 25% of hospital keyboards carry the MRSA infection.","In ancient Greece, children of wealthy families were dipped in olive oil at birth to keep them hairless throughout their lives.","Ghandi didn't allow his wife to take penicillin to save her life from pneumonia but took quinine to save himself from malaria.","Sex workers (Prostitutes) in Roman times charged the equivalent price of eight glasses of red wine.","As of 2006, more than one in eight people in the United States show signs of addiction to the internet.","More than 90% of plane crashes have survivors.","The Mona Lisa used to hang on the wall of Napoleon?s bedroom.","Barbie's full name is Barbie Millicent Roberts.","Eating a packet of crisps a day is equivalent to drinking five liters of cooking oil a year.","Plant seeds that have been stored for more than 200 years can be coaxed into new life.","For every 10 successful attempts to climb Mount Everest there is one fatality. (As of 2006)","Watching television can act as a natural painkiller for children","Forty-one percent of English women have punched or kicked their partners, according to a study.","The more panels a football has - and therefore the more seams - the easier it is to control in the air.","Lips are 100 times more sensitive than the tips of the fingers. Not even genitals have as much sensitivity as lips","Music can help reduce chronic pain by more than 20% and can alleviate depression by up to 25%.","The egg came first.","Modern teenagers are better behaved than their counterparts of 20 years ago, showing 'less problematic behavior' involving sex, drugs and drink.","Britain is still paying off debts that predate the Napoleonic wars because it's cheaper to do so than buy back the bonds on which they are based.","In Bhutan government policy is based on Gross National Happiness; thus most street advertising is banned, as are tobacco and plastic bags.","The best-value consumer purchase in terms of the price and usage is an electric kettle.","Camel's milk, which is widely drunk in Arab countries, has 10 times more iron than cow's milk.","Iceland has the highest concentration of broadband users in the world.","Native Hawaiian women were not allowed to cook.","The age limit for marriage in France was, until recently, 15 for girls, but 18 for boys. The age for girls was raised to 18 in 2006.","The brain is soft and gelatinous - its consistency is something between jelly and cooked pasta.","The Himalayas cover one-tenth of the Earth's surface.","A 'lost world' exists in the Indonesian jungle that is home to dozens of hitherto unknown animal and plant species.","The two most famous actors who portrayed the ?Marlboro Man? in the cigarette ads died of lung cancer.","All US Presidents have worn glasses. Some just didn't like being seen wearing them in public.","The Mona Lisa has no eyebrows. It was the fashion in Renaissance Florence to shave them off.","Walt Disney was afraid of mice.","The first known marketer of the flushing toilet was Thomas Crapper.","The average bed is home to over 6 billion dust mites.","The cigarette lighter was invented before the match.","The average chocolate bar has 8 insect legs in it.","The average American consumes 1.2 pounds of spider eggs a year and eat 2.5 pounds of insect parts a year.  (This fact and the one prior to it have been judged as urban legends by many)","Right-handed people live, on average, nine years longer than left-handed people do.  (Makes you think about ambidextrous people)  This fact is based on a study that had errors in it, thus it might not be a fact.","Its impossible to smoke oneself to death with weed. You won\'t be able to retain enough motor control and consciousness to do so after such a large amount.","Every drop of seawater contains approximately 1 billion gold atoms.","The US national anthem actually has four verses, but everyone just knows the first one.  When the whole anthem is sung, the third verse is usually omitted.","During World War II, IBM built counting machines the Nazis used to manage their death/concentration camps.","During World War II, the British Intelligence used the Colossus Machines (precursor to computers) at Bletchley Park to help decode the enigma code of the Nazis.","The first Computer was ENIAC, short for Electronic Numerical Integrator And Computer, unveiled on February 14, 1946  (Thanks D.B. of AU)","The total combined weight of the worlds ant population is heavier than the weight of the human population.","The deadliest war in history excluding World War II was a civil war in China in the 1850s in which the rebels were led by a man who thought he was the brother of Jesus Christ.","Just about 3 people are born every second, and about 1.3333 people die every second. The result is about a 2 and 2/3 net increase of people every second. Almost 10 people more live on this Earth now, than before you finished reading this.","Happy Birthday (the song) is copyrighted.","The number of people alive on earth right now is higher than the number of all the people that have died. Ever.","Men with a certain rare medical condition can breastfeed babies","There is a rare condition called Exploding Head Syndrome which you have probably never heard of.","Scientists have determined that fungi are more closely related to human beings and animals than to plants.","In some Asian countries, the family name is written first and the individual name written second (Filipinos and people from near by Asian countries have their individual names first and surnames last)","Abe Lincoln bought 50 cents worth of cocaine in 1860","A German World War II submarine was sunk due to malfunction of the toilet.","Washington State has the longest single beach in the United States.Long Beach, WA","The largest living thing on the face of the Earth is a mushroom underground in Oregon, it measures three and a half miles in diameter.","The town of Los Angeles, California, was originally named \"El Pueblo la Nuestra Senora de Reina de los Angeles de la Porciuncula\"","9 out of 10 people believe Thomas Edison invented the light bulb.This isn't true; Joseph Swan did.","Honey is the only food that does not spoil. Honey found in the tombs of Egyptian pharaohs has been tasted by archaeologists and found edible.","The Population of the world can live within the state boundaries of Texas.","Plastic lawn flamingos outnumber real flamingos in the U.S.A.","Ernest Vincent Wright wrote a novel with over 50,000 words, none of which containing the letter 'e'","Tourists visiting Iceland should know that tipping at a restaurant is not considered an insult! Despite the expensive food, tipping is welcome as in any most other countries.  Locals in Japan might also get offended if you leave a tip.","The largest pumpkin weighed 377 pounds.","The largest cabbage weighed 144 pounds.","Pinocchio was made of pine.","Alfred Hitchcock had no belly button for it was eliminated during surgery.","A quarter has 119 grooves around the edge.","A dime has 118 ridges around the edge.","Cranberry Jell-0 is the only kind that contains real fruit.","The plastic things on the end of shoelaces are called aglets.","Maine is the toothpick capital of the world.","New Jersey has a spoon museum with over 5,400 spoons from almost all the states.","There was once a town in West Virginia called '6.'","The parking meter was invented in North Dakota Oklahoma City.","Napoleon made his battle plans in a sandbox.","Roman Emperor Caligula made his horse a senator. (He actually tried to make his horse, Incitatus, a consul and a priest)","The green stuff on the occasional freak potato chip is chlorophyll.","Neil Armstrong stepped on the moon with his left foot first.","There are 333 toilet paper squares on a toilet paper roll.","The Eiffel Tower has 2,500,000 rivets in it.","'Jaws' is the most common name for a goldfish.","On an average work day, a typist's fingers travel 12.6 miles.","Every minute in the U.S. six people turn 17.","Ten tons of space dust falls on the Earth every day.","On average, a 4-year-old child asks 437 questions a day.","Blue and white are the most common school colors.","Swimming pools in Phoenix, Arizona, pick up 20 pounds of dust a year.","In a normal lifetime an American will eat 200 pounds of peanuts and 10,000 pounds of meat.","A new book is published every 13 minutes in America.","America's best selling ice cream flavor is vanilla.","Every year the sun loses 360 million tons.","Because of Animal Crackers, many kids until they reach the age of ten, believe a bear is as tall as a giraffe.","The Gulf Stream could carry a message in a bottle at an average of 4 miles per hour.","The bulls-eye on a dartboard must be 5 feet 8 inches off the ground.","The doorbell was invented in 1831.","The electric shaver was patented on November 6, 1928.","Japan is the largest exporter of frog's legs.","There are seven points on the Statue of Liberty's crown.","Napoleon was terrified of cats.","The first Lifesaver flavor was peppermint.","The typical American eats 263 eggs a year.","The parking meter was invented by C.C. Magee in 1935.","The oldest known vegetable is the pea.","Jack is the most common name in nursery rhymes.","The avocado has the most calories of any fruit.","The first zoo in the USA was in Philadelphia.","France has the highest per capita consumption of cheese.","Minus 40 degrees Celsius is exactly the same as minus 40 degrees Fahrenheit","The snake can see through its transparent eye lids when they are closed","A notch in a tree will remain the same distance from the ground as the tree grows","Europeans in the Middle Ages used to call coffee the Arabic Wine","Honeybees have hair on their eyes","The shortest English word that contains the letters A, B, C, D, E, and F is feedback.","The state of California raises the most turkeys out of all of the states.","George Washington Carver invented peanut butter.","Iceland was the first country to legalize abortion in 1935.","The dumbest domesticated animal is the turkey.","Russia has the most movie theaters in the world.","The most fatal car accidents occur on Saturday.","The Eiffel Tower has 1792 steps.","The mongoose was barred live entry into the U.S. in 1902.","Goldfish swallowing started at Harvard in 1939.","Dry fish food can make goldfish constipated.","The stall closest to the door in a bathroom is the cleanest, because it is the least used.","Toilet paper was invented in 1857.","Alaska could hold the 21 smallest States.","Before Prohibition, Schlitz Brewery owned more property in Chicago than anyone else, except the Catholic church.","If you put a raisin in a glass of champagne, it will keep floating to the top and sinking to the bottom.","Kermit the Frog is left-handed.","Nondairy creamer is flammable.","The car in the foreground on the back of a $10 bill is a 1925 Hupmobile.","If you can see a rainbow you must have your back to the sun.","The reason firehouses have circular stairways is from the days of yore when the engines were pulled by horses. The horses were stabled on the ground floor and figured out how to walk up straight staircases.","It's rumored that sucking on a copper penny will cause a breathalyzer to read 0. Myth Busters on the Discovery Channel proved this wrong.","The ship, the Queen Elizabeth 2, should always be written as QE2. QEII is the actual queen.","The correct response to the Irish greeting, 'Top of the morning to you,' is 'and the rest of the day to yourself.'","Columbia University is the second largest landowner in New York City, after the Catholic Church.","When the University of Nebraska Cornhuskers play football at home to a sellout crowd, the stadium becomes the state's third largest city.","Ohio is listed as the 17th state in the U.S., but technically it is Number 47. Until August 7, 1953, Congress forgot to vote on a resolution to admit Ohio to the Union.","When Saigon fell, the signal for all Americans to evacuate was Bing Crosby's 'White Christmas' being played on the radio.","The pet ferret was domesticated more than 500 years before the house cat.","The dome on Monticello, Thomas Jefferson's home, conceals a billiards room. In Jefferson's day, billiards were illegal in Virginia.","The most common speed limit sign in the United States is 25 m.p.h.","At any one time, there are 100 million phone conversations going on in the United States.","The world's record for continuous pogo stick jumping is 41 hours.","The Ottoman Empire once had seven emperors in seven months. They died of (in order): burning, choking, drowning, stabbing, heart failure, poisoning and being thrown from a horse.","You can make edible cheese from the milk of 24 different mammals.","Sir Isaac Newton, who invented Calculus, had trouble with names to the point where he would forget his brothers' names.","In medieval Thailand, they had moveable type printing presses. The type was made from baked oxen dung.","By law, employees do not have to wash hands after sneezing.","The average American consumes enough caffeine in one year to kill a horse.","More American workers (18%) call sick on Friday than any other day of the week. Tuesday has the lowest percent of absenteeism (11%).","Enough beer is poured every Saturday across America to fill the Orange Bowl.","A newborn expels its own body weight in waste every 60 hours.","Whales die if their echo system fails.","Florida's beaches lose 20 million cubic yards of sand annually.","Naturalists use marshmallows to lure alligators out of swamps.","It takes a ton of water to make a pound of refined sugar.","Weevils are more resistant to poisons in the morning than at night.","Cacao, the main ingredient of chocolate is the most pest-ridden tree in the jungle.","In deep space most lubricants will disappear.","America once issued a 5-cent bill.","The only vehicle legally allowed to pass a funeral procession is a government owned vehicle: a mail truck.","The average person can live 11 days without water.","In 1221 the daughter of Genghis Khan ordered the killing of the entire population of the city of Nishapur (about 60,000) in one hour.  The order came after her husband killing. (Moguls claim that 1.7 million were killed)","There are 35 million digestive glands in the stomach.","In 1800 only 50 cities on earth had a population of more than 100,000.","There are 336 dimples on a regulation golf ball","More steel in the US is used to make bottle caps than to manufacture automobile bodies.","It is possible for any American citizen to give whatever name he or she chooses to any unnamed mountain or hill in the United States.","King Henry III of France, Louis XVI of France and Napoleon all suffered from ailurophobia--fear of cats.","Before 1850 golf balls were made of leather and stuffed with feathers.","Clocks made before 1687 had only one hand, and hour hand.","More Americans have died in automobile accidents than have died in all the wars ever fought by the United States.","The principality of Monaco consists of 370 acres.","There are more than 40,000 characters in Chinese script.","During the time of Peter the Great, any Russian man who had a beard was required to pay a special tax.","The first couple to be shown in bed together on prime time television was Fred and Wilma Flintstone.","Coca-Cola was originally green.","Every day more money is printed for Monopoly than the U.S. treasury.","Men can read smaller print than women; women can hear better.","The amount American Airlines saved in 1987 by eliminating one olive from each salad served in first class: $40,000.","City with the most Rolls Royces per capita: Hong Kong.","State with the highest percentage of people who walk to work: Alaska.","Percentage of Africa that is wilderness--28%. Percentage of North America that is wilderness--38%.","Average number of days a German goes without washing his underwear: 7.","Percentage of American men who say they would marry the same woman if they had it to do all over again: 80%.","Percentage of American women who say they'd marry the same man: 50%.","Cost of raising a medium size dog to the age of 11: $6,400.","Average people airborne over the US any given hour: 61,000.","Average lifespan of a major league baseball: 7 pitches.","The only President to win a Pulitzer Prize: John Kennedy for 'Profiles in Courage.'","The youngest Pope was 11 years old.","Iceland consumes more Coca-Cola per capita than any other nation.","First novel ever written on a typewriter: 'Tom Sawyer.'","Each king in a deck of playing cards represents a great king from history. Spades--King David, Clubs--Alexander the Great, Hearts--Charlemagne and Diamonds--Julius Caesar.","If a statue in the park of a person on a horse has both front legs in the air, the person died in battle; if the horse has one leg front leg in the air, the person died as a result of wounds received in battle.  George Washington statues have one leg in the air, for example.  If the horse has all 4 legs on the ground, the person died of natural causes.","Only two people signed the Declaration of Independence on July 4th. The last signature wasn't added until 5 years later.","The cruise liner, Queen Elizabeth 2, QE2, moves only six inches for each gallon of diesel that it burns.","The highest point in Pennsylvania is lower than the lowest point in Colorado.","The first airline, DELAG, was established on October 16, 1909, to carry passengers between German cities by Zeppelin airships. Up to November 1913, more than 34,000 people had used the service.","Titanic was running at 22 knots when she hit the iceberg","The citrus soda 7-UP was created in 1929; '7' was selected because the original containers were 7 ounces. 'UP' indicated the direction of the bubbles","Francis Scott Key was a young lawyer who wrote the poem, 'The Star Spangled Banner', after being inspired by watching the Americans fight off the British attack of Baltimore during the War of 1812. The poem became the words to the national anthem","Because radio waves travel at 186,000 miles per second and sound waves saunter at 700 miles per hour, a broadcast voice can be heard sooner 13,000 miles away than it can be heard at the back of the room in which it originated","Mosquito repellents don't repel. They hide you. The spray blocks the mosquito's sensors so they don't know your there","The bagpipe was originally made from the whole skin of a dead sheep","Inventor Samuel Colt patented his revolver in 1836.","It has been recommended by dentists that a toothbrush be kept at least 6 feet (two meters) away from a toilet to avoid airborne particles resulting from the flush!","In ancient Rome it was considered a sign of leadership to be born with a crooked nose","It is possible to drown and not die. Technically the term 'drowning' refers to the process of taking water into the lungs, not to death caused by that process.","The first known heart medicine was discovered in an English garden. In 1799, physician John Ferriar noted the effect of dried leaves of the common foxglove plant, digitalis purpurea, on heart action. Still used in heart medications, digitalis slows the pulse and increases the force of heart contractions and the amount of b lood pumped per heartbeat.","Dry cereal for breakfast was invented by John Henry Kellogg at the turn of the century","During World War II, a German U-boat was sunk by a truck. The U-boat in question attacked a convoy in the Atlantic and then rose to see the effect. The merchant ship it sank had material strapped to its deck including a fleet of trucks, one of which was thrown in the air by the explosion, landing on the U-boat and breaking its back","Jeremy Bentham, a British philosopher who died in 1832,left his entire estate to the London Hospital provided that his body be allowed to preside over its board meetings. His skeleton was clothed and fitted with a wax mask of his face. It was present at the meeting for 92 years.","Diet Coke was only invented in 1982.","Methane gas can often be seen bubbling up from the bottom of ponds. It is produced by the decomposition of dead plants and animals in the mud.","There are more than 1,700 references to gems and precious stones in the King James translation of the Bible.","The E. Coli bacterium propels itself with a 'motor' only one-millionth of an inch in diameter, a thousand times smaller than the tiniest motors built to date by man. The rotation of the bacterial motor comes from a current of protons. The efficiency of the motor approaches 100 per cent.","Henry Ford produced the model T mostly in black because the black paint available at the time was the fastest to dry. Model T was available in other colors.  The British factory for model T started producing them in Green as mentioned by the British Show QI.","At - 40 degrees Centigrade a person loses about 14.4 calories per hour by breathing.","Pet superstores now sell about 40 percent of all pet food","One million Americans, about 3,000 each day, take up smoking each year. Most of them are children.","In 1933, Mickey Mouse, an animated cartoon character, received 800,000 fan letters.","There are only four words in the English language which end in '-dous': tremendous, horrendous, stupendous, and hazardous","If you attempted to count to stars in a galaxy at a rate of one every second it would take around 3,000 years to count them all.","Less than 3% of Nestl?'s sales are for chocolate.","The average person will spend two weeks over their lifetime waiting for the traffic light to change","More than 2500 left handed people are killed every year from using right handed products","It is estimated that at any one time, 0.7% of the world's population are drunk","The tip of a 1/3 inch long hour-hand on a wristwatch travels at 0.00000275 mph","Less than one per cent of the 500 Chinese cities have clean air, respiratory disease is China's leading cause of death.","The number of cars on the planet is increasing three times faster than the population growth","The X's that people sometimes put at the end of letters or notes to mean a kiss, actually started back in the 1000's when Lords would sign their names at the end of documents to other important people. It was originally a cross that they would kiss after signing to signify that they were faithful to God and their King. Over the years though, it slanted into the X","Nova Scotia is Latin for 'New Scotland.'","The collecting of Beer mats is called Tegestology.","Even though it is widely attributed to him Shakespeare never actually used the word 'gadzooks'.","Only 2 blue moons (the saying 'only once in a blue moon ' refers to the occurrence of two full moons during one calendar month) are to occur between now and 2001. Those times are January 1999 and March 1999","\"Naked\" means to be unprotected. \"Nude\" means unclothed","Upper and lower case letters are named 'upper' and 'lower', because in the time when al original print had to be set in individual letters, the 'upper case'  letters were stored in the case on top of the case stored smaller, 'lower case' letters");  
  685.                             $rnd; {$rnd = $facts[array_rand($facts)];}while($this->censor($rnd));
  686.                             $this->sendMessage($facts[array_rand($facts)]);
  687.                             unset($facts);
  688.                         break;
  689.                         case '!kick':
  690.                             if(!$this->isAllowed($this->packet['m']['u'])) {$this->sendMessage("You are not allowed to kick!"); return;}
  691.                             $word = explode(' ',$info[1].' ',2);
  692.                             $this->kick("$word[1]", "$word[0]",false);
  693.                         break;
  694.                         case '!ban':
  695.                             if(!$this->isAllowed($this->packet['m']['u'])) {$this->sendMessage("You are not allowed to ban!"); return;}
  696.                             $word = explode(' ',$info[1].' ',2);
  697.                             $this->ban("$word[1]", "$word[0]", $word[1]);
  698.                         break;
  699.                         case '!uban':
  700.                         case '!unban':
  701.                             if(!$this->isAllowed($this->packet['m']['u'])) {$this->sendMessage("You are not allowed to unban!"); return;}
  702.                             $word = explode(' ',$info[1].' ');
  703.                             $this->unban($word[0]);
  704.                         break;
  705.                         case '!ud':
  706.                         case '!define':
  707.                         case '!urbandictionary':
  708.                             if(!$this->isAllowed($this->packet['m']['u'],2)) {$this->sendMessage("You are not allowed to use Urban Dictionary search!"); return;}
  709.                             if($this->censor($info[1])) {$this->sendMessage("No!"); return;}
  710.                             if(trim($info[1])!='') {
  711.                                 $res = $this->get('http://www.urbandictionary.com/define.php?term='.str_replace(' ','+',$info[1]));
  712.                                 if(!($this->inStr('og:description',$res))) $this->sendMessage("There is no defintion");
  713.                                 else {
  714.                                     $resp = $this->getBetween($res, '<meta content=\'','\'');
  715.                                     if(trim($resp)=='') {$this->sendMessage("No Definition found."); return;}
  716.                                     $this->sendMessage($resp);
  717.                                     if($this->inStr('...',$resp)) $this->sendMessage('http://www.urbandictionary.com/define.php?term='.str_replace(' ','+',$info[1]));    
  718.                                 }
  719.                             }
  720.                         break;
  721.                         case '!g':
  722.                                                 case '!maingoogle':
  723.                         case '!google':
  724.                             if(!$this->isAllowed($this->packet['m']['u'],2)) {$this->sendMessage("You are not allowed to use google!"); return;}
  725.                             $res = $this->get('http://www.google.com/search?hl=en&source=hp&biw=&bih=&q='.str_replace(' ','+',$info[1]).'&btnG=Google+Search',true);
  726.                            
  727.                             for($i=0;$i<3;$i++) {
  728.                                 $msg=$this->getBetween($res, '<h3 class="r"><a href="', '"');
  729.                                 $res = str_replace('<h3 class="r"><a href="'.$msg,'',$res);
  730.                                
  731.                                 if(strtolower($info[0])=='!maingoogle')$this->sendMessage($msg);
  732.                                 else $this->sendPrivateMessage($msg, $this->parseU($this->packet['m']['u']));
  733.                                 sleep(1);
  734.                             }
  735.                         break;
  736.                             case '!rules':
  737.                             $this->sendMessage('The usual',$data['id']);
  738.                         break;
  739.                                                  break;
  740.                         case '!addcmd':
  741.                            if(!$this->isAllowed($this->packet['m']['u'],3)) return;
  742.                            $words = explode(' ',trim($info[1]).' ',2);
  743.                            if(!isset($words[1])||empty($words[1])||trim($words[1])=='') $this->sendMessage("Cannot add a blank message.");
  744.                            else {
  745.                                 $this->commands[strtolower($words[0])] = $words[1];
  746.                                 $this->sendMessage("Added!");
  747.                            }
  748.                            $this->save();
  749.                         break;
  750.                         case '!removecmd':
  751.                            if(!$this->isAllowed($this->packet['m']['u'],3)) return;
  752.                            if(!array_key_exists(strtolower($info[1]),$this->commands)) return;
  753.                            unset($this->commands[strtolower($info[1])]);
  754.                            $words = explode(' ',trim($info[1]).' ',2);
  755.                            $this->sendMessage("Removed!");
  756.                            $this->save();
  757.                         break;
  758.                                                 case '!name':
  759.                         $this->sendMessage('Changing name!',$data['id']);
  760.                                                 $this->botName = ($info[1]);
  761.                                                 $this->connect("174.36.242.26","10024");
  762.                                                 $this->join($this->roomID);
  763.                                                 while($this->read()!="DIED");
  764.                                                 break;
  765.                                                 case '!minrank':
  766.                                                 case '!rank':
  767.                         $this->sendMessage('Changing minimum rank to use bot!',$data['id']);
  768.                                                 $this->minRank = ($info[1]);
  769.                                                 $this->connect("174.36.242.26","10024");
  770.                                                 $this->join($this->roomID);
  771.                                                 while($this->read()!="DIED");
  772.                                                 break;
  773.                                                 case '!maxkicks':
  774.                         $this->sendMessage('Changing maximum kicks before ban',$data['id']);
  775.                                                 $this->maxKicks = ($info[1]);
  776.                                                 $this->connect("174.36.242.26","10024");
  777.                                                 $this->join($this->roomID);
  778.                                                 while($this->read()!="DIED");
  779.                                                 break;
  780.                         case '!autokick':
  781.                         if(!$this->botOwner($this->packet['m']['u'],2)) {$this->sendMessage("You're not allowed to use this!"); return;}
  782.                         $this->sendMessage('Autokicking designated user!',$data['id']);
  783.                             $word = explode(' ',$info[1].' ');
  784.                             $this->autokick[] = $word[0];
  785.                             $this->kick("", "$word[0]",true);
  786.                             $this->save();
  787.                         break;
  788.                         case '!endautokick':
  789.                         $this->sendMessage('Removing autokick!',$data['id']);
  790.                             $word = explode(' ',$info[1].' ');
  791.                             $index = array_search($word[0],$this->autokick, false);
  792.                             if($index===false) {$this->sendMessage("Not found :S");return;}
  793.                             $newArr = array();
  794.                             for($i=0;$i<count($this->autokick);$i++) {
  795.                                 if($i!=$index) $newArr[] = $this->autokick[$i];
  796.                             }
  797.                             $this->autokick = $newArr;
  798.                             $this->sendMessage("Removed.");
  799.                             $this->save();
  800.                         break;
  801.                                                 case '!autowelcome':
  802.                         $this->sendMessage('Changing Welcome Message!',$data['id']);
  803.                                                 $this->autowelcome = ($info[1]);
  804.                                                 $this->connect("174.36.242.26","10024");
  805.                                                 $this->join($this->roomID);
  806.                                                 while($this->read()!="DIED");
  807.                                                 break;
  808.                                                 case '!avatar':
  809.                         $this->sendMessage('Changing avatar!',$data['id']);
  810.                                                 $this->avatar = ($info[1]);
  811.                                                 $this->connect("174.36.242.26","10024");
  812.                                                 $this->join($this->roomID);
  813.                                                 while($this->read()!="DIED");
  814.                                                 break;
  815.             case '!restart':
  816.                         case '!refresh':
  817.                                                 $this->sendMessage('Brb.',$data['id']);
  818.                                                 socket_close($this->soc);
  819.                                                 $this->join($this->roomID);
  820.                                                     break;
  821.                                                         case '!accessadd':
  822.                                                 case '!add' :
  823.                             if(!$this->isAllowed($this->packet['m']['u'])) {$this->sendMessage("you arn't allowed to add trusted users, Probably because you arn't one yourself"); return;}
  824.                             $words = explode(' ',$info[1]);
  825.                             if($words[0]!="-1") {
  826.                                 if(!is_numeric(trim($words[0]))&&!empty($words[0])) {
  827.                                     $word = explode(' ',strtolower($words[0]).' ');
  828.                                     $user = $word[0];
  829.                                     if(!in_array($user,$this->access)) {
  830.                                         $this->access[] = $user;
  831.                                         $this->sendMessage("Added $user!");
  832.                                     }else $this->sendMessage("$user is already in the list.");
  833.                                 } else {
  834.                                    $this->sendPrivateMessage("Please Use Usernames Instead Of iD _#'s.");    
  835.                                 }
  836.                             }
  837.                             $this->save();
  838.                         break;
  839.                                                 case '!acessdel' :
  840.                                                 case '!del' :
  841.                         if(!$this->isAllowed($this->packet['m']['u'])) {$this->sendprivatemessage("you arn't allowed to delete trusted users, Probably because you arn't one yourself"); return;}
  842.                             $words = explode(' ',$info[1]);
  843.                             if($words[0]!="-1") {
  844.                                 if(!is_numeric(trim($words[0]))&&!empty($words[0])) {
  845.                                     $word = explode(' ',strtolower($words[0]).' ');
  846.                                     $user = $word[0];
  847.                                     if(!in_array($user,$this->remove)) {
  848.                                         $this->access[] = $user;
  849.                                         $this->sendMessage("Deleted. $user!");
  850.                                     }else $this->sendMessage("$user is not on the access list.");
  851.                                 } else {
  852.                                    $this->sendMessage("Please use the function !Add username(example !Add whyyoumadbro)) instead of !Add user ID (example !Add 42)");    
  853.                                 }
  854.                             }
  855.                             $this->save();
  856.                         break;                 
  857.                         case '!listadded':
  858.                         case '!listallowed':
  859.                                                 case '!access':
  860.                              if(!$this->isAllowed($this->packet['m']['u'])) {$this->sendMessage("You don't have access to the access list."); return;}
  861.                              $output = "";
  862.                              foreach($this->access as $a)
  863.                                 $output.=" $a,";
  864.                              $this->sendPrivateMessage(rtrim($output,','),$this->parseU($this->packet['m']['u']));
  865.                         break;
  866.                         case '!remove':
  867.                                                 case '!del' :
  868.                                                 Case 'accessdel' :
  869.                          if(!$this->isAllowed($this->packet['m']['u'])) {$this->sendMessage("You don't have access to the access list, this includes removing users."); return;}
  870.                          $word = explode(' ',strtolower($info[1]).' ');
  871.                          if($this->removeAccess($this->users[$this->parseU($this->packet['m']['u'])]['regName'],$word[0])) $this->sendMessage("$word[0] removed!");
  872.                          $this->save();
  873.                         break;
  874.                         case '!yt':
  875.                                                 case '!mainyoutube':
  876.                         case '!youtube':
  877.                             if(!$this->isAllowed($this->packet['m']['u'],2)) {$this->sendMessage("You CANT USE THIS.!"); return;}
  878.                             $res = $this->get('http://www.youtube.com/results?search_query='.urlencode(preg_replace("/[^A-Za-z0-9 !.,:[]\s\s+]/",'',$info[1])));
  879.                             for($i=0;$i<3;$i++) {
  880.                                 $msg=$this->getBetween($res, '<h3>', '</h3>');
  881.                                 $res = str_replace('<h3>'.$msg,'</h3>',$res);
  882.                                 $url = "http://www.youtube.com".$this->getBetween($msg,'href="', '"');
  883.                                 $title = ereg_replace('[^A-Za-z0-9 -()[]<>{}&@]','',$this->getBetween($msg,'title="', '"'));
  884.                                                                 if(strtolower($info[0])=='!mainyoutube')$this->sendMessage($title." - $url");
  885.                                 else $this->sendPrivateMessage($title." - $url", $this->parseU($this->packet['m']['u']));
  886.                                 sleep(1);
  887.                             }
  888.                         break;
  889.                         case '!avatar':
  890.                                                 case '!stealavvy':
  891.                             $user = $this->getUserArray($command[1]);
  892.                         $this->sendMessage(str_replace('(','( ',$user['avatar']));
  893.                         break;
  894.                         case '!listadded':
  895.                         case '!listallowed':
  896.                                                 case '!showallowed':
  897.                              if(!$this->isAllowed($this->packet['m']['u'])) {$this->sendMessage("You are not allowed to view that information!"); return;}
  898.                              $output = "";
  899.                              foreach($this->allowAccess as $a)
  900.                                 $output.=" $a,";
  901.                              $this->sendPrivateMessage(rtrim($output,','),$this->parseU($this->packet['m']['u']));
  902.                         break;
  903.                         case '!commands':
  904.                             $this->sendMessage("http://pastie.org/2524534");
  905.                                                         break;
  906.                         case '!ranks':
  907.                                                 $this->sendMessage("Trusted: 6 | Main: 5 | Owner: 3 | Mod: 2 | Member 1: | Guest: 0");
  908.                                                         break;
  909.                         case '!togglelanguage':
  910.                                                 case '!filter':
  911.                                                 case '!censor':
  912.                             if(!$this->isAllowed($this->packet['m']['u'])) {$this->sendMessage("You are not allowed to toggle the language filter!"); return;}
  913.                             $this->filterWords = !$this->filterWords;
  914.                             if($this->filterWords) $this->sendMessage("Censor is on, Be behaved!");
  915.                             else $this->sendMessage("Censor is off, Feel free to chill out.");
  916.                             $this->save();
  917.                                             break;
  918.                                                 case '!memory':
  919.                                 $this->sendPrivateChat("REAL:".memory_get_usage(true)."  Alloc:".memory_get_usage(false),$this->packet['p']['u']);
  920.                             break;
  921.                             case '!group':
  922.                                 if(!$this->isAllowed($this->packet['p']['u'],6)) {$this->sendPrivateChat("No!",$this->packet['p']['u']); return;}
  923.                                 $possibilities = explode(' ',$this->packet['w']['v']);
  924.                                 if(!in_array($info[1],$possibilities)){$this->sendPrivateChat("Not a valid group.",$this->packet['p']['u']); return;}
  925.                                 if(trim($info[1])==$possibilities[0]){$this->sendPrivateChat("Already here.",$this->packet['p']['u']); return;}
  926.                                 $this->send('<w'.trim($info[1]).' />');
  927.                                 $this->sendPrivateChat("Moved :)",$this->packet['p']['u']);
  928.                                 $this->save();
  929.                                                         break;
  930.                             case '!login':
  931.                                 $name = strtolower($this->users[$this->packet['p']['u']]['268283600']);
  932.                                 if($name == $this->access[0]||$name==$this->access[1]) {
  933.                                     //$words = explode(' ',trim($info[1]).' ');
  934.                                     if(!$this->inStr(' : ',$info[1])) {$this->sendPrivateChat("Please use the form !user registered_name : passowrd ... note the ' : ' seperating the username and password.(spaces ARE necessary)", $this->packet['p']['u']); return;}
  935.                                     $user = explode(' : ',$info[1]);
  936.                                     $this->regName = $user[0];
  937.                                     $this->regPassword = $user[1];  
  938.                                     $this->sendPrivateChat("New user: $this->regName New Pass: $this->regPassword", $this->packet['p']['u']);
  939.                                     $this->save();
  940.                             $this->connect("174.36.242.26","10024");
  941.                             $this->join($roomID);
  942.                             $this->save();
  943.                                 } else {
  944.                                     $this->sendPrivateChat("only my master can decide which account i use!", $this->packet['p']['u']);    
  945.                                 }
  946.                                 $this->save();
  947.                             break;
  948.                             case '!kill':
  949.                                                         case '!die':
  950.                                 $name = strtolower($this->users[$this->packet['p']['u']]['268283600']);
  951.                                                                 if($name == $this->access[0]||$name==$this->access[1]) {
  952.                                 $this->save();
  953.                                 $this->write2file('stop.'.$this->botID,'stop');
  954.                                 die("!kill command");
  955.                                 } else {
  956.                                     $this->sendPrivateChat("only my master can decide to shut me off.",$this->packet['p']['u']);
  957.                                     $this->sendPrivateChat("Why would you want to turn me off? am i annoying you? :(",$this->packet['p']['u']);
  958.                                 }
  959.                             break;
  960.                                                 case '!ping':
  961.                             $this->sendMessage("pong!");
  962.                         break;
  963.                                                 case '!pong':
  964.                            $this->kick("Kicked by (".$this->packet['m']['u'].")$word[1]", "$word[0]",true);
  965.                                                         break;
  966.                         case '!spamfilter': // <MSG> <TIME>
  967.                                                 case '!spam':
  968.                                                 case '!sfilter':
  969.                             if(!$this->isAllowed($this->packet['m']['u'])) {$this->sendMessage("You don't have access to my spam filter."); return;}
  970.                             $word = explode(' ',$info[1].' ');
  971.                             if(is_numeric($word[0]) && is_numeric($word[1]) && !empty($word[1])) {
  972.                                  $this->spam['time'] = $word[1];
  973.                                  $this->spam['limit'] = $word[0];
  974.                                  $this->sendMessage("spam filter has been set to ".$this->spam['limit']." messages every ".$this->spam['time']." seconds");
  975.                                  $this->sendMessage("if anybody passes this limit, They will be kicked resulting in a ban depending on the maximum kicks.");                                                             
  976.                             }
  977.                             $this->save();
  978.                         break;
  979.                                                          break;
  980.                         case '!credits':
  981.                             $this->sendMessage("By Damian! (cool)");
  982.                         break;
  983.                         case '!guestme':
  984.                             $this->guest($data['id']);
  985.                         break;
  986.                         case '!memberme':
  987.                             $this->member($data['id']);
  988.                         break;
  989.                         case '!modme':
  990.                         if(($data['id'])==$botowner)
  991.                               $this->mod($data['id']);
  992.      else
  993.                 $this->sendMessage("Yeah, right. (SMIRK)",$data['id']);
  994.                        break;
  995.                        case '!moderatorme':
  996.                             if(($data['id'])==$botowner)
  997.  
  998.                             $this->mod($data['id']);
  999.  
  1000.     else
  1001.  
  1002.           $this->sendMessage("Yeah, right. (SMIRK)",$data['id']);
  1003.                         break;
  1004.                         case '!ownerme':
  1005.  
  1006.                         if(($data['id'])==$botowner)
  1007.  
  1008.                          $this->owner($data['id']);
  1009.  
  1010.                else
  1011.  
  1012.         $this->sendMessage("You gotta be kidding me! (xD)",$data['id']);
  1013.                         break;
  1014.                         case '!mainownerme':
  1015.  
  1016.                        $this->sendMessage("What on Earth are you smoking? (O_O)",$data['id']);
  1017.                        break;
  1018.                        case '!kickme':
  1019.                         $this->kick("You asked for it...",$data['id']);
  1020.                        break;
  1021.                        case '!banme':
  1022.                             $this->ban("You asked for it...",$data['id'],$command[1]);
  1023.                       break;
  1024.                       case '!protect':
  1025.                         if(($data['id'])==$botowner)
  1026.                         $this->sendMessage("/p");
  1027.                        break;
  1028.  
  1029.  
  1030.                         case '!madgab':
  1031.                             $word = explode(' ',strtolower($info[1]).' ');
  1032.                             switch($word[0]) {
  1033.                                 case 'info':
  1034.                                     $this->sendMessage('Madgab is a party game during which participants are given a series of words that make little sense, but when spoken aloud and quickly sound like an actual phrase.Ex.\'These If Hill Wore\' sounds like \'The Civil War\' ');
  1035.                                    
  1036.                                 break;
  1037.                                 case 'start':
  1038.                                     if(!$this->gamesAllowed) {$this->sendMessage("Sorry, games are not allowed in here. :(");return;}
  1039.                                     if($this->gameRunning!==false)  {$this->sendMessage("A game is already running...($this->gameRunning)"); return;}
  1040.                                    
  1041.                                     $this->gameRunning = 'madgab';
  1042.                                     $gabs = array(array("abe ease seize supports","abc sports"),array("abe odd hull luck oak","a bottle of coke"),array("abe you team arc","a beauty mark"),array("ace lip puff that hung","a slip of the tongue"),array("ace tray taste who dent","a straight a student"),array("aid are crank loud","a dark rain cloud"),array("aid hay huff ache asian","a day of vacation"),array("aid ride hyper","a dry diaper"),array("ale of huff air","a love affair"),array("amos ooze","a masseusse"),array("annex tin chunk hoard","an extension cord"),array("annie leg ditto fish hull","an elected official"),array("ape arrows uncle as his","a pair of sunglasses"),array("ask rude arrive her","a screwdriver"),array("bat tree snot ink looted","batteries not included"),array("bay beak hot bach","baby got back"),array("bowl egg head","bow legged"),array("canoe key pace he grit","can you keep a secret?"),array("canoe key pass egret","can you keep a secret?"),array("chick he tub an an us","chiquita bananas"),array("cohen peas","go in peace"),array("cry cub hook","crack a book"),array("date roy pea stuns","detroit pistons"),array("dawn dude rugs","don't do drugs"),array("day leofur rings","daily offerings"),array("deep rinse soft ides","the prince of tides"),array("delete elmer made","the little mermaid"),array("dew wino hue","do i know you?"),array("dew ache who gulls urge","do a google search"),array("dish hippie slaw stats he","the ship is lost at sea"),array("dock door rat kin sty hit","dr. atkins diet"),array("double use he fee yields","w.c. fields"),array("duet tomb he juan mort i'm","do it to me one more time"),array("ease owner whole","he's on a roll"),array("egg aim much egg curse","a game of checkers"),array("eight he muff forces","a team of horses"),array("eight weeds hoot","a tweed suit"),array("europe art tough fit","you're a part of it"),array("europe lay sore mine?","your place or mine?"),array("europe ray tear owe","you're a prayer away"),array("eye mad alas","i met a lass"),array("eye mull of mush sheen","i'm a love machine"),array("eye needle ax eight if","i need a laxative"),array("fee limber raven huff toot rye","feel i'm brave enough to try"),array("feet verb list her","fever blister"),array("freeze age ha! leak hood fell owe","for he's a jolly good fellow"),array("fur chin ollie foil","virgin olive oil"),array("grey ties hats course","greatest scores"),array("hiawatha dean edge van pyre","i was a teenage vampire"),array("hide hen tickled wins","identical twins"),array("high hose hill fray weigh","hi ho silver, away!"),array("hint a few width diva umpire","interview with a vampire"),array("hit sewn leap uphill of","it's only puppy love"),array("hit spin could form he","it's been good for me"),array("hit stop add","it's too bad"),array("hive kotter bran nookie","i've got a brand new key"),array("hoe pin-up hits depot lease","open up! it's the police"),array("hype people earth duh hey","happy birthday"),array("ice mail ask hunk","i smell a skunk"),array("ike otcha","i gotcha"),array("isle of view","i love you"),array("it chief heat","itchy feet"),array("jeffgay","jfk"),array("jog clay die scream","chocolate ice cream"),array("kitten scene gulf aisle","get in single file"),array("know ozark","noah's ark"),array("koala deep rod ducks","quality products"),array("ladle rat rotten hut","little red riding hood"),array("law duff there inks","lord of the rings"),array("lie turf lou hid","lighter fluid"),array("lit tell it all lee","little italy"),array("loaf meat hender","love me tender"),array("mare eek ate danish lee hole sin","mary-kate and ashley olsen"),array("mayor itch maiden evan","marriage made in heaven"),array("mine her infer auction","minor infraction"),array("moe's art","mozart"),array("mower thin nuke inch who","more than you can chew"),array("my kojak sun","michael jackson"),array("nose hole is sitting","no soliciting"),array("noose raid he owe","news radio"),array("ooze kid sing sand tough claws","who's kissing santa claus"),array("pe psim aks","pepsi max"),array("pea sank white","peace and quiet"),array("pie rate softy care hip been","pirates of the carribean"),array("pier steers","pierced ears"),array("plea stake arrow fit","please take her off it"),array("rib uncut inks harem owe knee","ribbon cutting ceremony"),array("rim him birth owl limo","remember the alamo"),array("sand tack laws","santa claus"),array("sex yule hair is mint","sexual harrasment"),array("space you'll limp picks","special olympics"),array("these if hill wore","the civil war"),array("thesis pine alt hap","this is spinal tap"),array("thick awe loved hoot he","the call of duty"),array("thick hull foam heck sicko","the gulf of mexico"),array("thigh sing gone thick ache","the icing on the cake"),array("tis coal eighty","disco lady"),array("up hair hush ooze","a pair of shoes"),array("up he such ease","a piece of cheese"),array("up hound hug round round","a pound of ground round"),array("uppers enough heist hand herds","a person of high standards"),array("us her fair","a surveyor"),array("watch choo ear nut washer tse","what you hear not what you say"),array("weaker tool hater","week or two later"),array("we shy worth hare","wish i was there"),array("weeg lib his neigh sours","weekly business hours"),array("went hurl hymn pick aims","winter olympic games"),array("wheel yum air ream he","will you marry me"),array("whole league how","holy cow"),array("wide own twig hose women","why don't we go swimming"),array("will saw rim ocean","wheels are in motion"),array("william harem he","will you marry me"),array("wine grit ski","wayne gretzky"),array("wok lie canny chip shun","walk like an egyptian"),array("woodchuck air ford us hurt","would you care for dessert?"),array("yell hope hey jess","yellow pages"),array("yore luke ink hood","you're looking good"));
  1043.                                     $this->gameVar['madgab'] = $gabs[array_rand($gabs)];
  1044.                                     $this->gameVar['madgab'][1] = @ereg_replace('[^A-Za-z ]','',$this->gameVar['madgab'][1]);
  1045.                                     unset($gabs);
  1046.                                     $this->sendMessage("Current Madgab: ".$this->gameVar['madgab'][0]);sleep(1);
  1047.                                     $this->sendMessage("To answer use '!madgab YOUR ANSWER' or '!madgab end' to give up.");
  1048.                                 break;
  1049.                                 case 'help':
  1050.                                     $this->sendMessage("To start game use '!madgab start' To end say '!madgab end' To anser say '!madgab YOUR GUESS'. Don't know what madgab is '!madgab info'");
  1051.                                 break;
  1052.                                 case 'end':
  1053.                                     if($this->gameRunning!='madgab')  {$this->sendMessage("Madgab is not currently running."); return;}
  1054.                                     $this->sendMessage("The answer to '".$this->gameVar['madgab'][0]."' was '".$this->gameVar['madgab'][1]."'");
  1055.                                     unset($this->gameVar) ;
  1056.                                     $this->gameRunning = false;
  1057.                                 break;
  1058.                                 default:
  1059.                                     if($this->gameRunning!='madgab') {
  1060.                                         $this->sendMessage("There is no game running of madgab running. Use '!madgab start' to begin a game");  
  1061.                                     } else {
  1062.                                          $guess = trim(strtolower(@ereg_replace('[^A-Za-z ]','',$info[1])));
  1063.                                          if($guess==trim($this->gameVar['madgab'][1])) {
  1064.                                             $this->sendMessage("Congratulations ".$this->users[$this->parseU($this->packet['m']['u'])]['name']." '$guess' is the correct answer.(clap)");
  1065.                                             unset($this->gameVar) ;
  1066.                                             $this->gameRunning = false;
  1067.                                          } else {
  1068.                                             $this->sendMessage("Sorry '$guess' is an incorrect answer for '".$this->gameVar['madgab'][0]."'.");
  1069.                                          }
  1070.                                     }
  1071.                                
  1072.                             }
  1073.                         break;
  1074.                        
  1075.  
  1076.                         case '!h':
  1077.                                                 case '!hm':
  1078.                         case '!hangman':
  1079.                             $word = explode(' ',strtolower($info[1]).' ');
  1080.                             if(isset($this->gameVar['blocked'])&&in_array($this->parseU($this->packet['m']['u']),$this->gameVar['blocked'])&&$word[0]!='end') return;
  1081.                             switch($word[0]) {
  1082.                                 case 'start':
  1083.                                                                 case 'play':
  1084.                                     if(!$this->gamesAllowed) {$this->sendMessage("NO GAMES IN THIS ROOM! :("); return;}
  1085.                                     if($this->gameRunning!==false) { $this->sendMessage("Sorry, Game already in progress($this->gameRunning)");return;}
  1086.                                    
  1087.                                     $words = array("abruptly","affix","askew","axiom","azure","bagpipes","bandwagon","banjo","bayou","bikini","blitz","bookworm","boxcar","boxful","buckaroo","buffalo","buffoon","cobweb","croquet","daiquiri","disavow","duplex","dwarves","equip","exodus","fishhook","fixable","foxglove","galaxy","galvanize","gazebo","gizmo","glowworm","guffaw","haiku","haphazard","hyphen","icebox","injury","ivory","ivy","jaundice","jawbreaker","jaywalk","jazzy","jigsaw","jiujitsu","jockey","jovial","joyful","juicy","jumbo","kazoo","keyhole","khaki","kilobyte","kiosk","kiwifruit","knapsack","larynx","luxury","marquis","megahertz","microwave","mystify","nightclub","nowadays","numbskull","ovary","oxidize","oxygen","pajama","peekaboo","pixel","pizazz","pneumonia","polka","quartz","quiz","rhubarb","rickshaw","schizophrenia","sphinx","squawk","subway","swivel","topaz","unknown","unworthy","unzip","uptown","vaporize","vodka","vortex","walkway","waltz","wavy","waxy","wheezy","whiskey","whomever","wimpy","wizard","woozy","xylophone","yachtsman","yippee","youthful","zephyr","zigzag","zilch","zodiac","zombie","abases","abductor","aberration","abrogate","absolutes","absorbency","absurd","abused","acacia","accelerates","accessible","accident","accidentally","acclaimed","acclimate","acclimatisation","accomplishments","accosts","accredited","accrued","acquaints","acquiescent","acreages","acrobatic","acrostics","acrylic","adaptable","adaptations","addicted","admits","adorable","adrenal","adulation","adventurer","aerosol","affirmatively","affirmed","afternoons","afterwards","aggregating","agnostics","agonize","agreeing","airless","airworthy","allergic","alphabetize","alright","alternatively","amalgams","amateurish","ambassadors","amenities","amidst","ampoules","amusements","anachronistically","analgesic","analysed","analysing","analysis","analyst","anecdotal","anesthetizing","angered","angioplasties","anglicisms","angoras","annihilate","annihilates","antagonises","antedated","anticipating","anticlimactic","antirrhinums","apologized","apotheoses","appall","appertains","appetizers","appraisals","appreciations","apprehended","apprehending","apprehensive","approved","arabesque","arcade","archaeological","archetypical","arraying","arrives","arrogance","arterial","ascetics","ascribes","asphalted","aspirate","assassinating","assenting","assents","assessing","assuage","asunder","asylum","atelier","atheists","attacking","attesting","attributing","auburn","audibility","audiovisual","authorship","autographing","autographs","automated","autopilots","available","avenge","avenged","averagely","averting","aviary","avionics","awakened","awkward","awoken","bagging","bagpipe","baguettes","bandleader","bandstand","baptisms","barbie","barefooted","barney","barneys","barometers","baronets","bartering","battering","batterings","batting","battleaxe","battlefields","bauxite","bazaar","beagles","beautiful","bedroom","bedsitter","beefsteaks","befitted","behaviour","behooves","belabors","belaying","believable","bellboy","bemoans","benighted","bequest","beseechingly","bespoke","bested","betrays","betrothed","betwixt","bibliography","bibliophiles","biggie","billboard","binning","birdbrains","birthplace","blackened","blackest","blacksmiths","blamed","blancmanges","blanket","blared","bleaching","blotched","blowups","blunted","blunter","boaters","bobbins","boltholes","bombard","bonnier","bonuses","boogied","bookable","bookbinding","bookmark","booksellers","bookworms","boosts","bootlace","bottoms","bouffant","brainstorm","breakfast","breakups","breaststroke","brigades","brightly","brings","briskly","broadcaster","broadens","brouhaha","brutal","brutality","brutally","buffalo","buffoons","bugbear","bullied","bullring","buoyantly","bureaucratic","burglaries","burgundies","busied","buzzword","caddied","cajole","calories","campaigner","campaigners","camping","canapes","cancels","canonise","canoodling","canvas","captain","captives","caramelise","caravanning","cardamoms","careering","carnation","carnations","carpeted","carting","casually","categorizing","ceding","celebratory","cenotaphs","censures","centerpiece","centiliter","centimetre","chainsaws","challenges","chamomile","chances","chapels","characterizations","characters","charades","chaser","chattered","cheapen","chickening","chickweed","chicory","childish","chilly","chintz","chivalrous","chloroform","choirboy","choppier","choppy","chopsticks","choral","christen","chromosomes","chronological","chubbier","chummed","circled","circlets","circularize","circumlocution","circumnavigating","civvies","classicists","cleaners","cleansing","cleanup","clerks","climatologist","climax","climaxes","climber","clinked","clitorises","clogged","clothes","cloudiest","cloying","clubbed","clumsy","clutching","coarsest","coccyxes","coerces","coffee","cognisant","coinages","coincidentally","collaborate","collarbone","collectivizing","collector","colloquial","colonisers","colonnade","colored","colourways","comedienne","commences","commentate","commentating","commercial","commercialism","commercials","commissary","commissioning","commonest","communist","compare","compere","compete","competent","compilation","compiles","complexions","composed","computerised","computes","conceitedly","conceived","concerted","conchies","conclusively","concoctions","concreted","concreting","conducted","confederations","confession","congratulations","congressman","conical","conjectures","connect","connubial","conquering","consents","consoled","consolidations","consort","conspicuousness","constantly","container","contention","contentment","contestants","contextualised","contextualises","continuance","contradiction","contraindications","contribution","controversial","conversations","conviction","convulsing","coolie","cooped","coordinating","copula","copycats","copywriter","coracles","coreligionists","corncobs","corncrake","cornstarch","correspondent","corrie","corroborative","corrupted","cosmopolitans","cossetting","cottages","cottoning","couchettes","cougar","counteracts","countless","courageously","courtliness","courtyard","cracker","crackers","craning","cranky","cranny","creakily","creakiness","creators","credit","crescent","crewed","criminalizes","criminalizing","crispness","crocks","crossbones","crosschecks","croupiers","crowded","crucifying","cruder","crumpet","crumple","crystallisation","crystallising","cumming","curacies","curliness","currant","cursive","curtseyed","cutouts","cyclical","cylinders","cypher","daises","dammit","damnable","danced","dastardly","dawdling","deafened","dearests","debates","debenture","debriefs","debunked","decanted","decanter","deception","decimates","decisiveness","decriminalize","dedication","deductions","defeatist","defeatists","defecate","deferment","define","deflates","deformity","defraud","defrosters","defrosting","dehumanising","deigning","deletions","delineating","delved","demand","democratisation","demographer","demolished","demoniacal","denationalizes","denial","denigrating","densely","denseness","denude","deodorising","deodorizing","departmental","dependants","depopulate","depress","depressurizes","depute","deranged","derbies","deregulation","descents","desegregation","desolated","despises","destabilizes","destroying","detain","detained","determinants","detestable","detoured","diadem","dialectical","dialectics","diatonic","diciest","dicker","dictatorially","digests","dilute","dingoes","disagreeably","disagreeing","disagreements","discernible","disciplinarians","discoloring","discomfited","discoverers","discredit","discreetly","discrimination","disembodied","disequilibrium","disguised","disgust","disillusioning","disincentive","disinheriting","disinterested","dislodges","disobey","disobeyed","disoriented","dispatches","dispersed","disposal","disprove","disregard","disrupts","dissembled","dissociation","distaste","distend","distinctions","distributorships","disturbing","disunited","dividends","divines","dizzying","dodders","dogleg","doglegs","dogmatist","dolling","dominions","donating","dormers","dormitories","doubts","downers","downgrading","downstairs","dowsing","drachmae","draconian","draftier","drained","drainpipe","dropper","droppings","droughts","drugstore","drumming","duplication","earthed","earthquake","economised","educates","effacing","efficiently","elaborately","elderberries","elected","electrically","electrodes","electromagnets","elision","eloped","elucidate","elucidating","embassy","embezzling","emboss","emergence","emperor","emperors","emptied","enables","encampments","enchanted","enchilada","encircling","encumbering","endeavored","endemic","endocrine","endurance","energies","enervated","enfold","enfolds","engagement","engineering","engraves","enhancers","enlightened","enormously","ensconces","enshrouds","enslaves","ensnare","entirety","entrenchments","epicentre","epidermis","epiphany","epistolary","equivocal","equivocations","eradicates","eroded","errors","escape","esoteric","espies","espying","essaying","ethical","ethnologically","evacuated","evaluated","evaluation","evasion","evicting","evilly","evocations","evolves","exacerbated","exactness","excavations","exchanged","exclaiming","exclude","exclusionary","excoriate","excreting","excusing","exhortations","exigency","expectation","expects","experts","expiates","expiring","explored","explorers","expostulation","extends","exterminates","externalised","externalizes","extinct","extolling","extradites","extraterrestrial","eyeful","eyeing","eyeliner","facelift","facilitates","faffed","faintest","fairyland","faithlessly","falsifications","familiarize","fanatic","fanaticism","fandangos","fantasise","fanzines","farmhouses","fascists","fatigues","favored","favorite","favourite","fazing","featherbrained","feeblest","feeder","feelgood","feints","ferociousness","fibulae","fictionalisation","fictionalisations","fidgets","finales","finder","finders","finesses","firmer","fishermen","fishiest","fissures","fitment","fitters","fjords","flagellate","flagellation","flapjacks","flautists","flavouring","flicker","flightier","flosses","flotillas","flounce","flouncing","flunkeys","fluoridating","fodder","folders","footsteps","footstools","forays","forbearance","forewarns","forking","formalizing","formals","forsythias","fractals","frames","franchisee","fraternises","fraudulent","freakiest","freebooter","freighted","frenzy","freshening","fresher","fretting","frizzy","frontiersmen","frugally","frumpiest","fuelled","fulfilled","fulness","functionalists","funiculars","furnished","fusilier","futurists","futurity","gadgets","gallivanted","gallon","gambols","gamekeeper","gangsta","garcons","gardens","gasolene","gatecrashes","gaudily","gawking","generates","genial","genning","gentrification","germinating","ghettoizing","gimmick","glamor","glassful","glaziers","globalizing","globetrotters","gloves","glowering","gluttony","goatherd","godless","godmother","godson","goldfinch","golfing","gooiest","gooseberries","gooseflesh","gorgeous","grabby","gramophone","gramophones","grandads","granular","graphite","grapnel","grasses","graters","gratins","greats","greenfield","greenhouse","griddle","grouch","groundskeeper","groundskeepers","growls","guarantees","guesswork","gunnels","gynecologist","habitable","hacking","hairiest","hairline","handguns","handkerchiefs","handrails","hangdog","happens","happiest","harbor","harbour","harboured","hardwood","harlequins","harnesses","harpsichord","hashing","hastens","hatbox","hatter","haulage","haulier","hawkers","headache","headers","headhunt","headhunted","headmistress","health","heartaches","hearthrugs","hemorrhaging","hesitations","heuristic","hideous","hideout","hinted","hippos","hitched","hitches","hitchhikers","holidaymakers","homburg","homeopathic","homesteading","homeworker","homogenising","honchos","honeysuckle","hoodwink","horses","horticultural","hotplates","housemasters","housemistress","housewarmings","housewifely","hugging","humanises","humbug","hummock","humored","humpback","hunkering","hurricane","husbandry","hydrates","hyperventilated","iambic","idealistic","identikit","idolizes","ignitions","illuminate","illusory","imagining","imbued","immunizes","immure","imparted","impasse","impassivity","impersonated","implanting","implosions","importers","impound","impoverishment","improvement","impudence","impulsiveness","impure","inactivity","inamorata","incapacitate","incarnates","inclusions","incongruities","inconspicuously","increased","incremental","incubated","incurious","indebted","indemnities","indies","indoctrinate","indoctrinates","indubitably","inductees","industrialisation","inexpedient","inexpensively","inferior","infiltrator","informally","ingested","ingrowing","inhibited","inklings","inmate","innuendos","inoculation","inpatients","inputted","inquiring","inquisition","insipid","insisted","insisting","inspects","insteps","instigates","instills","insured","intellectualism","intense","interbreeding","interchangeable","interconnected","interesting","interfere","interlaced","intermediates","interned","interpreted","interwove","intestine","intrinsically","introspection","inventor","investitures","invigorating","ionosphere","ironmongery","irradiated","irreparably","irreproachable","issues","itemise","itemised","jackasses","jackhammers","jaguar","jammed","jangles","javelins","jazzing","jealously","jeopardising","jesting","jettisons","jewelers","journo","joylessness","jubilant","juntas","justices","keepsakes","kennels","kenning","keyboard","kingmaker","kinkiest","kinship","kneecaps","knocker","knockers","laborer","lacerate","lactic","lampreys","landholder","landscapes","larkspurs","laughably","launcher","laundry","laxest","layover","laziest","leaned","leaseback","leering","legible","legislates","legitimises","lessons","letting","levitated","liberal","liberalize","liberator","licences","lieutenant","likely","lionizing","lipstick","liquidized","listenable","livened","loafer","lollop","lovable","lucked","luggage","lugubrious","lugubriously","luncheonette","lychgate","mackerel","madams","maggot","magnets","magnolia","maidens","mainsails","majorette","majority","makeweights","malfunction","malfunctioned","mammogram","manacles","managed","manana","manipulating","manpower","mansards","margarine","marginalisation","marginalizing","marketeer","marking","maroon","marquesses","marshland","marten","martinis","masculinity","matricide","maximize","mayoral","maypoles","meandered","meanness","medicinal","melodrama","melodramatic","member","memoranda","mentors","mercilessly","merino","mescalin","mesmerizing","metabolise","metabolisms","meters","microwaveable","miffed","mileometer","mileometers","millipede","milometer","minarets","minestrone","miniaturises","mirages","miscarriages","misconstrued","miscreants","misdirected","miserly","misjudged","mislead","misogynistic","mispronounces","mistaking","mistress","misunderstanding","mobilise","mockingbirds","modeled","moderate","moderators","moisturizers","moisturizes","molecule","mollycoddle","mollycoddles","molten","monolith","monoplanes","monopolised","monotone","monotonous","monotonously","moonlit","moping","mordantly","morphs","mortice","motorists","mounds","mountaintop","mouthwash","mulberries","mulching","mullahs","multiplexes","multiplies","mundane","munificent","murders","murkier","musher","musicians","mussel","mustang","mustering","mutilating","mutilations","mutuality","mutually","nailing","narcoleptic","narration","national","nauseous","neater","necklace","neckties","needier","nefarious","negate","neglect","neighing","nepotism","neurologist","newspaperman","nimbler","nipple","nitrogen","nitwits","normalise","northbound","nutcrackers","nuttiest","nymphet","oarsmen","oarswoman","oatcakes","obedient","objectively","objects","obligation","obliging","obliteration","oblivious","observatories","obsessions","obstructions","occupying","offertories","offertory","officiating","officiousness","offload","offside","omelet","omission","ontology","opaquely","opener","operable","operations","oppression","oppressor","optimise","optimises","optimum","oratory","ordinariness","ordnance","organisation","organisms","organizing","orthodoxies","oscillators","otters","outbreaks","outcries","outmaneuver","outrages","outweighed","overacted","overbalances","overcomes","overeating","overestimated","overladen","overprotective","overreached","overreacted","overruling","overshadowed","oversleeps","overspends","overtake","overtaxes","overtaxing","overturn","overvaluation","overwriting","oxidation","oxidizes","padding","pageant","paginates","painters","paired","paleontologists","palpates","panhandler","panorama","pantechnicons","papayas","paracetamols","paramedical","paramedics","paranoids","paratrooper","pardoned","parishioners","parities","parody","partaken","partaking","participles","particularity","parting","partitioned","partridge","passivised","password","pasteurizing","patches","patching","patriots","patronesses","patronized","patters","pausing","payroll","payslips","peccadillos","peevishness","peewee","pellucid","penalise","penciled","perfectionists","performances","performer","permissions","personages","personifications","pervasively","peskiest","petrodollars","petticoat","pharmacopoeias","pheasant","phenom","philological","phlegm","photoelectric","photostatted","physical","physiognomies","physiology","physios","physiotherapists","piazza","pickaxe","pickiest","pickled","pickling","picnickers","piffling","pigpens","pimientos","pinholes","pinnies","pioneered","piousness","pirouetted","pirouetting","pitching","pitiless","plaintive","plantings","platitude","playthings","pleadingly","pledges","plummets","plumping","plundering","plunge","pockmark","pokier","polarized","policed","politic","politics","polity","pollster","polygamy","polyglot","polymaths","polysemous","poncho","poncing","ponied","poppets","portions","portrayals","poseur","posher","possessors","postboxes","posters","postmark","postseason","postulated","potent","powders","practiced","practices","pranksters","prattle","preaching","preambles","precedence","precepts","predestination","predictors","preferring","premenstrual","premise","prepacked","prerequisites","prescient","prescribed","presents","president","presidents","presumes","prettifies","prevaricate","prided","primes","princes","printout","prioritise","prisoners","prissier","privacy","prizewinning","problem","proclivity","procreating","produce","professionalize","profundity","progressing","progressions","prolific","prominently","promises","promising","prompters","pronounce","prophecy","proposers","propounded","proprietresses","prosecutions","prostrated","protesting","protrusions","proudest","proviso","pruning","pseudonym","psychoses","psychotherapist","psychotherapists","publication","publicises","puddles","pulpits","pulsing","pummeled","pumped","pumpkin","puppies","purchaser","purchasers","pursers","purveys","pusillanimous","puzzle","pyramid","pyromaniac","quadruples","qualms","quarreled","quashes","question","questioningly","quicken","quicksilver","quieten","quintet","quirkier","quizzical","quotient","qwerty","rabbited","racketeer","radiance","ramblings","ramshackle","rangefinders","rangers","raping","rarely","raspberry","ratchet","ratcheted","rationalises","ratting","reactionaries","realized","reasserts","rebelliousness","recant","recapitulation","recaps","recharged","recognized","reconciliation","reconvene","record","records","recriminatory","rectitude","recycling","redoes","redounding","redresses","referencing","reflections","reflexive","reflexology","refurbishes","refusals","regarding","regards","regents","regretful","rehearse","rehoused","reiterates","relapse","relaunching","relies","religions","reloaded","relocated","remarriages","remaster","rematch","reminding","remodelling","remolding","repenting","repetitively","replicate","repressing","reprint","reproached","reproves","reruns","rescues","resemble","reserve","resettles","resonated","resounds","respired","resplendence","restarting","restocked","restraints","resurfaces","retrenches","retrogression","retrospective","returnable","returning","reusable","reverential","reversals","reversibility","revisionist","revisions","revivalist","revolted","revolutions","revolving","rewires","rhinestone","rhymes","rickets","ricocheted","ridges","rigged","rightist","ringlet","robbed","rocketing","rocking","rococo","rolling","rostra","rostrum","rouses","rowdily","rubber","rubbers","ruinous","rumbles","rumination","rumpled","runways","rushing","saboteurs","sackful","sackings","sacrilegious","sacristy","salamander","salesclerks","salvoes","samosa","sampans","samples","sanctioning","sandbank","sandpit","sarcophagus","satisfactorily","satisfies","savageries","savages","saving","scales","scamper","scandalous","scapegoating","scarabs","scarpering","scenarios","schnook","scholarly","schoolmarmish","schoolyard","scolding","scorching","scratches","screwed","scribbling","scrimped","scrolls","scrounging","scruffiness","scruple","scudded","scuppered","seamier","searchers","secure","seesawing","segments","seizures","senators","sensor","sententious","sentimentalises","sequentially","series","sermonised","sermonize","serviced","setsquare","seventeenths","severally","shallots","shattering","shavers","sheathe","shebeens","sheepishness","shelling","shepherding","shibboleths","shinned","shipment","shipped","shippers","shortage","shortbread","shorthanded","shorty","showdowns","shrink","shrinking","shrubs","shutdowns","sickens","sidekick","signposting","silvan","simplifications","singed","singulars","sinister","sisterhood","skateboarder","skater","skewer","skimps","skyjack","skyrocketing","slagged","slammed","slappers","slaughter","slaughtering","slavery","sleepiness","slipways","slouches","slowdown","smacking","smiling","smoothness","smugly","smuttiest","snooper","snooty","snorkelling","snowmobile","snuffed","sociables","socials","sociologically","softback","softens","solicitors","sombrero","something","songster","songwriter","soothingly","sophomore","sorrowful","sorrows","spacewoman","spammed","spankings","spareribs","sparring","speedometer","sphincters","sphinx","spiciness","spindly","spinneys","splattered","spluttered","spookier","spotters","spouts","sprayers","spraying","springing","spurted","sputters","squirreled","stabbing","stablemen","staffers","stains","stairwell","stalled","stance","stanch","standardisation","starchiest","stares","starlings","starter","statesmen","staunching","staving","steamed","steeplejacks","stepchild","stereo","stereotypes","stickier","stickleback","stilted","stockbroking","straddles","stranglers","strategy","strictest","strives","strongmen","studious","stuffily","stumps","stunting","sturdiest","subcutaneously","subdue","subduing","subjectivity","subordination","substantially","substitutes","subtotals","subversively","suction","suctions","suffocation","suffrage","suggestible","sullied","sultana","sunblock","sundae","sundials","sunglasses","superconductor","supersedes","superstar","superstitious","superstructure","suppository","suppurated","sureness","surrounded","susceptibilities","suspecting","susses","suzerainty","swaddled","swamps","swearing","sweatbands","sweatpants","sweatsuits","sweetmeats","swiftly","swirling","switched","swivelled","swooning","sycophantic","symbolises","symposia","synchronizing","syndicalists","syphons","systematically","tableware","tackled","tackling","tactlessness","tadpole","tailcoat","tailpieces","tailpipe","takeaway","takings","tamoxifen","tangerines","tantalised","tantalize","tapirs","tappets","tardier","tarmac","tautens","taxicab","teachers","tearaways","teasel","teaspoon","teazle","technicalities","technicality","technologies","technologists","teemed","teepee","teetotal","tellies","temporising","tenaciously","tenants","tepees","termites","terrier","tester","testicular","testily","testimonial","theocratic","thicken","thickeners","thingummy","thistles","thrill","thrive","throatily","thronged","thunders","tickled","tickles","tidiest","tidying","tiebreak","tiebreaker","timeliest","timetables","timidly","tinder","tinkers","tinkling","tiresome","tissue","toadied","toastmaster","toboggan","tonier","toothy","topographically","topples","torpedo","torturers","toting","touchlines","traced","tracers","tracheas","trackball","trafficked","trainspotting","transcendental","transfixed","transience","transistor","transitives","translator","translators","transliterations","transmogrifies","transparent","trappings","traumatizes","trembles","trendsetter","triangular","triangulation","tribunals","trickle","tridents","trinkets","truces","truncheons","trunks","trussed","trying","tumbles","turbocharges","tussling","typing","umlaut","umpire","umpiring","unarguable","unattached","unbiased","unchanging","uncompromising","unconsidered","underachievement","undercharge","underdone","underestimating","undergone","undergrowth","underpass","underscoring","undersells","undersized","understate","underwater","undisciplined","undressed","unequaled","unfathomable","unfavourable","unforeseeable","unhitch","uniformity","unisex","unloads","unmolested","unpredictable","unprotected","unravel","unrelieved","unrelievedly","unremitting","unscramble","unscrambling","unscrewed","unsophisticated","unstructured","unsuitable","untangle","untutored","unwraps","upstairs","uselessly","ushered","usurpation","utilised","utilized","uttered","vacancy","vaccinating","vacuuming","vagueness","vandalised","vantage","vaporization","variant","vaulted","vegetarian","vegges","veggieburger","ventriloquist","verbalised","verbatim","versos","veterinary","vibrators","victims","videophones","videotape","videotapes","vigils","villainy","violincellos","virgin","viscera","visitation","vitiates","vocabulary","volumes","vouchsafe","wainscots","waiting","waltzed","wanderer","wanderers","wapiti","warped","warthog","waster","wastrels","waterfowl","waterproofing","wattle","waylays","weatherman","wedding","weedkiller","weekend","weevil","weighbridges","weirdest","welches","wellness","westernise","whales","wheelies","wheezy","wherewithal","whined","whiskies","whitewashed","wholesalers","wildcatter","wildest","winched","wisterias","withdrawn","wobble","wobbles","womanise","woodsy","workings","workshops","worldliness","worrywart","worsened","worsens","wreaths","wrinklies","writhes","wronging","xenophobia","yachting","yachts","yakking","yodels","youngish","zillions","zonked");
  1088.                                     $this->gameRunning = 'hangman';
  1089.                                     $this->gameVar['unguessed'] = 'abcdefghijklmnopqrstuvwxyz';
  1090.                                     $this->gameVar['wrongCount'] = 0;
  1091.                                     $this->gameVar['guessed'] = '';
  1092.                                     $this->gameVar['word'] = $words[array_rand($words)];
  1093.                                     unset($words);
  1094.                                     $this->gameVar['display'] = array();
  1095.                                     $this->gameVar['blocked'] = array();
  1096.                                     unset($this->gameVar['time']);
  1097.                                     foreach(str_split($this->gameVar['word']) as $c) $this->gameVar['display'][] = '-';
  1098.                                     $this->sendMessage("Word: ".implode($this->gameVar['display'],''));
  1099.                                 break;
  1100.                                 case 'guess':
  1101.                                     if(!isset($word[1]) || empty($word[1])) {$this->sendMessage("You have to guess something :|"); return;}
  1102.                                     if(strtolower(trim($word[1]))!=$this->gameVar['word']) {
  1103.                                         $this->sendMessage("U got that wrong bit<h No moar guessing for u!");
  1104.                                         $this->gameVar['blocked'][] = $this->parseU($this->packet['m']['u']);    
  1105.                                     } else {
  1106.                                         $this->sendMessage("Congratz! ".$this->users[$this->parseU($this->packet['m']['u'])]['name']." you won. The word was: ". $this->gameVar['word']);
  1107.                                         $this->gameRunning = false;
  1108.                                        
  1109.                                         unset($this->gameVar);
  1110.                                         $this->gameRunning = false;
  1111.                                     }
  1112.                                 break;
  1113.                                 case 'end':
  1114.                                                                 case 'stop':
  1115.                                     if($this->gameVar['time']+60>time()){$this->sendMessage("NO!"); return;}
  1116.                                     $this->sendMessage("Hope you had fun!");
  1117.                                     $this->gameRunning = false;
  1118.                                    
  1119.                                     unset($this->gameVar);
  1120.                                     $this->gameRunning = false;
  1121.                                 break;
  1122.                                 default:
  1123.                                     if($this->gameRunning!='hangman') return;
  1124.                                     $word[1] = $word[0];
  1125.                                     if(!isset($word[1]) || empty($word[1])) {$this->sendMessage("OMG you have to guess something!"); return;}
  1126.                                     $this->gameVar['time'] = time();
  1127.                                     $posn = strpos($this->gameVar['unguessed'],$word[1]{0});
  1128.                                     if($posn===false) {$this->sendMessage("Someone already guessed that!");return;}
  1129.                                     $this->gameVar['unguessed'] = str_replace($word[1]{0},'',$this->gameVar['unguessed']);
  1130.                                     $this->gameVar['guessed'] .= $word[1]{0};
  1131.                                     $posn2 = array_search($word[1]{0},str_split($this->gameVar['word']));
  1132.                                     if($posn2===false) {
  1133.                                         $max = 7;
  1134.                                         $this->gameVar['wrongCount']++;
  1135.                                         if($this->gameVar['wrongCount']>=$max) {
  1136.                                             $this->sendMessage("You have made too many wrong guesses. You lose. The word was: ".$this->gameVar['word']);
  1137.                                             $this->gameRunning = false;
  1138.                                            
  1139.                                             unset($this->gameVar);
  1140.                                             $this->gameRunning = false;
  1141.                                         } else $this->sendMessage($word[1]{0}." wasn't in the word. You have ".($max-$this->gameVar['wrongCount'])." lives left.");
  1142.                                         return;
  1143.                                     } else {
  1144.                                         for($i=0;$i<strlen($this->gameVar['word']);$i++) {
  1145.                                             if($this->gameVar['word']{$i}==$word[1]{0}) $this->gameVar['display'][$i] = $word[1]{0};  
  1146.                                         }
  1147.                                         if(in_array('-',$this->gameVar['display'])) $this->sendMessage("Remaining: ".implode($this->gameVar['display'],' '));
  1148.                                         else {
  1149.                                             $this->sendMessage("Congratz! ".$this->users[$this->parseU($this->packet['m']['u'])]['name']." you won. The word was: ". $this->gameVar['word']);
  1150.                                             $this->gameRunning = false;
  1151.                                          
  1152.                                             unset($this->gameVar);
  1153.                                             $this->gameRunning = false;
  1154.                                         }
  1155.                                     }
  1156.                                    
  1157.                                 break;  
  1158.                             }
  1159.                         break;
  1160.                         default:
  1161.                             if(array_key_exists(substr(strtolower($info[0]),1),$this->commands)) {
  1162.                                 $msg = $this->commands[substr(strtolower($info[0]),1)];
  1163.                                 $msg = str_replace('[input]',$info[1],$msg);
  1164.                                 $this->sendMessage($msg);
  1165.                             }
  1166.                     }
  1167.                 }
  1168.                
  1169.             break;            
  1170.         }
  1171.     }
  1172. function removeAccess($sender,$target) {
  1173.         if(trim($sender)==''||trim($target)=='') {$this->sendMessage('No!');return false;}
  1174.         $senderIndex = array_search(strtolower($sender),$this->access);
  1175.         $targetIndex = array_search(strtolower($target),$this->access);
  1176.         if($senderIndex===false) {$this->sendMessage( "You are not allowed to do this."); return false;}
  1177.         if($targetIndex===false) {$this->sendMessage( "'$target' not found."); return false;}
  1178.         if($senderIndex < $targetIndex) {
  1179.             $this->access = array_values(array_diff($this->access,array(strtolower($target))));
  1180.             return true;    
  1181.         } else {
  1182.             $this->sendMessage( "You may only remove people who have been added after you.");    
  1183.             return false;
  1184.         }
  1185.     }
  1186.     function spamCheck($id) {
  1187.          
  1188.         $id = $this->parseU($id);
  1189.         if($this->users[$id]['time'] >= (time()-$this->spam['time'])) {
  1190.             $this->users[$id]['messages']++;
  1191.             if($this->users[$id]['messages']>=$this->spam['limit']) {$this->kick("SPAM!", $id,false,true);$this->users[$id]['messages'] = 1;return;}
  1192.         }else {
  1193.             $this->users[$id]['time'] = time();
  1194.             $this->users[$id]['messages'] = 1;    
  1195.         }        
  1196.     }
  1197.     function parseU($id) {
  1198.         if(substr_count($id,'_')>=1) $id = substr($id,0,strpos($id,'_'));
  1199.         return $id;
  1200.         }
  1201.     function inStr($needle, $haystack) {
  1202.         $needlechars = strlen($needle);
  1203.         for ($i = 0; $i < strlen($haystack); $i++) if (substr($haystack, $i, $needlechars) == $needle) return true;
  1204.         return false;
  1205.     }
  1206.     function getBetween($content,$start,$end){
  1207.         $r = explode($start, $content);
  1208.         if (isset($r[1])){
  1209.             $r = explode($end, $r[1]);
  1210.             return $r[0];
  1211.         }
  1212.         return '';
  1213.     }
  1214.  
  1215.     function member($id) {
  1216.         if(!isset($this->members[$id])||$this->members[$id]<(time()-5)) {
  1217.             $this->send('<c u="'.$id.'" t="/e" />');
  1218.             $this->members[$id] = time();    
  1219.         }
  1220.     }
  1221.     function kick($message, $id, $silent=false, $log=false) {
  1222.         if($log) {
  1223.             if(!empty($this->users[$id]['kicks']) ) $this->users[$id]['kicks']++;
  1224.             else $this->users[$id]['kicks'] = 1;
  1225.         }
  1226.         if($this->users[$id]['kicks'] > $this->maxKicks) {
  1227.             $this->ban("Cuss.",$id,banTime);
  1228.             $this->users[$id]['kicks'] = 0;
  1229.             return;    
  1230.         }
  1231.         if($silent)$this->send('<c u="'.$id.'" t="/k" />');  
  1232.         else $this->send('<c p="'.$message." ".$this->users[$id]['kicks'].'/'.$this->maxKicks.'" u="'.$id.'" t="/k" />');  
  1233.     }
  1234.     function ban($message, $id, $time) {
  1235.         if(empty($time)) $time = banTime;
  1236.         $this->send('<c p="'.ereg_replace('[^A-Za-z0-9.! ]','',$message).'" u="'.$this->parseU($id).'" t="/g'.$time.'" />');
  1237.     }
  1238.     function unban($id) {
  1239.         $this->send('<c u="'.$this->parseU($id).'" t="/u" />');    
  1240.     }
  1241.     function restart() {
  1242.         socket_close($this->soc);
  1243.         $this->soc = null;
  1244.         $this->save();
  1245.         sleep(1);
  1246.         if($this->botID == 1)
  1247.             shell_exec("php XatBot.db.class.php4 $this->botID -null >> log1.txt 2>>err1.txt &");
  1248.         else
  1249.             shell_exec("php XatBot.db.class.php4 $this->botID -null > /dev/null 2>/dev/null &");
  1250.         shell_exec('kill -9 '.getmypid());
  1251.     }
  1252.     function sendPrivateChat($message, $id) {
  1253.         if(empty($message))return;
  1254.         $this->send('<p u="'.$id.'" t="'.$message.'" s="2" d="'.$this->userID.'" />');    
  1255.     }
  1256.     function sendPrivateMessage($message,$id) {
  1257.         $id = $this->parseU($id);
  1258.         if(empty($message))return;
  1259.         $this->send('<p u="'.$id.'" t="'.$message.'" />');    
  1260.     }
  1261.     function sendMessage($message) {
  1262.         if(empty($message))return;
  1263.         $this->send('<m t="'.$message.'" u="'.$this->userID.'" />');    
  1264.     }
  1265.    
  1266.     function query_str($params, $out = array()) {
  1267.         if (!is_array($params) || count($params) == 0) return false;
  1268.         $fga = func_get_args();
  1269.         $akey = ( !isset($fga[1]) ) ? false : $fga[1];
  1270.         foreach ($params as $key => $val) {
  1271.             if ( is_array($val) ) {
  1272.                 query_str($val,$key, $out);
  1273.                 continue;
  1274.             }
  1275.             $thekey = ( !$akey ) ? $key : $akey . '['.$key.']';
  1276.             $out[] = $thekey."=".$val;
  1277.         }
  1278.         return implode("&",$out);
  1279.     }
  1280.    
  1281.     function isValidURL($url){return $this->inStr('http://',$url);}
  1282.     function f2rank($f) {
  1283.         $f = $this->parseU($f);
  1284.  
  1285.    
  1286.          if($f==-1) return 0;  
  1287.          if((16 & $f)) return -1;
  1288.         if((1 & $f)&&(2 & $f)) return 1;
  1289.         if((4 & $f)) return 3;
  1290.         if((32 & $f)&&(1 & $f)&&!(2 & $f)) return 5;
  1291.         if(!(1 & $f)&&!(2 & $f)) return 0;
  1292.         if((16 & $f)) return -1;
  1293.         if((2 & $f)&&!(1 & $f)) return 2;
  1294.     }
  1295.     function sec2hms($sec, $padHours = false) {
  1296.        
  1297.         $hms = "";
  1298.         $hours = intval(intval($sec) / 3600);
  1299.         $hms .= ($padHours) ? str_pad($hours, 2, "0", STR_PAD_LEFT) . ':' : $hours . ':';
  1300.         $minutes = intval(($sec / 60) % 60);
  1301.         $hms .= str_pad($minutes, 2, "0", STR_PAD_LEFT) . ':';
  1302.         $seconds = intval($sec % 60);
  1303.         $hms .= str_pad($seconds, 2, "0", STR_PAD_LEFT);
  1304.         return $hms;
  1305.     }
  1306.      
  1307.    
  1308.    
  1309.         //Use this to give access to owner only commands
  1310.     function isAllowed($id,$min) {
  1311.         $id = $this->parseU($id);
  1312.         if (in_array($id,$this->allowAccess)) return true;
  1313.        
  1314.         if($this->allowByRank)if($this->f2rank($this->users[$id]['rank'])>=$min) return true;
  1315.        
  1316.         return in_array(strtolower($this->users[$id]['regName']),$this->access);
  1317.     }
  1318.         // be on seperate lines with this syntax if($id==ID goes here) return true;
  1319.     function checkMinRank($id,$min) {
  1320.         $id = $this->parseU($id);  
  1321.         if (in_array($id,$this->allowAccess)) return true;
  1322.         if($this->f2rank($this->users[$id]['rank'])>=$min) return true;
  1323.         return in_array(strtolower($this->users[$id]['regName']),$this->access);
  1324.     }
  1325. }
  1326. $bot = new XatBot();
  1327.  
  1328. while(true) {
  1329.     try {
  1330.         $bot->run();
  1331.     } catch(exception $e) {
  1332.          
  1333.     }
  1334. }
  1335.  
  1336. ?>
  1337.  
clone this paste RAW Paste Data