Overview

Namespaces

  • Budabot
    • Core
      • Modules
    • User
      • Modules
  • None
  • Tyrence
    • Modules

Classes

  • AccessLevel
  • Budabot\Core\AccessManager
  • Budabot\Core\AdminManager
  • Budabot\Core\AOChat
  • Budabot\Core\AOChatPacket
  • Budabot\Core\AOChatQueue
  • Budabot\Core\AOExtMsg
  • Budabot\Core\AsyncHttp
  • Budabot\Core\AutoInject
  • Budabot\Core\BotRunner
  • Budabot\Core\Budabot
  • Budabot\Core\BuddylistManager
  • Budabot\Core\CacheManager
  • Budabot\Core\CacheResult
  • Budabot\Core\ClassLoader
  • Budabot\Core\ColorSettingHandler
  • Budabot\Core\CommandAlias
  • Budabot\Core\CommandManager
  • Budabot\Core\ConfigFile
  • Budabot\Core\DB
  • Budabot\Core\DBRow
  • Budabot\Core\EventLoop
  • Budabot\Core\EventManager
  • Budabot\Core\GuildChannelCommandReply
  • Budabot\Core\GuildManager
  • Budabot\Core\HelpManager
  • Budabot\Core\Http
  • Budabot\Core\HttpRequest
  • Budabot\Core\LegacyLogger
  • Budabot\Core\LimitsController
  • Budabot\Core\LoggerWrapper
  • Budabot\Core\MMDBParser
  • Budabot\Core\Modules\AdminController
  • Budabot\Core\Modules\AliasController
  • Budabot\Core\Modules\AltInfo
  • Budabot\Core\Modules\AltsController
  • Budabot\Core\Modules\BanController
  • Budabot\Core\Modules\BuddylistController
  • Budabot\Core\Modules\ColorsController
  • Budabot\Core\Modules\CommandlistController
  • Budabot\Core\Modules\CommandSearchController
  • Budabot\Core\Modules\ConfigController
  • Budabot\Core\Modules\EventlistController
  • Budabot\Core\Modules\HelpController
  • Budabot\Core\Modules\LogsController
  • Budabot\Core\Modules\PlayerLookupController
  • Budabot\Core\Modules\ProfileCommandReply
  • Budabot\Core\Modules\ProfileController
  • Budabot\Core\Modules\SettingsController
  • Budabot\Core\Modules\SQLController
  • Budabot\Core\Modules\SystemController
  • Budabot\Core\Modules\UsageController
  • Budabot\Core\Modules\WhitelistController
  • Budabot\Core\NumberSettingHandler
  • Budabot\Core\OptionsSettingHandler
  • Budabot\Core\PlayerHistory
  • Budabot\Core\PlayerHistoryManager
  • Budabot\Core\PlayerManager
  • Budabot\Core\Preferences
  • Budabot\Core\PrivateChannelCommandReply
  • Budabot\Core\PrivateMessageCommandReply
  • Budabot\Core\Registry
  • Budabot\Core\SettingHandler
  • Budabot\Core\SettingManager
  • Budabot\Core\SettingObject
  • Budabot\Core\SocketManager
  • Budabot\Core\SocketNotifier
  • Budabot\Core\SubcommandManager
  • Budabot\Core\Text
  • Budabot\Core\TextSettingHandler
  • Budabot\Core\Timer
  • Budabot\Core\TimerEvent
  • Budabot\Core\TimeSettingHandler
  • Budabot\Core\Util
  • Budabot\Core\xml
  • Budabot\User\Modules\AlienArmorController
  • Budabot\User\Modules\AlienBioController
  • Budabot\User\Modules\AlienMiscController
  • Budabot\User\Modules\AOSpeakController
  • Budabot\User\Modules\AOUController
  • Budabot\User\Modules\AXPController
  • Budabot\User\Modules\BankController
  • Budabot\User\Modules\BosslootController
  • Budabot\User\Modules\BroadcastController
  • Budabot\User\Modules\BuffPerksController
  • Budabot\User\Modules\CacheController
  • Budabot\User\Modules\ChatAssistController
  • Budabot\User\Modules\ChatCheckController
  • Budabot\User\Modules\ChatLeaderController
  • Budabot\User\Modules\ChatRallyController
  • Budabot\User\Modules\ChatSayController
  • Budabot\User\Modules\ChatTopicController
  • Budabot\User\Modules\CityWaveController
  • Budabot\User\Modules\CloakController
  • Budabot\User\Modules\ClusterController
  • Budabot\User\Modules\CountdownController
  • Budabot\User\Modules\DevController
  • Budabot\User\Modules\DingController
  • Budabot\User\Modules\EventsController
  • Budabot\User\Modules\FightController
  • Budabot\User\Modules\FindOrgController
  • Budabot\User\Modules\FindPlayerController
  • Budabot\User\Modules\FunController
  • Budabot\User\Modules\GitController
  • Budabot\User\Modules\GuideController
  • Budabot\User\Modules\GuildController
  • Budabot\User\Modules\HelpbotController
  • Budabot\User\Modules\HtmlDecodeController
  • Budabot\User\Modules\ImplantController
  • Budabot\User\Modules\ImplantDesignerController
  • Budabot\User\Modules\InactiveMemberController
  • Budabot\User\Modules\ItemsController
  • Budabot\User\Modules\KillOnSightController
  • Budabot\User\Modules\LevelController
  • Budabot\User\Modules\LinksController
  • Budabot\User\Modules\LootListsController
  • Budabot\User\Modules\MdbController
  • Budabot\User\Modules\MessageInfoCommandReply
  • Budabot\User\Modules\MockCommandReply
  • Budabot\User\Modules\NanoController
  • Budabot\User\Modules\NewsController
  • Budabot\User\Modules\NotesController
  • Budabot\User\Modules\OnlineController
  • Budabot\User\Modules\OrgHistoryController
  • Budabot\User\Modules\OrglistController
  • Budabot\User\Modules\OrgMembersController
  • Budabot\User\Modules\OSController
  • Budabot\User\Modules\PlayerHistoryController
  • Budabot\User\Modules\PlayfieldController
  • Budabot\User\Modules\PocketbossController
  • Budabot\User\Modules\PremadeImplantController
  • Budabot\User\Modules\PrivateChannelController
  • Budabot\User\Modules\QuoteController
  • Budabot\User\Modules\RaffleController
  • Budabot\User\Modules\RaidController
  • Budabot\User\Modules\RandomController
  • Budabot\User\Modules\RecipeController
  • Budabot\User\Modules\RelayController
  • Budabot\User\Modules\ReputationController
  • Budabot\User\Modules\ResearchController
  • Budabot\User\Modules\RunAsController
  • Budabot\User\Modules\SendTellController
  • Budabot\User\Modules\ShoppingController
  • Budabot\User\Modules\SilenceController
  • Budabot\User\Modules\SkillsController
  • Budabot\User\Modules\SpiritsController
  • Budabot\User\Modules\StopwatchController
  • Budabot\User\Modules\Teamspeak3
  • Budabot\User\Modules\TeamspeakController
  • Budabot\User\Modules\TestController
  • Budabot\User\Modules\TimeController
  • Budabot\User\Modules\TimerController
  • Budabot\User\Modules\TimezoneController
  • Budabot\User\Modules\TowerController
  • Budabot\User\Modules\TrackerController
  • Budabot\User\Modules\TrickleController
  • Budabot\User\Modules\UnixtimeController
  • Budabot\User\Modules\VoteController
  • Budabot\User\Modules\WeatherController
  • Budabot\User\Modules\WhatBuffsController
  • Budabot\User\Modules\WhereisController
  • Budabot\User\Modules\WhoisController
  • Budabot\User\Modules\WhoisOrgController
  • Budabot\User\Modules\WhompahController
  • Command
  • DefaultStatus
  • DefineCommand
  • Description
  • Event
  • HandlesCommand
  • Help
  • Inject
  • Instance
  • Intoptions
  • Matches
  • Options
  • Setting
  • Setup
  • Type
  • Tyrence\Modules\DemoResponseCommandReply
  • Tyrence\Modules\SameChannelResponseController
  • Visibility

Interfaces

  • Budabot\Core\CommandReply

Exceptions

  • Budabot\Core\InvalidHttpRequest
  • Budabot\Core\SQLException
  • Budabot\Core\StopExecutionException

Functions

  • Budabot\Core\isWindows
  • Budabot\Core\Modules\read_input
  • Overview
  • Namespace
  • Class
  1: <?php
  2: 
  3: namespace Budabot\User\Modules;
  4: 
  5: /**
  6:  * Author:
  7:  *  - Tyrence (RK2)
  8:  *
  9:  * @Instance
 10:  *
 11:  * Commands this controller contains:
 12:  *  @DefineCommand(
 13:  *      command     = 'beer',
 14:  *      accessLevel = 'all',
 15:  *      description = 'Shows a random beer message',
 16:  *      help        = 'fun_module.txt'
 17:  *  )
 18:  *  @DefineCommand(
 19:  *      command     = 'brain',
 20:  *      accessLevel = 'all',
 21:  *      description = 'Shows a random pinky and the brain quote',
 22:  *      help        = 'fun_module.txt',
 23:  *      alias       = 'pinky'
 24:  *  )
 25:  *  @DefineCommand(
 26:  *      command     = 'chuck',
 27:  *      accessLevel = 'all',
 28:  *      description = 'Shows a random Chuck Norris joke',
 29:  *      help        = 'fun_module.txt'
 30:  *  )
 31:  *  @DefineCommand(
 32:  *      command     = 'cybor',
 33:  *      accessLevel = 'all',
 34:  *      description = 'Shows a random cybor message',
 35:  *      help        = 'fun_module.txt'
 36:  *  )
 37:  *  @DefineCommand(
 38:  *      command     = 'dwight',
 39:  *      accessLevel = 'all',
 40:  *      description = 'Shows a random Dwight quote',
 41:  *      help        = 'fun_module.txt'
 42:  *  )
 43:  *  @DefineCommand(
 44:  *      command     = 'fc',
 45:  *      accessLevel = 'all',
 46:  *      description = 'Shows a random FC quote',
 47:  *      help        = 'fun_module.txt'
 48:  *  )
 49:  *  @DefineCommand(
 50:  *      command     = 'homer',
 51:  *      accessLevel = 'all',
 52:  *      description = 'Shows a random homer quote',
 53:  *      help        = 'fun_module.txt'
 54:  *  )
 55:  *  @DefineCommand(
 56:  *      command     = 'pirates',
 57:  *      accessLevel = 'all',
 58:  *      description = 'Shows a random Pirates of the Caribbean quote',
 59:  *      help        = 'fun_module.txt'
 60:  *  )
 61:  */
 62: class FunController {
 63: 
 64:     /**
 65:      * Name of the module.
 66:      * Set automatically by module loader.
 67:      */
 68:     public $moduleName;
 69: 
 70:     /** @Inject */
 71:     public $chatBot;
 72:     
 73:     /** @Inject */
 74:     public $db;
 75: 
 76:     /** @Inject */
 77:     public $util;
 78:     
 79:     /**
 80:      * @Setup
 81:      */
 82:     public function setup() {
 83:         $this->db->loadSQLFile($this->moduleName, "fun");
 84:         $this->db->loadSQLFile($this->moduleName, "beer");
 85:         $this->db->loadSQLFile($this->moduleName, "brain");
 86:         $this->db->loadSQLFile($this->moduleName, "chuck");
 87:         $this->db->loadSQLFile($this->moduleName, "cybor");
 88:         $this->db->loadSQLFile($this->moduleName, "dwight");
 89:         $this->db->loadSQLFile($this->moduleName, "fc");
 90:         $this->db->loadSQLFile($this->moduleName, "homer");
 91:         $this->db->loadSQLFile($this->moduleName, "pirates");
 92:     }
 93:     
 94:     public function getFunItem($type, $sender, $number = null) {
 95:         $data = $this->db->query("SELECT * FROM fun WHERE type = ?", $type);
 96:         if ($number === null) {
 97:             $row = $this->util->randomArrayValue($data);
 98:         } else {
 99:             $row = $data[$number];
100:         }
101:         
102:         if ($row === null) {
103:             $msg = "There is no item with that id.";
104:         } else {
105:             $dmg = rand(100, 999);
106:             $cred = rand(10000, 9999999);
107:             $msg = $row->content;
108:             $msg = str_replace("*name*", $sender, $msg);
109:             $msg = str_replace("*dmg*", $dmg, $msg);
110:             $msg = str_replace("*creds*", $cred, $msg);
111:         }
112:         
113:         return $msg;
114:     }
115:     
116:     /**
117:      * @HandlesCommand("beer")
118:      * @Matches("/^beer$/i")
119:      * @Matches("/^beer (\d+)$/i")
120:      */
121:     public function beerCommand($message, $channel, $sender, $sendto, $args) {
122:         $msg = $this->getFunItem('beer', $sender, $args[1]);
123:         $sendto->reply($msg);
124:     }
125:     
126:     /**
127:      * @HandlesCommand("brain")
128:      * @Matches("/^brain$/i")
129:      * @Matches("/^brain (\d+)$/i")
130:      *
131:      * aypwip.php - A Social Worrrrrld Domination! Module
132:      *
133:      * Developed by Mastura (RK2/Rimor) from Shadow Ops
134:      * from Anarchy Online.
135:      * converted to Budabot by Tyrence (RK2)
136:      */
137:     public function brainCommand($message, $channel, $sender, $sendto, $args) {
138:         $msg = $this->getFunItem('brain', $sender, $args[1]);
139:         $sendto->reply($msg);
140:     }
141:     
142:     /**
143:      * @HandlesCommand("chuck")
144:      * @Matches("/^chuck$/i")
145:      * @Matches("/^chuck (\d+)$/i")
146:      *
147:      * Author: Honge (RK2)
148:      *
149:      * Additions taken from a module written by Temar for Bebot: http://bebot.shadow-realm.org/0-3-x-customunofficial-modules/chuck-norris/
150:      */
151:     public function chuckCommand($message, $channel, $sender, $sendto, $args) {
152:         $msg = $this->getFunItem('chuck', $sender, $args[1]);
153:         $sendto->reply($msg);
154:     }
155:     
156:     /**
157:      * @HandlesCommand("cybor")
158:      * @Matches("/^cybor$/i")
159:      * @Matches("/^cybor (\d+)$/i")
160:      *
161:      * Author: Derroylo (RK2)
162:      *
163:      * Ported over from a bebot plugin written by Xenixa (RK1)
164:      */
165:     public function cyborCommand($message, $channel, $sender, $sendto, $args) {
166:         $msg = $this->getFunItem('cybor', $sender, $args[1]);
167:         $sendto->reply($msg);
168:     }
169:     
170:     /**
171:      * @HandlesCommand("dwight")
172:      * @Matches("/^dwight$/i")
173:      * @Matches("/^dwight (\d+)$/i")
174:      *
175:      * Developed by Sicarius Legion of Amra, a Age of Conan Guild on the Hyrkania server
176:      * Converted to Budabot by Tyrence (RK2)
177:      */
178:     public function dwightCommand($message, $channel, $sender, $sendto, $args) {
179:         $msg = $this->getFunItem('dwight', $sender, $args[1]);
180:         $sendto->reply($msg);
181:     }
182: 
183:     /**
184:      * @HandlesCommand("fc")
185:      * @Matches("/^fc$/i")
186:      * @Matches("/^fc (\d+)$/i")
187:      */
188:     public function fcCommand($message, $channel, $sender, $sendto, $args) {
189:         $msg = $this->getFunItem('fc', $sender, $args[1]);
190:         $sendto->reply($msg);
191:     }
192:     
193:     /**
194:      * @HandlesCommand("homer")
195:      * @Matches("/^homer$/i")
196:      * @Matches("/^homer (\d+)$/i")
197:      *
198:      * Author: Derroylo (RK2)
199:      * 
200:      * Some entries taken from a module developed by MysterF aka Floryn from Band of Brothers - CROM originally for Bebot: http://bebot.shadow-realm.org/generic-custom-modules/homer-social-mod-for-bebot-0-6-2
201:      */
202:     public function homerCommand($message, $channel, $sender, $sendto, $args) {
203:         $msg = $this->getFunItem('homer', $sender, $args[1]);
204:         $sendto->reply($msg);
205:     }
206:     
207:     /**
208:      * @HandlesCommand("pirates")
209:      * @Matches("/^pirates$/i")
210:      * @Matches("/^pirates (\d+)$/i")
211:      *
212:      * Developed by Sicarius Legion of Amra, a Age of Conan Guild on the Hyrkania server
213:      * Converted to Budabot by Tyrence (RK2)
214:      */
215:     public function piratesCommand($message, $channel, $sender, $sendto, $args) {
216:         $msg = $this->getFunItem('pirates', $sender, $args[1]);
217:         $sendto->reply($msg);
218:     }
219: }
220: 
Budabot 4 Docs API documentation generated by ApiGen