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\Core\Modules;
  4: 
  5: /*
  6: ** Author: Derroylo (RK2)
  7: ** Description: Configuration of the Basicbot settings
  8: **
  9: ** Developed for: Budabot(http://sourceforge.net/projects/budabot)
 10: **
 11: ** Date(created): 15.01.2006
 12: ** Date(last modified): 22.07.2006
 13: **
 14: ** Copyright (C) 2006 Carsten Lohmann
 15: **
 16: ** Licence Infos:
 17: ** This file is part of Budabot.
 18: **
 19: ** Budabot is free software; you can redistribute it and/or modify
 20: ** it under the terms of the GNU General Public License as published by
 21: ** the Free Software Foundation; either version 2 of the License, or
 22: ** (at your option) any later version.
 23: **
 24: ** Budabot is distributed in the hope that it will be useful,
 25: ** but WITHOUT ANY WARRANTY; without even the implied warranty of
 26: ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 27: ** GNU General Public License for more details.
 28: **
 29: ** You should have received a copy of the GNU General Public License
 30: ** along with Budabot; if not, write to the Free Software
 31: ** Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 32: */
 33: 
 34: global $configFile;
 35: 
 36: function read_input ($output = "") {
 37:     echo $output;
 38:     return trim(fgets(STDIN));
 39: }
 40: 
 41: echo "             \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n";
 42: echo "             ***************************************************\n";
 43: echo "             You will need to provide some information\n";
 44: echo "             regarding the basic configuration of the bot.\n";
 45: echo "             ***************************************************\n";
 46: echo "             \n\n\n\n\n\n\n\n\n";
 47: $msg = "Press enter to continue. \n";
 48: $answer = strtolower(read_input($msg));
 49: 
 50: do {
 51:     echo "             \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n";
 52:     echo "             ***************************************************\n";
 53:     echo "             Enter the account username that contains the\n";
 54:     echo "             character the bot will run on. \n";
 55:     echo "             Remember this name is case-sensitive!\n";
 56:     echo "             ***************************************************\n";
 57:     echo "             \n\n\n\n\n\n\n\n\n";
 58:     $msg = "Enter the account username (case-senstitive): \n";
 59:     $vars["login"] = read_input($msg);
 60: } while ($vars["login"] == "");
 61: 
 62: do {
 63:     echo "             \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n";
 64:     echo "             ************************************************\n";
 65:     echo "             Enter the Password for the account.\n";
 66:     echo "             Remember this is also case-sensitive!\n";
 67:     echo "             ************************************************\n";
 68:     echo "             \n\n\n\n\n\n\n\n\n";
 69:     $msg = "Enter the account password (case-senstitive): \n";
 70:     $vars["password"] = read_input($msg);
 71: } while ($vars["password"] == "");
 72: 
 73: do {
 74:     echo "             \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n";
 75:     echo "             **************************************************\n";
 76:     echo "             Enter the dimension that the bot will run on.\n";
 77:     echo "             **************************************************\n";
 78:     echo "             \n\n\n\n\n\n\n\n\n";
 79:     $msg = "Choose a Dimension (5 = Rubi-Ka, 4 = Test): \n";
 80:     $vars["dimension"] = read_input($msg);
 81: } while ($vars["dimension"] != 4 && $vars["dimension"] != 5);
 82: 
 83: do {
 84:     echo "             \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n";
 85:     echo "             *******************************************************\n";
 86:     echo "             Enter the character the bot will run on.\n";
 87:     echo "             If the character does not already exist, close this\n";
 88:     echo "             and create the character and then start the bot again.\n";
 89:     echo "             Make sure the bot toon is not currently logged on\n";
 90:     echo "             or the bot will not be able to log on.\n";
 91:     echo "             *******************************************************\n";
 92:     echo "             \n\n\n\n\n\n\n\n";
 93:     $msg = "Enter the Character the bot will run as: \n";
 94:     $vars["name"] = read_input($msg);
 95: } while ($vars["name"] == "");
 96: 
 97: echo "             \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n";
 98: echo "             ***************************************************\n";
 99: echo "             To run the bot as a raid bot, leave this setting blank.\n";
100: echo "             To run the bot as an org bot, enter the organization name.\n";
101: echo "             The organization name must match exactly including case\n";
102: echo "             and punctuation!\n";
103: echo "             ***************************************************\n";
104: echo "             \n\n\n\n\n\n\n\n\n";
105: $msg = "Enter your Guild (leave blank if this will be a raid bot): \n";
106: $vars["my_guild"] = read_input($msg);
107: 
108: do {
109:     echo "             \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n";
110:     echo "             ********************************************************\n";
111:     echo "             Who should be the Administrator for this bot?\n";
112:     echo "             This is the character that has access to all commands\n";
113:     echo "             and settings for this bot.\n";
114:     echo "             ********************************************************\n";
115:     echo "             \n\n\n\n\n\n\n\n\n";
116:     $msg = "Enter the Administrator for this bot: \n";
117: 
118:     $vars["SuperAdmin"] = read_input($msg);
119: } while ($vars["SuperAdmin"] == "");
120: 
121: do {
122:     echo "             \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n";
123:     echo "             *********************************************************\n";
124:     echo "             Now we are coming to the 'heart' of this bot,\n";
125:     echo "             the database system where nearly everything is\n";
126:     echo "             stored. You have 2 options now. Either you can\n";
127:     echo "             set it up manually or leave the default setting.\n";
128:     echo "             The default setting is recommended for normal\n";
129:     echo "             users. If you choose to set it up manually\n";
130:     echo "             you will be able to choose between\n";
131:     echo "             Mysql and Sqlite.\n";
132:     echo "             *********************************************************\n";
133:     echo "             \n\n\n\n\n\n\n";
134:     $msg = "Do you want to setup the database manually (yes/no - Recommended): \n";
135:     $mansetupdb = strtolower(read_input($msg));
136: } while ($mansetupdb != "no" && $mansetupdb != "yes");
137: 
138: if (strtolower($mansetupdb) == "yes") {
139:     do {
140:         echo "             \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n";
141:         echo "             *********************************************************\n";
142:         echo "             The bot is able to use 2 different Database Types.\n";
143:         echo "             1 = Sqlite. It is the easiest way to go and provides\n";
144:         echo "                 faster bot startup than MySQL.\n";
145:         echo "             2 = MySQL. An Open-Source Database.\n";
146:         echo "                 You need to install and setup it manually\n";
147:         echo "                 http://www.mysql.com/\n";
148:         echo "                 Be aware that when you set it up incorrectly\n";
149:         echo "                 it can be slower than Sqlite!\n";
150:         echo "             *********************************************************\n";
151:         echo "             \n\n\n\n\n\n\n";
152:         $msg = "Choose a Database system (1 = Sqlite - Recommended, 2 = MySQL): \n";
153:         $vars["DB Type"] = read_input($msg);
154:     } while (strtolower($vars["DB Type"]) != "1" && strtolower($vars["DB Type"]) != "2");
155: 
156:     switch($vars["DB Type"]) {
157:         case "1":
158:             $vars["DB Type"] = "sqlite";
159:         break;
160:         case "2":
161:             $vars["DB Type"] = "mysql";
162:         break;
163:     }
164:     echo "             \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n";
165:     echo "             *********************************************************\n";
166:     echo "             What is the name of the database that you\n";
167:     echo "             wannna use?\n";
168:     if ($vars["DB Type"] == "sqlite") {
169:         echo "             (This is the filename of the database)\n";
170:         echo "             (Default: budabot.db)\n";
171:     } else {
172:         echo "             (Default: budabot)\n";
173:     }
174:     echo "             *********************************************************\n";
175:     echo "             \n\n\n\n\n\n\n\n";
176:     $msg = "Enter the Databasename(leave blank for default setting): \n";
177:     $vars["DB Name"] = read_input($msg);
178: 
179:     if ($vars["DB Name"] == "" && $vars["DB Type"] == "sqlite") {
180:         $vars["DB Name"] = "budabot.db";
181:     } else if ($vars["DB Name"] == "" && $vars["DB Type"] == "mysql") {
182:         $vars["DB Name"] = "budabot";
183:     }
184: 
185:     if ($vars["DB Type"] == "mysql") {
186:         echo "             \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n";
187:         echo "             **********************************************\n";
188:         echo "             On what Host is the Database running?\n";
189:         echo "             If it is running on this PC use:\n";
190:         echo "             localhost or 127.0.0.1\n";
191:         echo "             otherwise insert Hostname or IP\n";
192:         echo "             (Default: localhost)\n";
193:         echo "             **********************************************\n";
194:         echo "             \n\n\n\n\n\n\n\n\n";
195:         $msg = "Enter the Hostname for the Database (leave blank for default setting): \n";
196:         $vars["DB Host"] = read_input($msg);
197: 
198:         if ($vars["DB Host"] == "") {
199:             $vars["DB Host"] = "localhost";
200:         }
201:         echo "             \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n";
202:         echo "             **********************************************\n";
203:         echo "             What is the username for the MySQL Database?\n";
204:         echo "             If you did not specify a username when you installed\n";
205:         echo "             the Database then it will be 'root'\n";
206:         echo "             (Default: root)\n";
207:         echo "             **********************************************\n";
208:         echo "             \n\n\n\n\n\n\n\n";
209:         $msg = "Enter username for the Database (leave blank for default setting): \n";
210:         $vars["DB username"] = read_input($msg);
211: 
212:         if ($vars["DB username"] == "") {
213:             $vars["DB username"] = "root";
214:         }
215: 
216:         echo "             \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n";
217:         echo "             **********************************************\n";
218:         echo "             What is the password for the MySQL Database?\n";
219:         echo "             if you did not specify a username when you installed\n";
220:         echo "             the Database then it will be blank (none)\n";
221:         echo "             (Default: <blank>)\n";
222:         echo "             **********************************************\n";
223:         echo "             \n\n\n\n\n\n\n\n\n";
224:         $msg = "Enter password for the Database (leave blank for default setting): \n";
225:         $vars["DB password"] = read_input($msg);
226:     } else {
227:         echo "             \n\n\n\n\n\n\n\n\n\n\n\n\n\n";
228:         echo "             **********************************************\n";
229:         echo "             Where is the Sqlite Database stored?\n";
230:         echo "             You may leave this setting blank to use the default\n";
231:         echo "             location which is the Data dir of your bot folder.\n";
232:         echo "             The Database will be created if it does\n";
233:         echo "             not already exists.\n";
234:         echo "             (Default: ./data/)\n";
235:         echo "             **********************************************\n";
236:         echo "             \n\n\n\n\n\n\n";
237:         $msg = "Enter the path for the Database (leave blank for default setting):  \n";
238:         $vars["DB Host"] = read_input($msg);
239: 
240:         if ($vars["DB Host"] == "") {
241:             $vars["DB Host"] = "./data/";
242:         }
243:     }
244: }
245: 
246: do {
247:     echo "             \n\n\n\n\n\n\n\n\n\n\n\n\n\n";
248:     echo "             **********************************************\n";
249:     echo "             Do you want to have all modules/commands enabled\n";
250:     echo "             by default?\n";
251:     echo "             This is usefull when you are using this bot the\n";
252:     echo "             first time so that all commands are available\n";
253:     echo "             from the beginning.  If you say 'no' to this question\n";
254:     echo "             you will need to enable the commands manually.\n";
255:     echo "             (Recommended: yes)\n";
256:     echo "             **********************************************\n";
257:     echo "             \n\n\n\n\n\n\n";
258: 
259:     $msg = "Should all modules be enabled ? (yes - Recommended/no): \n";
260:     $vars["default_module_status"] = strtolower(read_input($msg));
261: } while ($vars["default_module_status"] != "yes" && $vars["default_module_status"] != "no");
262: 
263: if ($vars["default_module_status"] == "yes") {
264:     $vars["default_module_status"] = 1;
265: }
266: if ($vars["default_module_status"] == "no") {
267:     $vars["default_module_status"] = 0;
268: }
269: 
270: echo "         \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n";
271: echo "             **********************************************\n";
272: echo "             If you have entered everything correctly \n";
273: echo "             the bot should start.\n";
274: echo "             ----------------------------------------------\n";
275: echo "             We would appreciate any feedback you have.\n";
276: echo "             Comments and suggestions are more than welcome!\n";
277: echo "             www.budabot.com\n";
278: echo "             ----------------------------------------------\n";
279: echo "             Have a good day on Rubi-Ka.\n";
280: echo "             To rerun this setup simply delete your\n";
281: echo "             config file: {$configFile->getFilePath()}\n";
282: echo "             **********************************************\n";
283: echo "         \n\n\n\n\n";
284: $msg = "Press [Enter] to start the bot.\n";
285: read_input($msg);
286: 
287: //Save the entered info to $configFile
288: $configFile->insertVars($vars);
289: $configFile->save();
290: 
291: die("Restarting bot");
292: 
Budabot 4 Docs API documentation generated by ApiGen