X-Git-Url: http://git.pk910.de/?p=PHP-P10.git;a=blobdiff_plain;f=Bots%2FModManager.class.php;h=38281f40c584b71f8298ca011e7312d7215d29e5;hp=61ce790d970bb15335ac406a0f246875a4c85b9f;hb=7f51193ddac01b0540000c756c50167ff015e02a;hpb=316aa700bd3e2e0019b8e3f10b543b49b0f77f02 diff --git a/Bots/ModManager.class.php b/Bots/ModManager.class.php index 61ce790..38281f4 100644 --- a/Bots/ModManager.class.php +++ b/Bots/ModManager.class.php @@ -1,12 +1,10 @@ . * * * ************************************************************************ - * + * * Bots/ModManager.class.php * * module manager bot... @@ -29,7 +26,7 @@ class {$_NAME} extends Bot { private $uplink; private $modman; - + public function load($uplink, $old = false) { $this->uplink = $uplink; if(!$old) { @@ -47,11 +44,12 @@ class {$_NAME} extends Bot { } else { $this->modman = $old; } - + ModCMD::bind($this, BIND_CHANMSG, "recive_privmsg"); ModCMD::bind($this, BIND_QUIT, "recive_quit"); + ModCMD::bind($this, BIND_CTCP, "recive_ctcp"); } - + public function unload($rehash = false) { if($rehash) { return $this->modman; @@ -59,8 +57,8 @@ class {$_NAME} extends Bot { $this->uplink->delUser($this->modman, "Bye."); } } - - function recive_privmsg($user, $channel, $message) { + + public function recive_privmsg($user, $channel, $message) { if(!$user->getModes()->hasMode('o')) return 0; $exp=explode(" ",$message); switch (strtolower($exp[0])) { @@ -85,6 +83,11 @@ class {$_NAME} extends Bot { $this->uplink->privmsg($this->modman, $channel, "error."); } break; + case "~list": + foreach(BotLoader::listBots() as $name => $bot) { + $this->uplink->privmsg($this->modman, $channel, $name); + } + break; case "~debug": $exp=explode(" ",$message,2); ob_start(); @@ -106,12 +109,31 @@ class {$_NAME} extends Bot { break; } } - - function recive_quit($user, $reason) { + + public function recive_quit($user, $reason) { if($user === $this->modman) { $this->load($this->uplink); } } + + public function recive_ctcp($user, $target, $command, $text, $publicCtcp) { + if(!$publicCtcp) { + switch($command) { + case"PING": + $this->uplink->ctcp_reply($target, $user, "PING", ($text - (60*60*1337 + 42*60))); //1337 42 ftw! + break; + case"VERSION": + $this->uplink->ctcp_reply($target, $user, "VERSION", "PHP-P10 Pack by pk910. Source: http://devserv.pk910.de/git/?p=PHP-P10.git"); + break; + case"TIME": + $this->uplink->ctcp_reply($target, $user, "TIME", date('r')); + break; + case"FINGER": + $this->uplink->ctcp_reply($target, $user, "FINGER", "PHP-P10 Pack (C) ".date('Y')." pk910. Visit us on irc://irc.webgamesnet.net/PHP"); + break; + } + } + } } ?> \ No newline at end of file