Advertisement
Guest User

Untitled

a guest
May 28th, 2017
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.90 KB | None | 0 0
  1. <?php
  2.  
  3.     class Bot extends IRC {
  4.         $ModuleSystem = new Module();
  5.         public function Start() {
  6.             $this->Connect(); //Connect that bot, yo...
  7.             $this->Listener(); //Listen to it's shit, yo... lolz.
  8.            
  9.         }
  10.         public function Listener() {
  11.             while (1) { //This will be changed at some point, need to come up with a check system...
  12.                 $Buffer = $this->Read(); // This is reading the raw line from the IRCd. I wouldn't process anything off of this, unless you are really good with REGEX.
  13.                 $BufferBits = explode(" ", $Buffer); // This breaks down the big line of shit into something more easy to base triggers off of...
  14.                 if ($BufferBits[0] == "PING") {
  15.                     $this->Write("PONG ".$BufferBits[1]."\r\n"); // PONG that PING the server sends, makes it so the bot doesn't ping out.
  16.                 }
  17.                 $ModuleSystem->GetBuffer($Buffer); //Sends the contents of Buffer to the module system.
  18.             }
  19.         }      
  20.     }
  21.    
  22.  
  23.  
  24.  
  25. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement