uplink = $uplink; if(!$old) { $nick = "ModuleMan"; $ident = "modman"; $host = "Services.WebGamesNet.net"; $ip = "0::0"; $realname = "Module Manager"; $modes = "ioknISD"; $this->modman = $this->uplink->addUser($nick,$ident,$host,$ip,$modes,$realname); if(is_a($this->modman, "P10_User")) { $this->uplink->join($this->modman, "#opers", (P10_Channel::USERPRIV_OPED | P10_Channel::USERPRIV_VOICE)); $this->uplink->join($this->modman, "#dev", P10_Channel::USERPRIV_VOICE); } } else { $this->modman = $old; } ModCMD::bind($this, BIND_PRIVMSG, "recive_privmsg"); ModCMD::bind($this, BIND_QUIT, "recive_quit"); } public function unload($rehash = false) { if($rehash) { return $this->modman; } else { $this->uplink->delUser($this->modman, "Bye."); } } function recive_privmsg($user, $channel, $message) { if(!$user->getModes()->hasMode('o')) return 0; $exp=explode(" ",$message); switch (strtolower($exp[0])) { case "~loadmod": if(BotLoader::load($exp[1],$exp[2])) { $this->uplink->privmsg($this->modman, $channel, "done."); } else { $this->uplink->privmsg($this->modman, $channel, "error."); } break; case "~unloadmod": if(BotLoader::unload($exp[1])) { $this->uplink->privmsg($this->modman, $channel, "done."); } else { $this->uplink->privmsg($this->modman, $channel, "error."); } break; case "~rehash": if(BotLoader::rehash($exp[1])) { $this->uplink->privmsg($this->modman, $channel, "done."); } else { $this->uplink->privmsg($this->modman, $channel, "error."); } break; case "~debug": $exp=explode(" ",$message,2); ob_start(); $ret = eval($exp[1]); $out = ob_get_contents(); ob_end_clean(); $lines = explode("\n",$out); for($i=0;$iuplink->privmsg($this->modman, $channel, $lines[$i]); } } $lines = explode("\n",$ret); for($i=0;$iuplink->privmsg($this->modman, $channel, $lines[$i]); } } break; } } function recive_quit($user, $reason) { if($user === $this->modman) { $this->load($this->uplink); } } } ?>