".$line."\n"; $token = explode(" ", $line); /* print_r($token); echo "substr: ".substr($token[0],1,(strpos($token[0],"!")-1))."\n"; echo "strlen(token[3]) == ".strlen($token[3])." (".$token[3].")"; echo "strlen(trim(token[3])) == ".strlen(trim($token[3]))." (".$token[3].")"; */ // if we haven't already told the server who we are if ($registered == false) { cmdSend($conn,"USER ".strtolower($config["ident"])." 0 0 :".$config['realname']); cmdSend($conn,"NICK ".$config["nick"]); $registered = true; } // if the server pings if ($token[0]=="PING") { // we pong cmdSend($conn, "PONG ".$token[1]); } // deal with Netgamers' shady lack of pinging if (!(strlen($token[0])>0)) { msg("#", "pong."); } // if the server has finished its startup bollocks if ($token[0]==":".$config["host"] && $token[1]=="376") { cmdSend ($conn, "PRIVMSG P@Cservice.netgamers.org :login botsworth bottage1356"); sleep(1); cmdSend ($conn, "MODE ".$config['nick']." +x"); sleep(1); joinchannel($config['chan']); } // whois stuff if ($token[0]==":".$config["host"] && strlen($token[1])==3) { // print_r($token); $eventNum = $token[1]; if ($eventNum == $whoisStart) { $nick = $token[3]; $pnick = ""; $ident = $token[4]; $host = $token[5]; } if ($eventNum == $whoisPNick) { $pnick = $token[4]; } if ($eventNum == $whoisEnd) { if (!(strlen($pnick)>0)) { msg($config['chan'], $nick." (".$ident."@".$host.") is not logged into P"); } else { msg($config['chan'], $nick." (".$ident."@".$host.") is logged into P as ".$pnick); $nickarray[$nick] = $pnick; } if ($galleryflag[$nick]="1") { if (strlen($nickarray[$nick])>0) { msg($config['chan'],"http://ng-gallery.net/view.php?nick=".$nickarray[$nick]); } else { msg($config['chan'],$nick." doesn't have an NG-Gallery page."); } } unset($nick); unset($pnick); unset($ident); unset($host); } } // if i want to whois someone if (strtolower(trim($token[3])) == ":!whois" && substr(trim($token[0]),1,strpos(trim($token[0]),"!")-1)=="webvictim") { if (strlen($token[4])>0) { $whois = $token[4]; cmdSend ($conn, "WHOIS ".$whois); } } // !gallery if ($token[1] == "PRIVMSG" && strtolower($token[2])==$config['chan'] && strtolower($token[3]) == ":!gallery") { if (strlen($token[4])>0) { if (strlen($nickarray[$token[4]])>0) { msg($config['chan'],"http://ng-gallery.net/view.php?nick=".$nickarray[$token[4]]); } else { $galleryflag[$token[4]]="1"; cmdSend ($conn, "WHOIS ".$token[4]); // msg($config['chan'],"Too fucking complicated for tonight, tbh (no p-auth saved)"); } } } // if someone says !hump whatever if ($token[1] == "PRIVMSG" && strtolower($token[2])==$config['chan'] && strtolower($token[3]) == ":!hump") { if (strlen($token[4])>0) { action($config['chan'], "humps ".$token[4]); } } // if someone says !tickle whatever if ($token[1] == "PRIVMSG" && strtolower($token[2])==$config['chan'] && strtolower($token[3]) == ":!tickle") { if (strlen($token[4])>0) { action($config['chan'], "tickles ".$token[4]); } } // if someone says !slap whatever if ($token[1] == "PRIVMSG" && strtolower($token[2])==$config['chan'] && strtolower($token[3]) == ":!slap") { if (strlen($token[4])>0) { action($config['chan'], "slaps ".$token[4]); } } // if someone says !fap whatever if ($token[1] == "PRIVMSG" && strtolower($token[2])==$config['chan'] && strtolower($token[3]) == ":!fap") { if (strlen($token[4])>0) { action($config['chan'], "faps ". $token[4]); } } // if someone /msgs the bot if ($token[1] == "PRIVMSG" && strtolower($token[2])==$config['nick']) { // $nick is the person's nick $nick = substr($token[0],1,(strpos($token[0],"!")-1)); // increment the number of times they have messaged the bot for spam protection $privmsgs[$nick]++; // if it's me if ($nick=="webvictim") { // !hump if (strtolower($token[3]) == ":!hump") { action($config['chan'], "humps ".$token[4]); } // !tickle else if (strtolower($token[3]) == ":!tickle") { action($config['chan'], "tickles ".$token[4]); } // !slap else if (strtolower($token[3]) == ":!slap") { action($config['chan'], "slaps ".$token[4]); } // !fap else if (strtolower($token[3]) == ":!fap") { action($config['chan'], "faps ".$token[4]); } } // otherwise start being sarky else if ($privmsgs[$nick]>4 && $privmsgs[$nick]<=8) { msg($nick, "well, i'm spent."); } else if ($privmsgs[$nick]>8 && $privmsgs[$nick]<=12) { msg($nick, "don't you think it's wearing a little thin now?"); } else if ($privmsgs[$nick]>12) { continue; } else { action($nick, $actions[rand(0,5)]); msg($nick, "harrrr!"); } } // my shocker stuff if ($token[1] == "PRIVMSG" && strtolower($token[2])==$config['nick'] && strtolower($token[3]) == ":!shocker") { $nick = substr($token[0],1,(strpos($token[0],"!")-1)); if ($nick=="webvictim" || $nick=="Ashley" || $nick=="EreheMan") { $string = $token[4]." in "; for ($i=5;$i