/modules/UserActions.php
PHP | 103 lines | 103 code | 0 blank | 0 comment | 6 complexity | 916dd4664c6ba81dbeae1fd499db8537 MD5 | raw file
- <?php
- Class UserActions extends eBot {
- public function run($buffer) {
- $bArray=explode(" ",$buffer['text']);
- switch($bArray[0]) {
- case "!endrey": {
- $this->endrey($buffer, $bArray);
- }
- break;
- case "!bane": {
- $this->bane($buffer);
- }
- break;
- case "!sean": {
- $this->sean($buffer);
- }
- break;
- case ".-": {
- $this->dotDash($buffer);
- }
- break;
- case "!goody": {
- $this->goody($buffer);
- }
- break;
- case "!gnu": {
- $this->gnu($buffer);
- }
- break;
- case "!who": {
- $this->who($buffer);
- }
- break;
- case "!ni": {
- $this->swallow($buffer);
- }
- break;
- case "!reboot": {
- $this->reboot($buffer);
- }
- break;
- }
- }
- private function endrey($buffer, $bArray) {
- $r=$bArray[1];
- settype($r,'int');
- $r=abs($r);
- $data=file_get_contents("endrey.txt");
- $data=explode("\n",$data);
- $data=array_filter($data);
- if(empty($r)) {
- $r=mt_rand(0,sizeof($data)-1);
- }
- else {
- $r--;
- }
- if($r>sizeof($data)) {
- $this->send("PRIVMSG $buffer[channel] :Sorry that number is too high\n");
- }
- else {
- $this->send("PRIVMSG $buffer[channel] :[".($r+1)."] ".$data[$r]."\n");
- }
- unset($data, $r, $num);
- }
- private function bane($buffer) {
- $this->send("PRIVMSG $buffer[channel] :AHHHHH! A baneling!\n");
- $this->send("PART $buffer[channel]\n");
- sleep(5);
- $this->send("JOIN $buffer[channel]\n");
- sleep(1);
- $this->send("PRIVMSG $buffer[channel] :".chr(1)."ACTION looks around\n");
- $this->send("PRIVMSG $buffer[channel] :Is it gone?\n");
- }
- private function sean($buffer) {
- $string="Not the Mama! ";
- if($this->inChannel('bane',$buffer['channel']) || $this->inChannel('bane_',$buffer['channel'])) {
- $string.=" *looks at bane* the Mama!!";
- }
- $this->send("PRIVMSG $buffer[channel] :$string\n");
- }
- private function dotDash($buffer) {
- $this->send("PRIVMSG $buffer[channel] :()()\n");
- $this->send("PRIVMSG $buffer[channel] :( ^.^)\n");
- $this->send("PRIVMSG $buffer[channel] :((\")\")\n");
- }
- private function goody($buffer) {
- $this->send("PRIVMSG $buffer[channel] :Sorry but we failed to get in contact with Goody. None of our SCVs could get through his tank shell\n");
- }
- private function gnu($buffer) {
- $this->send("PRIVMSG $buffer[channel] :".chr(1)."ACTION looks confused\n");
- $this->send("PRIVMSG $buffer[channel] :who?\n");
- }
- private function who($buffer) {
- $this->send("PRIVMSG $buffer[channel] :Who's on first\n");
- }
- private function swallow($buffer) {
- $this->send("PRIVMSG $buffer[channel] :Ekki-Ekki-Ekki-Ekki-PTANG. Zoom-Boing. Z'nourrwringmm\n");
- }
- private function reboot($buffer) {
- $this->send("PRIVMSG $buffer[channel] :I'm sorry, $buffer[nickname]. I'm afraid I can't do that.\n");
- }
- }
- ?>