* Module coded by Craized /* Add a "_" at the beginning of the file (w_lookup.php) if you do not want it to be loaded. */ $w_lookup = new Status($bot); $cron["2sec"][] = &$w_lookup; /* The Class itself... */ class Status { var $bot; /* Constructor: Hands over a referance to the "Bot" class. */ function Status (&$bot) { $this -> bot = &$bot; $this -> bot -> highlight_color = !$this -> bot -> highlight_color ? '' : ''; } function cron() { $handle = mysql_query("SELECT * FROM w_lookup"); while(TRUE===($f[] = mysql_fetch_array($handle))); if(isset($f)) { foreach($f as $key=>$value) { $value['name'] = ucfirst(strtolower($value['name'])); if($this -> bot -> aoc -> get_uid($value['name'])) { if(!$this -> bot -> aoc -> buddy_exists($value['name'])) $this -> bot -> aoc -> buddy_add($value['name']); if($this -> bot -> aoc -> buddy_online($value['name'])) { $status = 1; } else $status = 0; } else $status = 2; $status != $value['status'] ? mysql_query("UPDATE w_lookup SET status='".$status."' WHERE id='".$value['id']."' LIMIT 1") : NULL; } } } } ?>