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:  * @Instance
  7:  *
  8:  * Commands this class contains:
  9:  *  @DefineCommand(
 10:  *      command     = 'rally',
 11:  *      accessLevel = 'all',
 12:  *      description = 'Shows the rally waypoint',
 13:  *      help        = 'rally.txt'
 14:  *  )
 15:  *  @DefineCommand(
 16:  *      command     = 'rally .+',
 17:  *      accessLevel = 'rl',
 18:  *      description = 'Sets the rally waypoint',
 19:  *      help        = 'rally.txt'
 20:  *  )
 21:  */
 22: class ChatRallyController {
 23:     /** @Inject */
 24:     public $settingManager;
 25: 
 26:     /** @Inject */
 27:     public $text;
 28: 
 29:     /** @Inject */
 30:     public $playfieldController;
 31: 
 32:     /** @Inject */
 33:     public $chatBot;
 34: 
 35:     /** @Inject */
 36:     public $chatLeaderController;
 37: 
 38:     /**
 39:      * @Setting("rally")
 40:      * @Description("Rally waypoint for topic")
 41:      * @Visibility("noedit")
 42:      * @Type("text")
 43:      */
 44:     public $defaultRally = "";
 45: 
 46:     /**
 47:      * This command handler ...
 48:      * @HandlesCommand("rally")
 49:      * @Matches("/^rally$/i")
 50:      */
 51:     public function rallyCommand($message, $channel, $sender, $sendto, $args) {
 52:         $this->replyCurrentRally($channel, $sendto);
 53:     }
 54:     
 55:     /**
 56:      * This command handler ...
 57:      * @HandlesCommand("rally .+")
 58:      * @Matches("/^rally clear$/i")
 59:      */
 60:     public function rallyClearCommand($message, $channel, $sender, $sendto, $args) {
 61:         if (!$this->chatLeaderController->checkLeaderAccess($sender)) {
 62:             $sendto->reply("You must be Raid Leader to use this command.");
 63:             return;
 64:         }
 65: 
 66:         $this->clear();
 67:         $msg = "Rally has been cleared.";
 68:         $sendto->reply($msg);
 69:     }
 70: 
 71:     /**
 72:      * This command handler sets rally waypoint, using following example syntaxes:
 73:      *  - rally 10.9 x 30 x <playfield id/name>
 74:      *  - rally 10.9 . 30 . <playfield id/name>
 75:      *  - rally 10.9, 30, <playfield id/name>
 76:      *  - etc...
 77:      *
 78:      * @HandlesCommand("rally .+")
 79:      * @Matches("/^rally ([0-9\.]+)([x,. ]+)([0-9\.]+)([x,. ]+)([^ ]+)$/i")
 80:      */
 81:     public function rallySet2Command($message, $channel, $sender, $sendto, $args) {
 82:         if (!$this->chatLeaderController->checkLeaderAccess($sender)) {
 83:             $sendto->reply("You must be Raid Leader to use this command.");
 84:             return;
 85:         }
 86: 
 87:         $xCoords = $args[1];
 88:         $yCoords = $args[3];
 89: 
 90:         if (is_numeric($args[5])) {
 91:             $playfieldId = $args[5];
 92:             $playfieldName = $playfieldId;
 93: 
 94:             $playfield = $this->playfieldController->getPlayfieldById($playfieldId);
 95:             if ($playfield !== null) {
 96:                 $playfieldName = $playfield->short_name;
 97:             }
 98:         } else {
 99:             $playfieldName = $args[5];
100:             $playfield = $this->playfieldController->getPlayfieldByName($playfieldName);
101:             if ($playfield === null) {
102:                 $sendto->reply("Could not find playfield '$playfieldName'");
103:                 return;
104:             }
105:             $playfieldId = $playfield->id;
106:         }
107:         $this->set($playfieldName, $playfieldId, $xCoords, $yCoords);
108: 
109:         $this->replyCurrentRally($channel, $sendto);
110:     }
111:     
112:     /**
113:      * This command handler sets rally waypoint, using following example syntaxes:
114:      *  - rally (10.9 30 y 20 2434234)
115:      *
116:      * @HandlesCommand("rally .+")
117:      * @Matches("/^rally (.+)$/i")
118:      */
119:     public function rallySet1Command($message, $channel, $sender, $sendto, $args) {
120:         if (!$this->chatLeaderController->checkLeaderAccess($sender)) {
121:             $sendto->reply("You must be Raid Leader to use this command.");
122:             return;
123:         }
124: 
125:         if (preg_match("/(\d+\.\d) (\d+\.\d) y \d+\.\d (\d+)/", $args[1], $matches)) {
126:             $xCoords = $matches[1];
127:             $yCoords = $matches[2];
128:             $playfieldId = $matches[3];
129:         } else {
130:             return false;
131:         }
132: 
133:         $name = $playfieldId;
134:         $playfield = $this->playfieldController->getPlayfieldById($playfieldId);
135:         if ($playfield !== null) {
136:             $name = $playfield->short_name;
137:         }
138:         $this->set($name, $playfieldId, $xCoords, $yCoords);
139: 
140:         $this->replyCurrentRally($channel, $sendto);
141:     }
142: 
143:     /**
144:      * @Event("joinpriv")
145:      * @Description("Sends rally to players joining the private channel")
146:      */
147:     public function sendRally($eventObj) {
148:         $sender = $eventObj->sender;
149: 
150:         $rally = $this->get();
151:         if ('' != $rally) {
152:             $this->chatBot->sendTell($rally, $sender);
153:         }
154:     }
155: 
156:     public function set($name, $playfieldId, $xCoords, $yCoords) {
157:         $link = $this->text->makeChatcmd("Rally: {$xCoords}x{$yCoords} {$name}", "/waypoint {$xCoords} {$yCoords} {$playfieldId}");
158:         $blob = "Click here to use rally: $link";
159:         $rally = $this->text->makeBlob("Rally: {$xCoords}x{$yCoords} {$name}", $blob);
160: 
161:         $this->settingManager->save("rally", $rally);
162: 
163:         return $rally;
164:     }
165: 
166:     public function get() {
167:         return $this->settingManager->get("rally");
168:     }
169: 
170:     public function clear() {
171:         $this->settingManager->save("rally", '');
172:     }
173:     
174:     public function replyCurrentRally($channel, $sendto) {
175:         $rally = $this->get();
176:         if ('' == $rally) {
177:             $msg = "No rally set.";
178:             $sendto->reply($msg);
179:             return;
180:         }
181:         $sendto->reply($rally);
182:     }
183: }
184: 
Budabot 4 Docs API documentation generated by ApiGen