Etienne Kneuss

home » repository » php » ircbot » modules » class.Module_Protocol.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_Protocol extends Module {     protected $_registered = false;     public function update(Observed $bot, $raw, $type) {         if (($type & Bot::U_STATUS) == Bot::U_STATUS && $raw == 'Reconnect') {             $this->_registered = false;             return Bot::E_CONTINUE;         }         if (($type & Bot::U_INPUT) != Bot::U_INPUT) {             return Bot::E_CONTINUE;         }                  $raw_pieces = explode(' ', $raw);                  // Register                  if (isset($raw_pieces[0]) && $raw_pieces[0] == 'NOTICE' && !$this->_registered) {                                       $user = $bot->configs['username'] . " " . $bot->configs['hostname'] . " " . $bot->configs['servername']  . " :" . $bot->configs['realname'];                                $bot->send("USER $user");             $bot->send("NICK " . $bot->configs['nickname']);             $this->_registered = true;         }                  // Answer to PING                  if (isset($raw_pieces[0]) && $raw_pieces[0] == 'PING') {                      $raw[1] = 'O';             $bot->send($raw);         }                  // Used nick         if (isset($raw_pieces[1]) && $raw_pieces[1] == '443') {                          $bot->send("NICK " . $raw_pieces[3] . rand(1, 20));         }         return Bot::E_CONTINUE;     } }

Comments

There is currently no comment here.

Add a comment

Username:

Spam Challenge: 1+10=?

Comment: