phpircbot2/commands/checkips.global.php

30 lines
674 B
PHP
Raw Normal View History

2010-11-21 23:13:54 +01:00
<?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);
}
}
}
?>