phpircbot2/commands/checkips.global.php
Jan Philipp Timme 6b39d44754 Initial import.
2010-11-21 22:13:54 +00:00

30 lines
674 B
PHP

<?php
#BOT_INCLUDE "checkips" "global" "0"
if($recv["msgarr"][1] == "add"){
$ip = $recv["msgarr"][2];
$this -> ipcs[$ip]["lastcheck"] = 0;
$this -> ipcs[$ip]["status"] = null;
}
if($recv["msgarr"][1] == "del"){
$ip = $this -> protocol -> getArgs(2, $recv);
unset($this -> ipcs[$ip]);
}
if($recv["msgarr"][1] == "list"){
if(count($this -> ipcs) < 1){
$this -> call("notice", $recv["nick"], "Bisher keine IPs zu checken.");
}
else{
foreach($this -> ipcs AS $ip => $data){
$status = ($data["status"]) ? "Online" : "Offline";
$line = "[".$ip."] Status: ".$status;
$this -> call("notice", $recv["nick"], $line);
}
}
}
?>