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:  * Authors: 
  7:  *  - Tyrence (RK2)
  8:  *
  9:  * @Instance
 10:  *
 11:  * Commands this class contains:
 12:  *  @DefineCommand(
 13:  *      command     = 'aospeak',
 14:  *      accessLevel = 'all',
 15:  *      description = 'Show org members connected to AOSpeak server',
 16:  *      help        = 'aospeak.txt'
 17:  *  )
 18:  */
 19: class AOSpeakController {
 20: 
 21:     /**
 22:      * Name of the module.
 23:      * Set automatically by module loader.
 24:      */
 25:     public $moduleName;
 26:     
 27:     /** @Inject */
 28:     public $chatBot;
 29: 
 30:     /** @Inject */
 31:     public $http;
 32: 
 33:     /** @Inject */
 34:     public $text;
 35: 
 36:     /** @Inject */
 37:     public $util;
 38:     
 39:     /**
 40:      * @HandlesCommand("aospeak")
 41:      * @Matches("/^aospeak org$/i")
 42:      */
 43:     public function aospeakOrgCommand($message, $channel, $sender, $sendto, $args) {
 44:         $url = "http://api.aospeak.com/org/" . $this->chatBot->vars['dimension'] . "/" . $this->chatBot->vars['my_guild_id'];
 45:         $results = $this->http->get($url)->waitAndReturnResponse()->body;
 46: 
 47:         if ($results == "ORG_NOT_FOUND") {
 48:             $msg = "Your org is not currently set up on AOSpeak. Please have your org president set up a channel first.";
 49:             $sendto->reply($msg);
 50:             return;
 51:         }
 52: 
 53:         $users = json_decode($results);
 54:         $count = count($users);
 55:         if ($count == 0) {
 56:             $msg = "No org members currently connected to AOSpeak.";
 57:         } else {
 58:             $blob = "Server: <highlight>voice.aospeak.com<end>";
 59:             $blob .= "\n\nUsers:\n";
 60:             forEach ($users as $user) {
 61:                 if ($user->idleTime >= 300000) {
 62:                     // if idle for at least 5 minutes
 63:                     $blob .= "<highlight>{$user->name}<end> ({$user->country}, idle for " . $this->util->unixtimeToReadable($user->idleTime / 1000, false) . ")\n";
 64:                 } else {
 65:                     $blob .= "<highlight>{$user->name}<end> ({$user->country})\n";
 66:                 }
 67:             }
 68:             $blob .= "\n\nProvided by " . $this->text->makeChatcmd("AOSpeak.com", "/start http://www.aospeak.com");
 69:             $msg = $this->text->makeBlob("AOSpeak Org ($count)", $blob);
 70:         }
 71: 
 72:         $sendto->reply($msg);
 73:     }
 74:     
 75:     /**
 76:      * @HandlesCommand("aospeak")
 77:      * @Matches("/^aospeak$/i")
 78:      * @Matches("/^aospeak (\d)$/i")
 79:      */
 80:     public function aospeakCommand($message, $channel, $sender, $sendto, $args) {
 81:         if (count($args) == 2) {
 82:             $title = "AOSpeak Online RK" . $args[1];
 83:             $url = "http://api.aospeak.com/online/" . $args[1];
 84:         } else {
 85:             $title = "AOSpeak Online";
 86:             $url = "http://api.aospeak.com/online/";
 87:         }
 88:         $results = $this->http->get($url)->waitAndReturnResponse()->body;
 89: 
 90:         $users = json_decode($results);
 91:         $count = count($users);
 92:         if ($count == 0) {
 93:             $msg = "No players currently connected to AOSpeak.";
 94:         } else {
 95:             $blob = "Server: <highlight>voice.aospeak.com<end>\n";
 96: 
 97:             $channels = array();
 98:             forEach ($users as $user) {
 99:                 $channels[$user->channelName] []= $user;
100:             }
101: 
102:             forEach ($channels as $name => $users) {
103:                 $blob .= "\n<header2>$name<end>\n";
104:                 forEach ($users as $user) {
105:                     $country = empty($user->country) ? "Unknown" : $user->country;
106:                     if ($user->idleTime >= 300000) {
107:                         // if idle for at least 5 minutes
108:                         $blob .= "<tab><highlight>{$user->name}<end> ($country, idle for " . $this->util->unixtimeToReadable($user->idleTime / 1000, false) . ")\n";
109:                     } else {
110:                         $blob .= "<tab><highlight>{$user->name}<end> ($country)\n";
111:                     }
112:                 }
113:             }
114:             $blob .= "\n\nProvided by " . $this->text->makeChatcmd("AOSpeak.com", "/start http://www.aospeak.com");
115:             $msg = $this->text->makeBlob("$title ($count)", $blob);
116:         }
117: 
118:         $sendto->reply($msg);
119:     }
120: }
121: 
Budabot 4 Docs API documentation generated by ApiGen