Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class Bot extends IRC {
- private $ModuleSystem;
- public function __construct() {
- $this->ModuleSystem = new Module();
- }
- public function Start() {
- $this->Connect(); //Connect that bot, yo...
- $this->Listener(); //Listen to it's shit, yo... lolz.
- }
- public function Listener() {
- while (1) { //This will be changed at some point, need to come up with a check system...
- $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.
- $BufferBits = explode(" ", $Buffer); // This breaks down the big line of shit into something more easy to base triggers off of...
- if ($BufferBits[0] == "PING") {
- $this->Write("PONG ".$BufferBits[1]."\r\n"); // PONG that PING the server sends, makes it so the bot doesn't ping out.
- }
- $this->ModuleSystem->GetBuffer($Buffer); //Sends the contents of Buffer to the module system.
- }
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement