$arguments = explode(" ",$message);
if (trim($arguments[0]) == "!status" && $message) {
delay_priv_msg($chan, "0,1~-_( Hold on. Checking status now. Checking status can take up to 12 seconds so plz wait )_-~", 0) ;
}
// init arrays
$host = array();
$port = array();
$srv_status = array();
// server data
$host[0] = "ip.ip.ip.ip";
$host[1] = "ip.ip.ip.ip";
$host[2] = "8ip.ip.ip.ip";
$host[3] = "ip.ip.ip.ip";
$port[0] = 5121;
$port[1] = 6121;
$port[2] = 5121;
$port[3] = 3306;
$timeout = 4;
$arguments = explode(" ",$message);
if (trim($arguments[0]) == "!status" && $message) {
// check all servers
for ($i = 0; $i < sizeof($host); $i++) {
$connection = fsockopen($host[$i], $port[$i], $errno, $errstr, $timeout);
if(!$connection) {
$srv_status[$i] = "4DOWN";
}
else {
$srv_status[$i] = "9UP";
}
}
// print message
delay_priv_msg($chan, "0,1~-_( LoginServer: ".$srv_status[0]."0,1, Charserver: ".$srv_status[1]."0,1, Mapserver: ".$srv_status[2]."0,1, MySQL: ".$srv_status[3]." 0,1)_-~", 1);
}
Hoe kan ik het zo veranderen...dat het maar eens per 30 seconden bruikbaar is? Ik kom er echt niet uit. Het liefts de hele zin of text die ik toe moet voegen/wijzigen. Alvast bedankt