Advertisement
Guest User

Untitled

a guest
May 28th, 2017
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.10 KB | None | 0 0
  1. <?php
  2.  
  3.     class Module extends IRC {
  4.         public $Buffer;
  5.         public function Init() {
  6.             $this->Mods = array("core");
  7.             foreach($this->Mods as $Mod) {
  8.                     require_once("Modules/mod.$Mod/Main.php");
  9.                     $this->$Mod = new $Mod();
  10.                     echo "Loaded Module: $Mod\r\n";
  11.                 }
  12.             }
  13.         public function GetBuffer($Buffer) {
  14.             $this->Buffer = $Buffer; // This is reading the raw line from the IRCd. I wouldn't process anything off of this, unless you are really good with REGEX.
  15.             $this->BufferBits = explode(" ", $this->Buffer); // This breaks down the big line of shit into something more easy to base triggers off of...
  16.             $PersonRegex = preg_split("/[:!@]/", $this->BufferBits[0], 0, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE);
  17.             $this->Peron = array (
  18.                 'NICKNAME'  =>  $PersonRegex[0],
  19.                 'HOST'      =>  $PersonRegex[2],
  20.                 'IDENT'     =>  $PersonRegex[1]
  21.             );
  22.             $this->Command = $this->BufferBits[3];
  23.             foreach ($this->Mods as $Mod) {
  24.                 $this->$Mod->PassInfo($Command = $this->Command);
  25.             }
  26.             print_r($this->Buffer);
  27.             echo "\r\n";
  28.             print_r($this->BufferBits);
  29.             echo "\r\n";
  30.         }
  31.     }
  32. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement