Database Tables

From Bebot Wiki 2
Jump to navigationJump to search
BeBot Default Tables
BeBot 0.6 Default Tables

access_control

TABLE `access_control` ( `command` varchar(50) NOT NULL default , `subcommand` varchar(50) NOT NULL default '*', `channel` varchar(20) NOT NULL default , `minlevel` enum('ANONYMOUS','GUEST','MEMBER','LEADER','ADMIN','SUPERADMIN','OWNER','DISABLED','DELETED') NOT NULL default 'DISABLED', PRIMARY KEY (`command`,`subcommand`,`channel`) )

access_control_saves

TABLE `access_control_saves` ( `name` varchar(50) NOT NULL default , `description` varchar(150) default NULL, `commands` text NOT NULL, PRIMARY KEY (`name`) )

alias

TABLE `alias` ( `alias` varchar(30) NOT NULL, `nickname` varchar(30) default NULL, `main` int(1) default '0', PRIMARY KEY (`alias`) )

alts

TABLE `alts` ( `alt` varchar(255) NOT NULL, `main` varchar(255) default NULL, `confirmed` int(11) default '1', PRIMARY KEY (`alt`) )

bots

TABLE `bots` ( `ID` int(11) NOT NULL auto_increment, `bot` varchar(20) default NULL, `dim` varchar(20) NOT NULL default , `online` int(11) NOT NULL default '0', `time` int(11) NOT NULL default '0', `start` int(11) NOT NULL default '0', `total` int(11) NOT NULL default '0', `restarts` int(11) NOT NULL default '0', PRIMARY KEY (`ID`) )

bots_log

TABLE `bots_log` ( `ID` int(11) NOT NULL auto_increment, `bot` varchar(20) default NULL, `dim` varchar(20) NOT NULL default , `start` int(11) NOT NULL default '0', `end` int(11) NOT NULL default '0', PRIMARY KEY (`ID`) )

colors

TABLE `colors` ( `name` varchar(25) NOT NULL default , `code` varchar(25) NOT NULL default , PRIMARY KEY (`name`) )

color_schemes

TABLE `color_schemes` ( `module` varchar(25) NOT NULL default , `name` varchar(25) NOT NULL default , `color_code` varchar(25) NOT NULL default , PRIMARY KEY (`module`,`name`) )

command_alias

TABLE `command_alias` ( `alias` varchar(100) NOT NULL, `command` varchar(30) NOT NULL )

land_control_zones

TABLE `land_control_zones` ( `id` int(11) NOT NULL default '0', `lrange` int(10) default NULL, `hrange` int(10) default NULL, `area` varchar(50) default NULL, `huge` varchar(10) default NULL, `x` varchar(10) default NULL, `y` varchar(10) default NULL, `name` varchar(250) default NULL, PRIMARY KEY (`id`), UNIQUE KEY `area` (`area`,`name`), KEY `lrange` (`lrange`), KEY `hrange` (`hrange`), KEY `area_2` (`area`) )

log_message

TABLE `log_message` ( `id` int(10) unsigned NOT NULL auto_increment, `message` varchar(500) NOT NULL, `first` varchar(45) NOT NULL, `second` varchar(45) NOT NULL, `timestamp` int(10) unsigned NOT NULL, PRIMARY KEY (`id`) )

logon

TABLE `logon` ( `id` int(11) NOT NULL, `message` varchar(255) default NULL, PRIMARY KEY (`id`) )

mail_message

TABLE `mail_message` ( `id` int(11) NOT NULL auto_increment, `recieved` timestamp NOT NULL default CURRENT_TIMESTAMP, `expires` timestamp NOT NULL default '0000-00-00 00:00:00', `is_read` tinyint(1) default '0', `mailbox` varchar(13) default NULL, `recipient` varchar(13) default NULL, `sender` varchar(13) default NULL, `message` text, PRIMARY KEY (`id`) )

news

TABLE `news` ( `id` int(11) NOT NULL auto_increment, `type` int(11) default '1', `time` int(11) NOT NULL default '0', `name` varchar(30) default NULL, `news` text, PRIMARY KEY (`id`) )

online

TABLE `online` ( `nickname` varchar(25) NOT NULL, `botname` varchar(25) NOT NULL, `status_gc` int(1) default '0', `status_gc_changetime` int(11) default '0', `status_pg` int(1) default '0', `status_pg_changetime` int(11) default '0', `reinvite` int(1) default '0', `level` int(1) default '0', PRIMARY KEY (`nickname`,`botname`) )

org_city

TABLE `org_city` ( `id` int(11) NOT NULL auto_increment, `time` int(11) default NULL, `action` varchar(10) default NULL, `player` varchar(15) default NULL, PRIMARY KEY (`id`) )

player_notes

TABLE `player_notes` ( `pnid` int(11) NOT NULL auto_increment, `player` varchar(30) NOT NULL, `author` varchar(30) NOT NULL, `note` varchar(255) NOT NULL, `class` tinyint(4) NOT NULL default '0', `timestamp` int(10) unsigned NOT NULL, PRIMARY KEY (`pnid`) )

pocketbosses

TABLE `pocketbosses` ( `ID` int(11) NOT NULL auto_increment, `is_pocket` tinyint(1) default '1', `name` varchar(50) NOT NULL default 'Broken!', `level` int(11) default NULL, `Playfield` varchar(30) default NULL, `Place` varchar(50) default NULL, `pattern_mobs` varchar(50) default NULL, PRIMARY KEY (`ID`) )

preferences

TABLE `preferences` ( `ID` int(11) NOT NULL auto_increment, `pref_id` int(11) NOT NULL, `owner` int(11) default NULL, `value` varchar(25) default NULL, PRIMARY KEY (`ID`) )

preferences_def

TABLE `preferences_def` ( `ID` int(11) NOT NULL auto_increment, `module` varchar(30) default NULL, `name` varchar(30) default NULL, `description` varchar(255) default NULL, `default_value` varchar(25) default NULL, `possible_values` varchar(255) default NULL, PRIMARY KEY (`ID`) )

raid_points

TABLE `raid_points` ( `id` int(11) NOT NULL, `nickname` varchar(20) default NULL, `points` decimal(11,2) default '0.00', `raiding` tinyint(4) default '0', `raidingas` varchar(20) default NULL, PRIMARY KEY (`id`) )

raid_points_log

TABLE `raid_points_log` ( `id` int(11) NOT NULL auto_increment, `name` varchar(20) default NULL, `points` decimal(11,2) default '0.00', `by_who` varchar(20) default NULL, `time` int(11) default NULL, `why` varchar(500) default NULL, PRIMARY KEY (`id`) )

relay

TABLE `relay` ( `id` int(11) NOT NULL auto_increment, `botname` varchar(20) default NULL, `type` varchar(30) default NULL, `time` int(11) default NULL, `msg` text, PRIMARY KEY (`id`) )

security_flexible

TABLE `security_flexible` ( `id` int(10) unsigned NOT NULL auto_increment, `gid` int(10) unsigned NOT NULL, `field` enum('join','level','profession','faction','rank_id','org_id','at_id') default NULL, `op` enum('=','<','<=','>','>=','!=','&&','||') default NULL, `compareto` varchar(100) NOT NULL default , PRIMARY KEY (`id`) )

security_groups

TABLE `security_groups` ( `gid` int(10) unsigned NOT NULL auto_increment, `name` varchar(35) default NULL, `description` varchar(80) default NULL, `access_level` tinyint(3) unsigned NOT NULL default '0', PRIMARY KEY (`gid`), UNIQUE KEY `name` (`name`) )

security_members

TABLE `security_members` ( `id` int(11) NOT NULL auto_increment, `name` varchar(50) NOT NULL default , `gid` int(11) NOT NULL default '0', PRIMARY KEY (`name`,`gid`), UNIQUE KEY `id` (`id`), KEY `id_2` (`id`) )

security_org

TABLE `security_org` ( `org_gov` varchar(25) NOT NULL, `org_rank` varchar(25) NOT NULL, `org_rank_id` tinyint(3) unsigned NOT NULL, `access_level` tinyint(3) unsigned NOT NULL default '2', PRIMARY KEY (`org_gov`,`org_rank`,`org_rank_id`) )

settings

TABLE `settings` ( `module` varchar(25) NOT NULL, `setting` varchar(50) NOT NULL, `value` varchar(255) NOT NULL, `datatype` varchar(25) default NULL, `longdesc` varchar(255) default NULL, `defaultoptions` varchar(255) default NULL, `hidden` tinyint(1) default '0', `disporder` int(10) unsigned NOT NULL default '1', PRIMARY KEY (`module`,`setting`) )

shortcuts

TABLE `shortcuts` ( `id` int(11) NOT NULL auto_increment, `shortcut` varchar(20) NOT NULL, `long_desc` varchar(255) NOT NULL, PRIMARY KEY (`shortcut`), UNIQUE KEY `id` (`id`), UNIQUE KEY `long_desc` (`long_desc`) )

statistics

TABLE `statistics` ( `id` int(10) unsigned NOT NULL auto_increment, `module` varchar(100) NOT NULL, `action` varchar(100) NOT NULL, `comment` varchar(100) default , `count` int(10) unsigned NOT NULL, PRIMARY KEY (`id`) )

string_filter

TABLE `string_filter` ( `search` varchar(255) NOT NULL, `new` varchar(255) NOT NULL default '**bleep**', PRIMARY KEY (`search`) )

symbiants

TABLE `symbiants` ( `boss_id` int(11) NOT NULL, `QL` int(11) default NULL, `slot` varchar(10) default NULL, `unit` varchar(50) default NULL, `Name` varchar(59) default NULL, `itemref` int(11) default NULL )

tablenames

TABLE `tablenames` ( `internal_name` varchar(255) NOT NULL, `prefix` varchar(100) default NULL, `use_prefix` varchar(10) NOT NULL default 'false', `schemaversion` int(3) NOT NULL default '1', PRIMARY KEY (`internal_name`) )

table_versions

TABLE `table_versions` ( `internal_name` varchar(255) NOT NULL, `schemaversion` int(3) NOT NULL default '1', PRIMARY KEY (`internal_name`) )

timer

TABLE `timer` ( `id` bigint(100) unsigned NOT NULL auto_increment, `name` varchar(200) NOT NULL default , `timerclass` int(21) NOT NULL default '-1', `endtime` int(20) NOT NULL default '0', `owner` varchar(20) NOT NULL default , `channel` enum('tell','gc','pgmsg','both','global','internal') NOT NULL default 'both', `repeatinterval` int(8) NOT NULL default '0', PRIMARY KEY (`id`), KEY `endtime` (`endtime`) )

timer_class_entries

TABLE `timer_class_entries` ( `id` int(20) unsigned NOT NULL auto_increment, `next_id` int(21) NOT NULL default '-1', `class_id` int(10) unsigned NOT NULL, `notify_delay` int(8) NOT NULL, `notify_prefix` varchar(255) NOT NULL default , `notify_suffix` varchar(255) NOT NULL default , PRIMARY KEY (`id`), UNIQUE KEY `class_id` (`class_id`,`notify_delay`), KEY `next_id` (`next_id`) )

timer_classes

TABLE `timer_classes` ( `id` int(10) unsigned NOT NULL auto_increment, `name` varchar(25) NOT NULL default , `description` varchar(255) NOT NULL default , PRIMARY KEY (`name`), UNIQUE KEY `id` (`id`) )

timer_class_settings

TABLE `timer_class_settings` ( `id` int(10) unsigned NOT NULL auto_increment, `name` varchar(25) NOT NULL default , `current_class` int(10) unsigned NOT NULL, `default_class` int(10) unsigned NOT NULL, `description` varchar(255) NOT NULL default , PRIMARY KEY (`name`), UNIQUE KEY `id` (`id`) )

tower_attack

TABLE `tower_attack` ( `id` int(11) NOT NULL auto_increment, `time` int(11) default NULL, `off_guild` varchar(50) default NULL, `off_side` varchar(10) default NULL, `off_player` varchar(20) default NULL, `off_level` int(11) default NULL, `off_profession` varchar(15) default NULL, `def_guild` varchar(50) default NULL, `def_side` varchar(10) default NULL, `zone` varchar(50) default NULL, `x_coord` int(11) default NULL, `y_coord` int(11) default NULL, PRIMARY KEY (`id`), UNIQUE KEY `time` (`time`,`off_guild`,`off_side`,`off_player`,`def_guild`,`def_side`,`zone`,`x_coord`,`y_coord`), KEY `off_guild` (`off_guild`), KEY `off_side` (`off_side`), KEY `def_guild` (`def_guild`), KEY `def_side` (`def_side`), KEY `zone` (`zone`) )

tower_result

TABLE `tower_result` ( `id` int(11) NOT NULL auto_increment, `time` int(11) default NULL, `win_guild` varchar(50) default NULL, `win_side` varchar(10) default NULL, `lose_guild` varchar(50) default NULL, `lose_side` varchar(10) default NULL, `zone` varchar(50) default NULL, PRIMARY KEY (`id`), UNIQUE KEY `time` (`time`,`win_guild`,`win_side`,`lose_guild`,`lose_side`,`zone`), UNIQUE KEY `time_2` (`time`,`win_guild`,`win_side`,`lose_guild`,`lose_side`,`zone`), KEY `win_guild` (`win_guild`), KEY `win_side` (`win_side`), KEY `zone` (`zone`), KEY `win_guild_2` (`win_guild`), KEY `win_side_2` (`win_side`), KEY `zone_2` (`zone`) )

users

TABLE `users` ( `id` int(11) NOT NULL auto_increment, `char_id` int(11) NOT NULL, `nickname` varchar(25) default NULL, `password` varchar(64) default NULL, `password_salt` varchar(5) default NULL, `last_seen` int(11) default '0', `last_raid` int(11) default '0', `added_by` varchar(25) default NULL, `added_at` int(11) default '0', `deleted_by` varchar(25) default NULL, `deleted_at` int(11) default NULL, `banned_by` varchar(25) default NULL, `banned_at` int(11) default NULL, `banned_for` varchar(100) default NULL, `banned_until` int(11) default '0', `notify` int(1) default '0', `user_level` int(1) default '0', `updated_at` int(11) default '0', PRIMARY KEY (`id`), UNIQUE KEY `char_id` (`char_id`), UNIQUE KEY `nickname` (`nickname`), KEY `user_level` (`user_level`), KEY `banned_until` (`banned_until`), KEY `notify` (`notify`), KEY `user_level_2` (`user_level`), KEY `banned_until_2` (`banned_until`), KEY `notify_2` (`notify`) )

whois

TABLE `whois` ( `ID` int(15) NOT NULL default '0', `nickname` varchar(15) NOT NULL default , `firstname` varchar(20) NOT NULL default , `lastname` varchar(20) NOT NULL default , `level` tinyint(3) unsigned NOT NULL default '1', `gender` enum('Female','Male','Neuter') NOT NULL default 'Female', `breed` enum('Atrox','Nano','Opifex','Solitus') NOT NULL default 'Atrox', `faction` enum('Clan','N/A','Neutral','Omni') NOT NULL default 'Clan', `profession` enum('Adventurer','Agent','Bureaucrat','Doctor','Enforcer','Engineer','Fixer','Keeper','Martial Artist','Meta-Physicist','Nano-Technician','Shade','Soldier','Trader') NOT NULL default 'Adventurer', `defender_rank` enum('Able','Accomplished','Adept','Amateur','Backer','Beginner','Challenger','Champ','Common','Competent','Defender','Fair','Fledgling','Guardian','Hero','Intermediate','Medalist','Mediocre','Newcomer','None','Patron','Protector','Qualified','Starter','Student','Suited','Supporter','Talented','Trustworthy','Vanquisher','Vindicator') NOT NULL default 'None', `defender_rank_id` enum('0','1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30') NOT NULL default '0', `org_id` bigint(10) NOT NULL default '0', `org_name` varchar(50) NOT NULL default , `org_rank` varchar(20) NOT NULL default , `org_rank_id` enum('0','1','2','3','4','5','6','7','8','9','10') NOT NULL default '0', `pictureurl` varchar(100) NOT NULL default , `used` bigint(25) NOT NULL default '0', `updated` int(10) NOT NULL default '0', PRIMARY KEY (`nickname`), KEY `ID` (`ID`), KEY `Profession` (`profession`), KEY `Faction` (`faction`), KEY `OrgID` (`org_id`), KEY `Orgname` (`org_name`), KEY `Level` (`level`), KEY `Alienlevel` (`defender_rank_id`), KEY `updated` (`updated`), KEY `used` (`used`) )

PHP Script to Generate this Documentation from a MySQL Dump

<?php $subject = file_get_contents('aobots.sql'); $pattern = "/CREATE (TABLE .+?\)) ENGINE.+?/s"; if (preg_match_all ($pattern, $subject, $matches)) { $outfile = fopen("tables.txt", "w"); foreach ($matches[1] as $table) { $lines = explode("\n", $table); $headline = $lines[0]; $headline = str_replace("TABLE `", "", $headline); $headline = str_replace("` (", "", $headline); $headline = "==== ".trim($headline)." ===="; fwrite($outfile, $headline."\n"); $i = 0; fwrite($outfile, "<code sql>"); while($i < count($lines)): fwrite($outfile, trim($lines[$i])."\n"); $i = $i+1; endwhile; fwrite($outfile, "</code>\n"); } fclose($outfile); } else { print_r("No matches.\n"); die(); } ?>

Note: Replace &lt with < and &gt with > in the code above.