username; $level=$player->level; // $class=$player->'class'; $ttl=$player->ttl; $online=$player->online; $totalidled=$player->totalidled; fputs($socket,"PRIVMSG ".$name." :Stats for ".$username.": \n"); fputs($socket,"PRIVMSG ".$name." :Level: ".$level." \n"); fputs($socket,"PRIVMSG ".$name." :Time till next: ".$ttl." seconds \n"); if($online==1){fputs($socket,"PRIVMSG ".$name." :Status: Online \n");} else{fputs($socket,"PRIVMSG ".$name." :Status: Offline\n");} fputs($socket,"PRIVMSG ".$name." :Total Time Idled: ".$totalidled." seconds \n"); } function idlerpg($socket,$char,$pass){ fputs($socket,"JOIN #idlerpg\n"); fputs($socket,"PRIVMSG MitNick :LOGIN ".$char." ".$pass."\n"); } function suicide($socket,$name,$room){ fputs($socket, "PRIVMSG ".$room." :Bye Now!\n"); fputs($socket,"PRIVMSG ".$name." :Fuck you too.\n"); fputs($socket, "QUIT ".$name.": I LOVE YOU TOO\n"); return 0; } function nick($socket,$nick,$pass){ $pass=str_replace(array(chr(10),chr(13)),'',$pass); fputs($socket,"NICK ".$nick."\n"); if(isset($pass)){fputs($socket,"PRIVMSG NickServ :identify ".$pass."\n");} } function joinus($socket,$chan,$pass){ if(isset($pass)){fputs($socket,"JOIN ".$chan." ".$pass."\n");} else{fputs($socket,"JOIN ".$chan."\n");} } function leaveus($socket,$room){ fputs($socket,"PRIVMSG ".$room." :Ill be in the other room\n"); fputs($socket,"PART ".$room."\n"); } function priv($socket,$arg1,$ex){ $arg2 = " :"; $i=5; while($ex[$i]!=""){ $arg2 .= str_replace(array(chr(10),chr(13)),'',$ex[$i])." "; $i++; } $arg2 .="\n"; fputs($socket, "PRIVMSG ".$arg1.$arg2); } function ident($sock,$arg1){ fputs($sock, "PRIVMSG NickServ :identify ".$arg1."\n"); } if (!($server==""||$port=="")) { //connection one $socket = fsockopen($server, $port); fputs($socket,"USER GODDbot thenullbyte.org GODD :GODDbot\n"); fputs($socket,"NICK GODDbot\n"); // Join channel fputs($socket,"$start\n"); ident($socket,"loombaer"); //connection two $socket1 = fsockopen($server1,$port1); fputs($socket1,"USER GODDbot thenullbyte.org GODD :GODDbot\n"); fputs($socket1,"NICK GODDbot\n"); fputs($socket1,"JOIN $start1\n"); ident($socket1,"loombaer"); $alive=1; $alive1=1; echo fgets($socket,128); echo fgets($socket1,128); while($alive==1) { if($alive1!=1)$alive=0; // Continue the rest of the script here while($alive1==1){ if($data = fgets($socket, 128)){ echo $data; flush(); $ex = explode(' ', $data); } if($data1 = fgets($socket1,128)){ echo $data1; flush(); $ex1 = explode(' ', $data1); } if($ex[4]." ".$ex[5]." ".$ex[6]==":No such nick/channel"){ fputs($socket,"PRIVMSG ".$name." :I am sorry, there is no user by that name\n"); } // Send PONG back to the server if($ex1[0] == "PING"){ fputs($socket1, "PONG ".$ex1[1]."\n"); } if($ex[0] == "PING"){ fputs($socket, "PONG ".$ex[1]."\n"); } $name = preg_replace('/!.*/','',$ex[0]); $name = str_replace(':','',$name); $name1 = preg_replace('/!.*/','',$ex1[0]); $name1 = str_replace(':','',$name1); $command = str_replace(array(chr(10),chr(13)),'',$ex[3]); $command1 = str_replace(array(chr(10),chr(13)),'',$ex1[3]); $arg2 = str_replace(array(chr(10),chr(13)),'',$ex1[4]); $arg1 = str_replace(array(chr(10),chr(13)),'',$ex[4]); if ($command == ":!self-terminate" || $command1 == ":!self-terminate"){ $alive=suicide($socket1, $name, $ex1[2]); $alive=suicide($socket, $name, $ex[2]); $alive1=0; } if (($name1 = 'c3p0' || $name1 = 'CrackBot') && $hash==1){fputs($socket,"PRIVMSG ".$chan1." :".$command1."\n");$yes=0;} if ($command == ":!hash"){ $hash=$arg1; fputs($socket1,"PRIVMSG #bot-test :!search ".$hash."\n"); fputs($socket1,"PRIVMSG #bot-test :.c3p0 addmd5 ".$hash."\n"); $hash=1; $command = ''; } if ($command == ":!help") {help($socket,$name);} if ($command == ":!sayhi") {fputs($socket, "PRIVMSG ".$ex[2]." :HI THERE!\n");} if ($command==":!msg"){priv($socket,$arg1,$ex);} if ($command==":!idlerpg"){idlerpg($socket,$arg1,$ex[5]);} if ($command==":!nick"){nick($socket,$arg1,$ex[5]);} if ($command==":!join"){joinus($socket,$arg1,$ex[5]);} if ($command==":!identify"){ident($socket,$arg1);} if ($command==":!leave"){leaveus($socket,$ex[2]);} flush(); } } fclose($socket); } else{echo "Please specify a server and port...<\ br>";} ?>