Etienne Kneuss

home » repository » php » ircbot » modules » class.Module_Control.php
Tree:
school
mp3
php
sample
publications
Math_Derivative
Math_Expression
ircbot
libraries
modules
class.Module_Invite.php
class.Module_Auth.php
class.Module_Control.php
class.Module_Protocol.php
class.Module.php
class.Module_Output.php
class.Module_Knowledge.php
class.Module_Perform.php
exceptions
bot.php
plopbot.sql
php.net
images
dump

Source code raw phps

    <?php require_once 'modules/class.Module.php'; class Module_Control extends Module {     public function update(Observed $bot, $raw, $type) {         if (($type & Bot::U_INPUT) != Bot::U_INPUT) {             return Bot::E_CONTINUE;         }                  $raw_pieces = explode(' ', $raw, 4);                  if (!isset($raw_pieces[3])) {             return Bot::E_CONTINUE;         }         $message = substr($raw_pieces[3],1);                  if (substr($message,0, 9) == '!control ') {                          $command = substr($message, 9);             if (!empty($command) && $command == 'shutdown') {                              $bot->notify('Mod_Control ordered a general shutdown.', Bot::U_DEBUG);                 return Bot::E_STOP;             } else if (!empty($command) && $command == 'reconnect') {                              $bot->notify('Mod_Control ordered a reconnect.', Bot::U_DEBUG);                 return Bot::E_RECONNECT;                              }         }         return Bot::E_CONTINUE;     } }

Comments

There is currently no comment here.

Add a comment

Username:

Spam Challenge: 4+17=?

Comment: