rendered paste bodyif(command('factoids',3)){ if($cmdparamsarray[0] == 'list'){ $factsout = $factoids; foreach($factsout as $key => $number){ $factsout[$key] = $key.' ('.$number.')'; } SendCommand("PRIVMSG $sender :".implode(' || ',$factsout)); } elseif($cmdparamsarray[0] == 'add'){ if($cmdparamsarray[1] != '' && $cmdparamsarray[2] != ''){ $factoids[$cmdparamsarray[1]] = implode(' ',array_slice($cmdparamsarray,2)); SendCommand("PRIVMSG $sender :adding $cmdparamsarray[1] (".$cmdparamsarray[2].") "); } } elseif($cmdparamsarray[0] == 'del'){ if($cmdparamsarray[1] != ''){ unset($factoids[$cmdparamsarray[1]]); SendCommand("PRIVMSG $sender :deleting $cmdparamsarray[1]"); } } elseif($cmdparamsarray[0] == 'save'){ file_put_contents($dir.'facts.dat',serialize($factoids)); sendcommand("PRIVMSG $sender :factoids saved!"); } elseif($cmdparamsarray[0] == 'load'){ $factoids = unserialize(file_get_contents($dir.'facts.dat')); SendCommand("PRIVMSG $sender :Factoids file list loaded!"); } elseif($cmdparamsarray[0] == 'tell'){ SendCommand("PRIVMSG $cmdparamsarray[1] :$cmdparamsarray[2] is ----NEED TO FINISH THIS-----"); } else { SendCommand("PRIVMSG $sender :Usage: ".$comchar.'factoids [list], [add <factoid> <deff> (more words per one factoid is bugged)] , [del <fact>], [save], [load], [tell] - neeed to finish this option'); } }