private void TricklePsy(BotShell bot, CommandArgs e) { Double Test; Test = Convert.ToInt32(e.Args[0]); RichTextWindow window = new RichTextWindow(bot); window.AppendNormalStart(); window.AppendTitle(); window.AppendString(" Body"); window.AppendLineBreak(); window.AppendString("Dimach: "); window.AppendNormal(Math.Floor(((Test / 4) * .20)).ToString()); window.AppendLineBreak(); window.AppendString("Martial Arts: "); window.AppendNormal(Math.Floor(((Test / 4) * .30)).ToString()); window.AppendLineBreak(); window.AppendLineBreak(); window.AppendString(" Melee"); window.AppendLineBreak(); window.AppendString("Sneak Attack: "); window.AppendNormal(Math.Floor(((Test / 4) * .20)).ToString()); window.AppendLineBreak(); window.AppendLineBreak(); window.AppendString(" Ranged"); window.AppendLineBreak(); window.AppendString("Ranged Energy: "); window.AppendNormal(Math.Floor(((Test / 4) * .40)).ToString()); window.AppendLineBreak(); window.AppendLineBreak(); window.AppendString(" Speed"); window.AppendLineBreak(); window.AppendString("Melee Initiative: "); window.AppendNormal(Math.Floor(((Test / 4) * .20)).ToString()); window.AppendLineBreak(); window.AppendString("Nano Resist: "); window.AppendNormal(Math.Floor(((Test / 4) * .80)).ToString()); window.AppendLineBreak(); window.AppendString("Physical Initiative: "); window.AppendNormal(Math.Floor(((Test / 4) * .20)).ToString()); window.AppendLineBreak(); window.AppendString("Ranged Initiative: "); window.AppendNormal(Math.Floor(((Test / 4) * .20)).ToString()); window.AppendLineBreak(); window.AppendLineBreak(); window.AppendString(" Trade & Repair"); window.AppendLineBreak(); window.AppendString("Psychology: "); window.AppendNormal(Math.Floor(((Test / 4) * .50)).ToString()); window.AppendLineBreak(); window.AppendString("Quantum FT: "); window.AppendNormal(Math.Floor(((Test / 4) * .50)).ToString()); window.AppendLineBreak(); window.AppendString("Tutoring: "); window.AppendNormal(Math.Floor(((Test / 4) * .10)).ToString()); window.AppendLineBreak(); window.AppendLineBreak(); window.AppendString(" Nano and Aiding"); window.AppendLineBreak(); window.AppendString("Biological Metamorphasis: "); window.AppendNormal(Math.Floor(((Test / 4) * .20)).ToString()); window.AppendLineBreak(); window.AppendString("Matter Metamorphasis: "); window.AppendNormal(Math.Floor(((Test / 4) * .20)).ToString()); window.AppendLineBreak(); window.AppendLineBreak(); window.AppendString(" Spying"); window.AppendLineBreak(); window.AppendString("Break And Enter: "); window.AppendNormal(Math.Floor(((Test / 4) * .30)).ToString()); window.AppendLineBreak(); window.AppendLineBreak(); window.AppendString(" Navigation"); window.AppendLineBreak(); window.AppendString("Map Navigation: "); window.AppendNormal(Math.Floor(((Test / 4) * .10)).ToString()); window.AppendLineBreak(); bot.SendReply(e, bot.ColorHeader + "Trickling " + bot.ColorHighlight + e.Args[0] + bot.ColorHeader + " To Psychic " + bot.ColorHighlight + " »» ", window); }
public override void OnCommand(BotShell bot, CommandArgs e) { RichTextWindow window = new RichTextWindow(bot); window.AppendTitle(); lock (this._database.Connection) { using (IDbCommand command = this._database.Connection.CreateCommand()) { command.CommandText = "SELECT title, rule FROM rules WHERE visible = 'true'"; IDataReader reader = command.ExecuteReader(); while (reader.Read()) { window.AppendHeader(reader.GetString(0)); string rule = reader.GetString(1); rule = rule.Replace("[b]", bot.ColorNormal); rule = rule.Replace("[/b]", HTML.CreateColorEnd()); window.AppendHighlightStart(); window.AppendRawString(rule); window.AppendColorEnd(); window.AppendLineBreak(2); } reader.Close(); } } bot.SendReply(e, "Rules »» ", window); }
private void OnRosterResetCommand(BotShell bot, CommandArgs e) { if (e.Args.Length > 0) { if (e.Args[0].ToLower() == "confirm") { this._database.ExecuteNonQuery("DELETE FROM members"); bot.SendReply(e, "Roster list cleared"); return; } } RichTextWindow window = new RichTextWindow(bot); window.AppendTitle("Clear Cached Roster List"); window.AppendNormal("Warning! This will clear the local roster list!"); window.AppendLineBreak(); window.AppendNormal("This list is used to determine changes in the organization's member list."); window.AppendLineBreak(); window.AppendNormal("Clearing this list will NOT remove any members from the bot!"); window.AppendLineBreak(); window.AppendNormal("After clearing this list, the next roster update will see every member of the organization as a new member."); window.AppendLineBreak(); window.AppendNormal("Resetting the cached roster list can be used to resolve some sync issues but may also leave 'ghost' members behind."); window.AppendLineBreak(); window.AppendNormal("Use this command with caution!"); window.AppendLineBreak(2); window.AppendBotCommand("Reset List Now", "roster reset confirm"); bot.SendReply(e, "Roster Reset »» " + window.ToString()); }
private void OnRaidBansCommand(BotShell bot, CommandArgs e) { if (!this._core.Running) { bot.SendReply(e, "There is currently no raid active"); return; } lock (this._bans) { if (this._bans.Count < 1) { bot.SendReply(e, "Nobody is banned from the raid"); return; } RichTextWindow window = new RichTextWindow(bot); window.AppendTitle("Raid Bans"); foreach (KeyValuePair <string, Raider> kvp in this._bans) { TimeSpan ts = (new TimeSpan(0, kvp.Value.Duration, 0)) - (DateTime.Now - kvp.Value.Time); window.AppendHighlight(Math.Floor(ts.TotalMinutes).ToString("##00") + ":" + ts.Seconds.ToString("00")); window.AppendNormal(" - "); window.AppendHighlight(kvp.Value.Character + " "); if (kvp.Value.Character != kvp.Key) { window.AppendNormal("(Main: " + kvp.Key + ") "); } window.AppendNormal("["); window.AppendBotCommand("Unban", "raid unban " + kvp.Key); window.AppendNormal("]"); window.AppendLineBreak(); } bot.SendReply(e, HTML.CreateColorString(bot.ColorHeaderHex, this._bans.Count.ToString()) + " Raid Bans »» ", window); } }
private void OnConfigurationCommand(BotShell bot, CommandArgs e) { string[] plugins = bot.Configuration.ListRegisteredPlugins(); if (plugins == null || plugins.Length == 0) { bot.SendReply(e, "No configuration entries registered"); return; } RichTextWindow window = new RichTextWindow(bot); window.AppendTitle("Configuration"); foreach (string plugin in plugins) { PluginLoader loader = bot.Plugins.GetLoader(plugin); window.AppendNormalStart(); window.AppendString("["); window.AppendBotCommand("Configure", "configuration " + plugin.ToLower()); window.AppendString("] "); window.AppendColorEnd(); window.AppendHighlight(loader.Name); window.AppendNormal(" (" + bot.Configuration.List(plugin).Length + " settings)"); window.AppendLineBreak(); } bot.SendReply(e, "Configuration »» ", window); }
private void OnCommandsCommand(BotShell bot, CommandArgs e) { RichTextWindow window = new RichTextWindow(bot); window.AppendTitle("Command Rights"); foreach (string plugin in bot.Plugins.GetPlugins()) { if (bot.Plugins.GetState(plugin) == PluginState.Loaded) { string[] commands = bot.Commands.GetCommands(plugin); if (commands.Length > 0) { PluginLoader loader = bot.Plugins.GetLoader(plugin); window.AppendNormalStart(); window.AppendString("["); window.AppendBotCommand("Configure", "commands " + plugin.ToLower()); window.AppendString("] "); window.AppendColorEnd(); window.AppendHighlight(loader.Name); window.AppendNormal(" (" + commands.Length + " commands)"); window.AppendLineBreak(); } } } bot.SendReply(e, "Commands »» ", window); }
private void OnRaidHistoryExtendedCommand(BotShell bot, CommandArgs e) { int id = -1; try { id = Convert.ToInt32(e.Args[0]); } catch { } if (id < 0) { bot.SendReply(e, "Invalid RaidID"); return; } RaidCore.Raider[] raiders = this._core.GetRaiders(id); if (raiders.Length == 0) { bot.SendReply(e, "There are no raiders listed under that RaidID"); return; } RichTextWindow window = new RichTextWindow(bot); window.AppendTitle("Raiders on Raid #" + id); foreach (RaidCore.Raider raider in raiders) { window.AppendHighlight(raider.Character); window.AppendNormalStart(); if (raider.Character != raider.Main) { window.AppendString(" (Main: " + raider.Main + ")"); } window.AppendString(" (" + Math.Round((float)raider.Activity / 60, 1) + " minutes)"); window.AppendString(" (" + Format.DateTime(raider.JoinTime, FormatStyle.Compact) + " GMT)"); window.AppendColorEnd(); window.AppendLineBreak(); } bot.SendReply(e, "Raiders on Raid #" + id + " »» ", window); }
private void RequestSbState(BotShell bot, string user) { ShadowbreedState state; lock (this.Shadowbreeds) { if (!this.Shadowbreeds.ContainsKey(user.ToLower())) { return; } state = this.Shadowbreeds[user.ToLower()]; } RichTextWindow window = new RichTextWindow(bot); window.AppendTitle("Shadowbreed"); window.AppendHighlight("Intro"); window.AppendLineBreak(); window.AppendNormal("You have been requested to set your Shadowbreed state."); window.AppendLineBreak(); window.AppendNormal("Your current Shadowbreed state is: "); window.AppendRawString(this.ColorizeState(state)); window.AppendLineBreak(); window.AppendNormal("Please select one of the following states that best suits your situation."); window.AppendLineBreak(2); window.AppendHighlight("Up "); window.AppendNormal("["); window.AppendBotCommand("Set", "sb set " + user + " up"); window.AppendNormal("] "); window.AppendLineBreak(); window.AppendNormal("Your Shadowbreed is up and available to use."); window.AppendLineBreak(); window.AppendNormal("You're alive and present at the raid."); window.AppendLineBreak(2); window.AppendHighlight("Down "); window.AppendNormal("["); window.AppendBotCommand("Set", "sb set " + user + " down"); window.AppendNormal("] "); window.AppendLineBreak(); window.AppendNormal("Your Shadowbreed is not up and can't be used."); window.AppendLineBreak(); window.AppendNormal("You're alive and present at the raid."); window.AppendLineBreak(2); window.AppendHighlight("Unavailable "); window.AppendNormal("["); window.AppendBotCommand("Set", "sb set " + user + " unavailable"); window.AppendNormal("] "); window.AppendLineBreak(); window.AppendNormal("You don't have a Shadowbreed."); window.AppendLineBreak(); window.AppendNormal("Or you're not present at the raid."); bot.SendPrivateMessage(user, bot.ColorHighlight + "Please set your Shadowbreed state »» " + window.ToString(), AoLib.Net.PacketQueue.Priority.Urgent, true); }
private void TrickleInt(BotShell bot, CommandArgs e) { Double Test; Test = Convert.ToInt32(e.Args[0]); RichTextWindow window = new RichTextWindow(bot); window.AppendNormalStart(); window.AppendTitle(); window.AppendString(" Body"); window.AppendLineBreak(); window.AppendString("Nano Pool: "); window.AppendNormal(Math.Floor(((Test / 4) * .10)).ToString()); window.AppendLineBreak(); window.AppendLineBreak(); window.AppendString(" Melee"); window.AppendLineBreak(); window.AppendString("Melee Energy: "); window.AppendNormal(Math.Floor(((Test / 4) * .50)).ToString()); window.AppendLineBreak(); window.AppendLineBreak(); window.AppendString(" Misc"); window.AppendLineBreak(); window.AppendString("Grenade: "); window.AppendNormal(Math.Floor(((Test / 4) * .20)).ToString()); window.AppendLineBreak(); window.AppendLineBreak(); window.AppendString(" Ranged"); window.AppendLineBreak(); window.AppendString("Multiple Ranged: "); window.AppendNormal(Math.Floor(((Test / 4) * .40)).ToString()); window.AppendLineBreak(); window.AppendString("Ranged Energy: "); window.AppendNormal(Math.Floor(((Test / 4) * .20)).ToString()); window.AppendLineBreak(); window.AppendLineBreak(); window.AppendString(" Speed"); window.AppendLineBreak(); window.AppendString("Dodge Ranged: "); window.AppendNormal(Math.Floor(((Test / 4) * .20)).ToString()); window.AppendLineBreak(); window.AppendString("Duck Explosions: "); window.AppendNormal(Math.Floor(((Test / 4) * .20)).ToString()); window.AppendLineBreak(); window.AppendString("Evade Close: "); window.AppendNormal(Math.Floor(((Test / 4) * .20)).ToString()); window.AppendLineBreak(); window.AppendString("Melee Initiative: "); window.AppendNormal(Math.Floor(((Test / 4) * .10)).ToString()); window.AppendLineBreak(); window.AppendString("Nano Resist: "); window.AppendNormal(Math.Floor(((Test / 4) * .20)).ToString()); window.AppendLineBreak(); window.AppendString("Physical Initiative: "); window.AppendNormal(Math.Floor(((Test / 4) * .10)).ToString()); window.AppendLineBreak(); window.AppendString("Ranged Initiative: "); window.AppendNormal(Math.Floor(((Test / 4) * .10)).ToString()); window.AppendLineBreak(); window.AppendLineBreak(); window.AppendString(" Trade & Repair"); window.AppendLineBreak(); window.AppendString("Chemistry: "); window.AppendNormal(Math.Floor(((Test / 4) * .50)).ToString()); window.AppendLineBreak(); window.AppendString("Computer Literacy: "); window.AppendNormal(Math.Floor(((Test / 4) * 1)).ToString()); window.AppendLineBreak(); window.AppendString("Electrical Engineering: "); window.AppendNormal(Math.Floor(((Test / 4) * .50)).ToString()); window.AppendLineBreak(); window.AppendString("Mechanical Engineering: "); window.AppendNormal(Math.Floor(((Test / 4) * .50)).ToString()); window.AppendLineBreak(); window.AppendString("Nano Programming: "); window.AppendNormal(Math.Floor(((Test / 4) * 1)).ToString()); window.AppendLineBreak(); window.AppendString("Pharmacological Technologies: "); window.AppendNormal(Math.Floor(((Test / 4) * .80)).ToString()); window.AppendLineBreak(); window.AppendString("Psychology: "); window.AppendNormal(Math.Floor(((Test / 4) * .50)).ToString()); window.AppendLineBreak(); window.AppendString("Quantum FT: "); window.AppendNormal(Math.Floor(((Test / 4) * .50)).ToString()); window.AppendLineBreak(); window.AppendString("Tutoring: "); window.AppendNormal(Math.Floor(((Test / 4) * .70)).ToString()); window.AppendLineBreak(); window.AppendString("Weapon Smithing: "); window.AppendNormal(Math.Floor(((Test / 4) * .50)).ToString()); window.AppendLineBreak(); window.AppendLineBreak(); window.AppendString(" Nano and Aiding"); window.AppendLineBreak(); window.AppendString("Biological Metamorphasis: "); window.AppendNormal(Math.Floor(((Test / 4) * .80)).ToString()); window.AppendLineBreak(); window.AppendString("First Aid: "); window.AppendNormal(Math.Floor(((Test / 4) * .30)).ToString()); window.AppendLineBreak(); window.AppendString("Matter Creations: "); window.AppendNormal(Math.Floor(((Test / 4) * .80)).ToString()); window.AppendLineBreak(); window.AppendString("Matter Metamophasis: "); window.AppendNormal(Math.Floor(((Test / 4) * .80)).ToString()); window.AppendLineBreak(); window.AppendString("Psychological Modifications: "); window.AppendNormal(Math.Floor(((Test / 4) * .80)).ToString()); window.AppendLineBreak(); window.AppendString("Sensory Improvement: "); window.AppendNormal(Math.Floor(((Test / 4) * .80)).ToString()); window.AppendLineBreak(); window.AppendString("Time and Space: "); window.AppendNormal(Math.Floor(((Test / 4) * .80)).ToString()); window.AppendLineBreak(); window.AppendString("Treatment: "); window.AppendNormal(Math.Floor(((Test / 4) * .50)).ToString()); window.AppendLineBreak(); window.AppendLineBreak(); window.AppendString(" Spying"); window.AppendLineBreak(); window.AppendString("Perception: "); window.AppendNormal(Math.Floor(((Test / 4) * .30)).ToString()); window.AppendLineBreak(); window.AppendString("Trap Disarm: "); window.AppendNormal(Math.Floor(((Test / 4) * .20)).ToString()); window.AppendLineBreak(); window.AppendLineBreak(); window.AppendString(" Navigation"); window.AppendLineBreak(); window.AppendString("Map Navigation: "); window.AppendNormal(Math.Floor(((Test / 4) * .40)).ToString()); window.AppendLineBreak(); window.AppendString("Vehicle Air: "); window.AppendNormal(Math.Floor(((Test / 4) * .20)).ToString()); window.AppendLineBreak(); window.AppendString("Vehicle Ground: "); window.AppendNormal(Math.Floor(((Test / 4) * .20)).ToString()); window.AppendLineBreak(); window.AppendString("Vehicle Water: "); window.AppendNormal(Math.Floor(((Test / 4) * .20)).ToString()); window.AppendLineBreak(); bot.SendReply(e, bot.ColorHeader + "Trickling " + bot.ColorHighlight + e.Args[0] + bot.ColorHeader + " To Intelligence " + bot.ColorHighlight + " »» ", window); }
private void TrickleSen(BotShell bot, CommandArgs e) { Double Test; Test = Convert.ToInt32(e.Args[0]); RichTextWindow window = new RichTextWindow(bot); window.AppendNormalStart(); window.AppendTitle(); window.AppendString(" Body"); window.AppendLineBreak(); window.AppendString("Dimach: "); window.AppendNormal(Math.Floor(((Test / 4) * .80)).ToString()); window.AppendLineBreak(); window.AppendString("Nano Pool: "); window.AppendNormal(Math.Floor(((Test / 4) * .10)).ToString()); window.AppendLineBreak(); window.AppendString("Riposte: "); window.AppendNormal(Math.Floor(((Test / 4) * .50)).ToString()); window.AppendLineBreak(); window.AppendLineBreak(); window.AppendString(" Melee"); window.AppendLineBreak(); window.AppendString("Fast Attack: "); window.AppendNormal(Math.Floor(((Test / 4) * .40)).ToString()); window.AppendLineBreak(); window.AppendString("Parry: "); window.AppendNormal(Math.Floor(((Test / 4) * .30)).ToString()); window.AppendLineBreak(); window.AppendString("Sneak Attack: "); window.AppendNormal(Math.Floor(((Test / 4) * .80)).ToString()); window.AppendLineBreak(); window.AppendLineBreak(); window.AppendString(" Misc"); window.AppendLineBreak(); window.AppendString("Grenade: "); window.AppendNormal(Math.Floor(((Test / 4) * .40)).ToString()); window.AppendLineBreak(); window.AppendString("Sharp Object: "); window.AppendNormal(Math.Floor(((Test / 4) * .20)).ToString()); window.AppendLineBreak(); window.AppendLineBreak(); window.AppendString(" Ranged"); window.AppendLineBreak(); window.AppendString("Aimed Shot: "); window.AppendNormal(Math.Floor(((Test / 4) * 1)).ToString()); window.AppendLineBreak(); window.AppendString("Assault Rifle: "); window.AppendNormal(Math.Floor(((Test / 4) * .20)).ToString()); window.AppendLineBreak(); window.AppendString("Bow Special Attack: "); window.AppendNormal(Math.Floor(((Test / 4) * .40)).ToString()); window.AppendLineBreak(); window.AppendString("Bow: "); window.AppendNormal(Math.Floor(((Test / 4) * .40)).ToString()); window.AppendLineBreak(); window.AppendString("Pistol: "); window.AppendNormal(Math.Floor(((Test / 4) * .40)).ToString()); window.AppendLineBreak(); window.AppendString("Ranged Energy: "); window.AppendNormal(Math.Floor(((Test / 4) * .40)).ToString()); window.AppendLineBreak(); window.AppendString("Rifle: "); window.AppendNormal(Math.Floor(((Test / 4) * .40)).ToString()); window.AppendLineBreak(); window.AppendString("SMG/MG: "); window.AppendNormal(Math.Floor(((Test / 4) * .10)).ToString()); window.AppendLineBreak(); window.AppendLineBreak(); window.AppendString(" Speed"); window.AppendLineBreak(); window.AppendString("Dodge Ranged: "); window.AppendNormal(Math.Floor(((Test / 4) * .30)).ToString()); window.AppendLineBreak(); window.AppendString("Duck Explosions: "); window.AppendNormal(Math.Floor(((Test / 4) * .30)).ToString()); window.AppendLineBreak(); window.AppendString("Evade Close: "); window.AppendNormal(Math.Floor(((Test / 4) * .30)).ToString()); window.AppendLineBreak(); window.AppendString("Melee Initiative: "); window.AppendNormal(Math.Floor(((Test / 4) * .60)).ToString()); window.AppendLineBreak(); window.AppendString("Nano Cast Initiative: "); window.AppendNormal(Math.Floor(((Test / 4) * .60)).ToString()); window.AppendLineBreak(); window.AppendString("Physical Initiative: "); window.AppendNormal(Math.Floor(((Test / 4) * .60)).ToString()); window.AppendLineBreak(); window.AppendString("Ranged Initiative: "); window.AppendNormal(Math.Floor(((Test / 4) * .60)).ToString()); window.AppendLineBreak(); window.AppendLineBreak(); window.AppendString(" Trade & Repair"); window.AppendLineBreak(); window.AppendString("Tutoring: "); window.AppendNormal(Math.Floor(((Test / 4) * .20)).ToString()); window.AppendLineBreak(); window.AppendLineBreak(); window.AppendString(" Nano and Aiding"); window.AppendLineBreak(); window.AppendString("First Aid: "); window.AppendNormal(Math.Floor(((Test / 4) * .40)).ToString()); window.AppendLineBreak(); window.AppendString("Psychological Modifications: "); window.AppendNormal(Math.Floor(((Test / 4) * .20)).ToString()); window.AppendLineBreak(); window.AppendString("Treatment: "); window.AppendNormal(Math.Floor(((Test / 4) * .20)).ToString()); window.AppendLineBreak(); window.AppendLineBreak(); window.AppendString(" Spying"); window.AppendLineBreak(); window.AppendString("Breaking and Entering: "); window.AppendNormal(Math.Floor(((Test / 4) * .30)).ToString()); window.AppendLineBreak(); window.AppendString("Concealment: "); window.AppendNormal(Math.Floor(((Test / 4) * .70)).ToString()); window.AppendLineBreak(); window.AppendString("Perception: "); window.AppendNormal(Math.Floor(((Test / 4) * .70)).ToString()); window.AppendLineBreak(); window.AppendString("Trap Disarm: "); window.AppendNormal(Math.Floor(((Test / 4) * .60)).ToString()); window.AppendLineBreak(); window.AppendLineBreak(); window.AppendString(" Navigation"); window.AppendLineBreak(); window.AppendString("Map Navigations: "); window.AppendNormal(Math.Floor(((Test / 4) * .50)).ToString()); window.AppendLineBreak(); window.AppendString("Vehicle Air: "); window.AppendNormal(Math.Floor(((Test / 4) * .60)).ToString()); window.AppendLineBreak(); window.AppendString("Vehicle Ground: "); window.AppendNormal(Math.Floor(((Test / 4) * .60)).ToString()); window.AppendLineBreak(); window.AppendString("Vehicle Water: "); window.AppendNormal(Math.Floor(((Test / 4) * .60)).ToString()); window.AppendLineBreak(); bot.SendReply(e, bot.ColorHeader + "Trickling " + bot.ColorHighlight + e.Args[0] + bot.ColorHeader + " To Sense " + bot.ColorHighlight + " »» ", window); }
private void OnSecurityCommand(BotShell bot, CommandArgs e) { bot.SendReply(e, "Gathering Data. This can take several minutes. Please stand by..."); RichTextWindow window = new RichTextWindow(bot); window.AppendTitle("Invalid ID's / Rerolled Characters"); List <SecurityProcessItem> members = new List <SecurityProcessItem>(); lock (this._database.Connection) { using (IDbCommand command = this._database.Connection.CreateCommand()) { command.CommandText = "SELECT username as name, userID as id, 'Main' as type FROM members UNION SELECT altname, altID, 'Alt' FROM alts ORDER BY name"; IDataReader reader = command.ExecuteReader(); while (reader.Read()) { string username = reader.GetString(0); UInt32 userID = (UInt32)reader.GetInt64(1); string type = reader.GetString(2); members.Add(new SecurityProcessItem(username, userID, type)); } reader.Close(); } } foreach (SecurityProcessItem member in members) { UInt32 realID = bot.GetUserID(member.Username); if (realID == 0) { window.AppendHighlight(member.Username); window.AppendNormalStart(); window.AppendString(" (" + member.Type + ") ("); window.AppendColorString(RichTextWindow.ColorRed, "Deleted"); window.AppendString(") ["); window.AppendBotCommand("Account", "account " + member.Username); window.AppendString("]"); window.AppendColorEnd(); window.AppendLineBreak(); } else if (realID != member.UserID) { window.AppendHighlight(member.Username); window.AppendNormalStart(); window.AppendString(" (Current=" + member.UserID + " Real=" + realID + ") (" + member.Type + ") ("); window.AppendColorString(RichTextWindow.ColorOrange, "Invalid ID"); window.AppendString(") ["); window.AppendBotCommand("Account", "account " + member.Username); window.AppendString("] ["); window.AppendBotCommand("Fix", "security fixid " + member.Username); window.AppendString("]"); window.AppendColorEnd(); window.AppendLineBreak(); } } bot.SendReply(e, "Security Report »» ", window); }
private void OnGlyphsCommand(BotShell bot, CommandArgs e) { RichTextWindow window = new RichTextWindow(bot); window.AppendTitle(); string raffle = string.Empty; bool empty = true; lock (this._items) { foreach (KeyValuePair <int, string> kvp in this._items) { window.AppendHeader(kvp.Value); int i = 0; lock (this._database.Connection) { using (IDbCommand command = this._database.Connection.CreateCommand()) { command.CommandText = "SELECT id, looter, time FROM glyphs WHERE item = " + kvp.Key + " AND visible = 'true'"; IDataReader reader = command.ExecuteReader(); while (reader.Read()) { i++; window.AppendNormal(Format.DateTime(reader.GetInt64(2), FormatStyle.Compact) + " "); window.AppendHighlight(reader.GetString(1)); window.AppendLineBreak(); empty = false; } reader.Close(); } } if (i == 0) { window.AppendHighlight("None"); window.AppendLineBreak(); } window.AppendLineBreak(); raffle += " " + i; } } if (!empty) { window.AppendHeader("Options"); window.AppendBotCommand("Start Raffle", "glyphs raffle" + raffle); window.AppendLineBreak(); window.AppendBotCommand("Clear List", "glyphs clear"); bot.SendReply(e, "Glyphs List »» ", window); } else { bot.SendReply(e, "The glyphs list is current empty"); } }
private void OnHelpCommand(BotShell bot, CommandArgs e) { RichTextWindow window = new RichTextWindow(bot); window.AppendTitle("VhaBot Help"); bool found = false; foreach (string plugin in bot.Plugins.GetPlugins()) { if (bot.Plugins.IsLoaded(plugin)) { string[] commands = bot.Commands.GetCommands(plugin); List <string> helpCommands = new List <string>(); foreach (string command in commands) { CommandRights rights = bot.Commands.GetRights(command); if (rights.Help && !rights.IsAlias) { helpCommands.Add(command); } } helpCommands.Sort(); if (helpCommands.Count > 0) { PluginLoader loader = bot.Plugins.GetLoader(plugin); window.AppendHighlight(loader.Name); window.AppendLineBreak(); window.AppendNormalStart(); int i = 0; foreach (string command in helpCommands) { window.AppendBotCommand(Format.UppercaseFirst(command), "help " + command); i++; if (i < helpCommands.Count) { window.AppendString(", "); } } window.AppendColorEnd(); window.AppendLineBreak(2); found = true; } } } if (found) { bot.SendReply(e, "VhaBot Help »» ", window); } else { bot.SendReply(e, "No help available"); } }
public override void OnCommand(BotShell bot, CommandArgs e) { switch (e.Command) { case "gates": TimeSpan time = this.GetTimeLeft(); DateTime now = DateTime.Now.ToUniversalTime(); RichTextWindow window = new RichTextWindow(bot); window.AppendTitle("Outzone Gates Opening Times"); DateTime next = now.AddSeconds(time.TotalSeconds); for (int i = 0; i < 14; i++) { window.AppendHighlight(next.ToString("dd/MM/yyyy HH:mm:ss") + " GMT "); TimeSpan span = next - now; window.AppendNormal(string.Format("({0:00}:{1:00}:{2:00} from now)", Math.Floor(span.TotalHours), span.Minutes, span.Seconds)); window.AppendLineBreak(); next = next.AddSeconds(this.Cycle); } string result = string.Empty; int last = this.Cycle - (int)time.TotalSeconds; if (last < (60 * 2)) { result = "Unicorn Gatekeeper is currently opening the Outzones gates"; } else if (last < (60 * 12)) { result = "The Outzones gates are currently open"; } else { result = "Unicorn Gatekeeper will open the Outzones gates in " + HTML.CreateColorString(bot.ColorHeaderHex, string.Format("{0} hours, {1} minutes and {2} seconds", time.Hours, time.Minutes, time.Seconds)); } bot.SendReply(e, result + " »» " + window.ToString()); break; case "gates get": if (this.FetchWebTime(bot)) { bot.SendReply(e, "Synchronized the Outzones gates timer"); } else { bot.SendReply(e, "Unable to synchronize the Outzones gates timer. Please try again later"); } break; case "gates reset": bot.Configuration.SetInteger(this.InternalName, "gatetime", (Int32)TimeStamp.Now); this.LoadSettings(bot); bot.SendReply(e, "The Outzones gates timer has been reset"); break; } }
private void OnVoteStatusCommand(BotShell bot, CommandArgs e) { if (!this._running) { bot.SendPrivateMessage(e.SenderID, "There is nothing to vote on."); } else { RichTextWindow window = new RichTextWindow(bot); window.AppendTitle(this._admin + " has initiated an election!"); window.AppendLineBreak(); window.AppendString("You are being asked to vote for or against the following topic:"); window.AppendLineBreak(); window.AppendLineBreak(); window.AppendString(_description); window.AppendLineBreak(); window.AppendNormalStart(); window.AppendString("["); window.AppendBotCommand("Yes", "vote yes"); window.AppendString("] ["); window.AppendBotCommand("No", "vote no"); window.AppendString("] ["); window.AppendBotCommand("Abstain", "vote abstain"); window.AppendString("]"); window.AppendLineBreak(); window.AppendLineBreak(); window.AppendString("There are currently " + Convert.ToString(_yes + _no) + " votes. "); if ((_quorum > 0) && (_yes + _no + _abs < _quorum)) { window.AppendString("Quorum has not yet been met."); } else { window.AppendString("Quorum has been met."); } if ((e.Sender == this._admin) || (bot.Users.GetUser(e.Sender) >= UserLevel.Leader)) { window.AppendLineBreak(); window.AppendLineBreak(); window.AppendString("Quorum is currently: " + Convert.ToString(_quorum) + " with a " + Convert.ToString(_percentage) + "% approval in order to win this election."); window.AppendLineBreak(); window.AppendString("["); window.AppendBotCommand("End Voting", "vote stop"); window.AppendString("] ["); window.AppendBotCommand("Abort Voting", "vote abort"); window.AppendString("]"); } string output = string.Format("{1}{2}{0} has initiated an election »» ", bot.ColorHighlight, bot.ColorHeader, this._admin) + window.ToString(); // bot.SendPrivateChannelMessage(output); bot.SendPrivateMessage(e.SenderID, output); } }
public void OnBuffsCommand(BotShell bot, CommandArgs e) { RichTextWindow buffsWindow = new RichTextWindow(bot); buffsWindow.AppendTitle("Class Buffs"); buffsWindow.AppendLineBreak(); buffsWindow.AppendCommand("Base Attribute Buffs", "/tell " + this._bot.Character + " basebuffs"); buffsWindow.AppendLineBreak(2); buffsWindow.AppendCommand("Skill Buffs", "/tell " + this._bot.Character + " skillbuffs"); bot.SendReply(e, " Class Buffs »» ", buffsWindow); }
public override void OnCommand(BotShell bot, CommandArgs e) { switch (e.Command) { case "announce": case "mass": bool invite = (e.Command == "mass"); if (e.Words.Length < 1) { bot.SendReply(e, "Correct Usage: " + e.Command + " [message]"); return; } string message = e.Words[0].Trim(); string group = bot.Configuration.GetString(this._client.InternalName, "group", bot.Character); bot.SendReply(e, "Contacting the Vhanet announce system. Please stand by..."); int messageID; MessageResult messageResult; messageResult = bot.SendRemotePluginMessage(this.InternalName, "vhanet@rubika", "VhanetMassInviteHost", "announce", out messageID, group, bot.Character, e.Sender, message); if (messageResult != MessageResult.Success) { bot.SendReply(e, "Unable to contact the Vhanet announce system. Return code was: " + HTML.CreateColorString(bot.ColorHeaderHex, messageResult.ToString())); return; } ReplyMessage messageReply = bot.GetReplyMessage(messageID, 60000); if (messageReply == null) { bot.SendReply(e, "Didn't receive a reply from the Vhanet announce system"); return; } string[] members = (string[])messageReply.Args[0]; if (invite) { List <string> massed = new List <string>(); foreach (string member in members) { if (!bot.PrivateChannel.IsOn(member)) { bot.PrivateChannel.Invite(member); massed.Add(member); } } RichTextWindow window = new RichTextWindow(bot); window.AppendTitle("Members"); window.AppendHighlight(string.Join(", ", massed.ToArray())); bot.SendReply(e, "Sending out an mass invite to " + HTML.CreateColorString(bot.ColorHeaderHex, massed.Count.ToString()) + " members »» ", window); } break; } }
private void OnAuctionCommand(BotShell bot, CommandArgs e) { if (!this._running) { bot.SendReply(e, "There is currently no auction running"); return; } RichTextWindow window = new RichTextWindow(bot); window.AppendTitle("Auction"); window.AppendHighlight("Item: "); window.AppendNormalStart(); window.AppendRawString(this._item); window.AppendString(" ["); window.AppendBotCommand("Abort", "auction abort"); window.AppendString("]"); window.AppendColorEnd(); window.AppendLineBreak(); window.AppendHighlight("High Bidder: "); if (this._currentBid > 0) { window.AppendNormal(this._bidder); window.AppendLineBreak(); window.AppendHighlight("High Bid: "); window.AppendNormal(this._currentBid.ToString()); } else { window.AppendNormal("N/A"); } window.AppendLineBreak(); double points = this._core.GetPoints(e.Sender); if (points > this._core.MinimumPoints) { window.AppendHighlight("Your Points: "); if (points > this._currentBid) { window.AppendColorString(RichTextWindow.ColorGreen, points.ToString()); } else { window.AppendColorString(RichTextWindow.ColorRed, points.ToString()); } window.AppendLineBreak(); } window.AppendHighlight("Time Left: "); window.AppendNormal(this._timeLeft.ToString() + " seconds"); window.AppendLineBreak(); bot.SendReply(e, "Auction »» ", window); }
private void OnBansCommand(BotShell bot, CommandArgs e) { Ban[] bans = bot.Bans.List(); RichTextWindow window = new RichTextWindow(bot); window.AppendTitle("Bans"); foreach (Ban ban in bans) { window.AppendHighlight(ban.Character); window.AppendNormal(" (By " + ban.AddedBy + " on " + Format.DateTime(ban.AddedOn, FormatStyle.Compact) + ")"); window.AppendLineBreak(); } bot.SendReply(e, HTML.CreateColorString(bot.ColorHeaderHex, bans.Length.ToString()) + " Bans »» ", window); }
private void OnMembersCommand(BotShell bot, CommandArgs e) { SortedDictionary <string, UserLevel> members = bot.Users.GetUsers(); RichTextWindow window = new RichTextWindow(bot); window.AppendTitle("Members"); foreach (KeyValuePair <string, UserLevel> member in members) { window.AppendHighlight(member.Key); window.AppendNormal(" (" + member.Value + ")"); window.AppendLineBreak(); } bot.SendReply(e, HTML.CreateColorString(bot.ColorHeaderHex, members.Count.ToString()) + " Members »» ", window); }
public override void OnCommand(BotShell bot, CommandArgs e) { if (e.Items.Length < 1) { bot.SendReply(e, "Correct Usage: bio [bio material]"); return; } foreach (AoItem match in e.Items) { if (this._clumps.ContainsKey(match.HighID)) { string name = "QL " + match.QL + " " + this._clumps[match.HighID].Clump; if (this._clumps[match.HighID].Weapons.Count > 0) { double hql = Math.Floor((match.QL * 1.1)); if (hql > 300) { hql = 300; } RichTextWindow window = new RichTextWindow(bot); window.AppendTitle("Kyr'Ozch Weapons"); window.AppendHighlight("The following weapons can be created using your " + name + ":"); window.AppendLineBreak(); foreach (VhBioWeapon weapon in this._clumps[match.HighID].Weapons) { if (weapon.HighQL >= hql && weapon.LowQL <= hql) { window.AppendNormal("- "); window.AppendItem("Kyr'Ozch " + weapon.Name + " - Type " + this._clumps[match.HighID].Type, weapon.LowID, weapon.HighID, Convert.ToInt32(hql)); window.AppendLineBreak(); } } bot.SendReply(e, name + " (" + this._clumps[match.HighID].Description + ")" + " »» ", window); } else { bot.SendReply(e, name + " (" + this._clumps[match.HighID].Description + ")"); } } else if (match.Name == "Solid Clump of Kyr'Ozch Bio-Material") { bot.SendReply(e, "Unable to identify your " + HTML.CreateColorString(bot.ColorHeaderHex, match.Name)); } else { bot.SendReply(e, HTML.CreateColorString(bot.ColorHeaderHex, match.Name) + " doesn't look like a " + HTML.CreateColorString(bot.ColorHeaderHex, "Solid Clump of Kyr'Ozch Bio-Material")); } } }
public void OnBattleCommand(BotShell bot, CommandArgs e) { try { using (IDbCommand command = this._database.Connection.CreateCommand()) { RichTextWindow window = new RichTextWindow(bot); window.AppendTitle("Tower Battle History"); window.AppendLineBreak(); command.CommandText = "SELECT [time], [atkrSide] , [atkrOrg], [atkrName], [defSide], [defOrg], [zone], [xCoord], [yCoord], [LCA] FROM [towerhistory] WHERE victory = 0 ORDER BY [time] DESC LIMIT 10"; IDataReader reader = command.ExecuteReader(); while (reader.Read()) { window.AppendHeader(Format.DateTime(reader.GetInt64(0), FormatStyle.Compact) + " GMT"); if (!reader.IsDBNull(2)) { window.AppendHighlight("Attacker: "); window.AppendColorString(this.sideColorWindow(reader.GetString(3), reader.GetString(1)), reader.GetString(3)); window.AppendNormal(" - ("); window.AppendColorString(this.sideColorWindow(reader.GetString(2), reader.GetString(1)), reader.GetString(2)); window.AppendNormal(")"); window.AppendLineBreak(); } else { WhoisResult whois = XML.GetWhois(reader.GetString(3), bot.Dimension); window.AppendHighlight("Attacker: "); window.AppendColorString(this.sideColorWindow(reader.GetString(3), whois.Stats.Faction), reader.GetString(3)); window.AppendNormal(" - (Unguilded)"); window.AppendLineBreak(); } window.AppendHighlight("Defender: "); window.AppendColorString(this.sideColorWindow(reader.GetString(5), reader.GetString(4)), reader.GetString(5)); window.AppendLineBreak(); window.AppendHighlight("Location: "); window.AppendNormal(reader.GetString(6) + " (x"); window.AppendColorString("FF0000", reader.GetInt64(9).ToString()); window.AppendNormal(" " + reader.GetInt64(7) + "x" + reader.GetInt64(8) + ")"); window.AppendLineBreak(2); } bot.SendReply(e, " Tower Battle Results »» ", window); return; } } catch { bot.SendReply(e, "Error retrieving battle history!"); } }
public void OnLinksCommand(BotShell bot, CommandArgs e) { RichTextWindow window = new RichTextWindow(bot); window.AppendTitle(); int links = 0; using (IDbCommand command = this._database.Connection.CreateCommand()) { command.CommandText = "SELECT id, category, link, description FROM links ORDER BY category, description"; IDataReader reader = command.ExecuteReader(); string lastCategory = ""; while (reader.Read()) { int id = reader.GetInt32(0); string category = reader.GetString(1); string link = reader.GetString(2); string description = reader.GetString(3); if (category != lastCategory) { if (links > 0) { window.AppendLineBreak(); } window.AppendHeader(category); lastCategory = category; } window.AppendHighlight(description); window.AppendNormalStart(); window.AppendString(" ["); window.AppendCommand("Visit", "/start " + link); window.AppendString("] ["); window.AppendBotCommand("Remove", "links remove " + id); window.AppendString("]"); window.AppendColorEnd(); window.AppendLineBreak(); links++; } } if (links > 0) { bot.SendReply(e, "Links and Bookmarks »» ", window); } else { bot.SendReply(e, "There are currently no links in the database"); } }
public override void OnCommand(BotShell bot, CommandArgs e) { Int32 cycle = 7 + 7 + 7; string today = string.Empty; DateTimeFormatInfo dtfi = new CultureInfo("en-US", false).DateTimeFormat; RichTextWindow window = new RichTextWindow(bot); window.AppendTitle("Beast Days"); for (int i = 0; i < cycle; i++) { Int64 current = TimeStamp.Now + ((24 * 60 * 60) * i); Int64 secondsSinceStart = current - TimeStamp.FromDateTime(new DateTime(2006, 10, 23)); Int64 seconds = secondsSinceStart % (cycle * (24 * 60 * 60)); Int64 day = (seconds / (24 * 60 * 60)) + 1; string type = string.Empty; if (day <= 7) { type = HTML.CreateColorString(RichTextWindow.ColorBlue, "Omni"); } else if (day > 7 && day <= 14) { type = HTML.CreateColorString(RichTextWindow.ColorGreen, "FFA"); } else if (day > 14) { type = HTML.CreateColorString(RichTextWindow.ColorOrange, "Clan"); } if (type == string.Empty) { continue; } if (i == 0) { today = type; } window.AppendHighlight(TimeStamp.ToDateTime(current).ToString("[dd/MM/yyyy]", dtfi)); window.AppendNormal(TimeStamp.ToDateTime(current).ToString(" dddd: ", dtfi)); window.AppendRawString(type); window.AppendLineBreak(); } bot.SendReply(e, "Today is " + today + " day »» " + window.ToString()); }
private void OnConfigurationColorCommand(BotShell bot, CommandArgs e) { if (e.Args.Length < 2) { bot.SendReply(e, "Usage: configuration color [plugin] [key]"); return; } if (!bot.Configuration.IsRegistered(e.Args[0], e.Args[1])) { bot.SendReply(e, "No such configuration entry"); return; } RichTextWindow window = new RichTextWindow(bot); window.AppendTitle(); bool first = true; string section = e.Args[0].ToLower(); string key = e.Args[1].ToLower(); string command = "configuration set " + section + " " + key + " "; foreach (KeyValuePair <string, string> color in this.Colors) { if (color.Value != string.Empty) { window.AppendString(" "); window.AppendBotCommandStart(command + color.Value, true); window.AppendColorString(color.Value, color.Key); window.AppendCommandEnd(); window.AppendLineBreak(); } else { if (!first) { window.AppendLineBreak(); } window.AppendHeader(color.Key); first = false; } } window.AppendLineBreak(); window.AppendHeader("Other"); window.AppendHighlight("To select a different color not listed above use: "); window.AppendLineBreak(); window.AppendNormal("/tell " + bot.Character + " " + command + "<color hex>"); bot.SendReply(e, "Color Selection »» ", window); }
private void StartedEvent(object sender, EventArgs e) { if (this.CreditsEnabled) { if (!this._core.Locked) { this._core.Locked = true; //this._bot.SendPrivateChannelMessage(this._bot.ColorHighlight + "The raid has been " + HTML.CreateColorString(RichTextWindow.ColorRed, "locked") + " pending raid credits type selection"); } this.CreditsType = -1; RichTextWindow window = new RichTextWindow(this._bot); window.AppendTitle("Raid Credits Selection"); window.AppendHighlight("The raid credits system has been enabled."); window.AppendLineBreak(); window.AppendHighlight("Please select which type of raid credits should be used for this raid."); window.AppendLineBreak(2); lock (this._database.Connection) { using (IDbCommand command = this._database.Connection.CreateCommand()) { command.CommandText = "SELECT type, name, description, credits FROM credits_types"; IDataReader reader = command.ExecuteReader(); while (reader.Read()) { window.AppendHeader(reader.GetString(1)); window.AppendHighlight(reader.GetString(2)); window.AppendLineBreak(); window.AppendNormal("["); window.AppendBotCommand("Select", "raid credits " + reader.GetInt32(0)); window.AppendNormal("]"); window.AppendLineBreak(2); } reader.Close(); } } window.AppendHeader("No Credits"); window.AppendHighlight("Selecting this option will cause no raid credits to be charged this raid."); window.AppendLineBreak(); window.AppendHighlight("This option is useful for unannounced or unplanned raids."); window.AppendLineBreak(); window.AppendNormal("["); window.AppendBotCommand("Select", "raid unlock"); window.AppendNormal("]"); window.AppendLineBreak(2); this._bot.SendPrivateChannelMessage(this._bot.ColorHighlight + "Please select raid credits type »» " + window.ToString()); } }
private void OnCallersCommand(BotShell bot, CommandArgs e) { if (this.Callers.Count < 1) { bot.SendReply(e, "There are no assigned callers"); return; } RichTextWindow callersWindow = new RichTextWindow(bot); callersWindow.AppendTitle("Callers"); string assistAll = string.Empty; lock (this.Callers) { foreach (string caller in this.Callers) { callersWindow.AppendHighlight(Format.UppercaseFirst(caller)); callersWindow.AppendNormalStart(); callersWindow.AppendString(" ["); callersWindow.AppendCommand("Assist", "/assist " + caller); callersWindow.AppendString("] ["); callersWindow.AppendCommand("Macro", "/macro " + caller + " /assist " + caller); callersWindow.AppendString("] ["); callersWindow.AppendBotCommand("Remove", "callers remove " + caller); callersWindow.AppendString("]"); callersWindow.AppendColorEnd(); callersWindow.AppendLineBreak(); assistAll += "/assist " + caller + "\\n "; } } callersWindow.AppendLineBreak(); callersWindow.AppendHeader("Options"); callersWindow.AppendHighlight("Assist All: "); callersWindow.AppendCommand("Click", assistAll.Substring(0, assistAll.Length - 3)); callersWindow.AppendLineBreak(); callersWindow.AppendHighlight("Assist All Macro: "); callersWindow.AppendNormal("/macro assist " + assistAll.Substring(0, assistAll.Length - 3)); callersWindow.AppendLineBreak(); callersWindow.AppendHighlight("Clear List: "); callersWindow.AppendBotCommand("Click", "callers remove all"); bot.SendReply(e, "Callers »» ", callersWindow); }
public void OnPluginsOverviewCommand(BotShell bot, CommandArgs e) { RichTextWindow window = new RichTextWindow(bot); window.AppendTitle(); string[] plugins = bot.Plugins.GetPlugins(); foreach (string plugin in plugins) { if (bot.Plugins.GetState(plugin) == PluginState.Core) { continue; } PluginLoader info = bot.Plugins.GetLoader(plugin); window.AppendHeader(info.Name + " v" + info.Version); if (!string.IsNullOrEmpty(info.Description)) { window.AppendHighlight("Description: "); window.AppendNormal(info.Description); window.AppendLineBreak(); } window.AppendHighlight("Author: "); window.AppendNormal(info.Author); window.AppendLineBreak(); window.AppendHighlight("Commands: "); List <string> commands = new List <string>(); foreach (Command command in info.Commands) { if (!command.IsAlias) { commands.Add(Format.UppercaseFirst(command.CommandName)); } } window.AppendNormal(string.Join(", ", commands.ToArray())); window.AppendLineBreak(2); } bot.SendReply(e, "Plugins Overview »» ", window); }
private void TrickleStr(BotShell bot, CommandArgs e) { Double Test; Test = Convert.ToInt32(e.Args[0]); RichTextWindow window = new RichTextWindow(bot); window.AppendNormalStart(); window.AppendTitle(); window.AppendString(" Body"); window.AppendLineBreak(); window.AppendString("Adventuring: "); window.AppendNormal(Math.Floor(((Test / 4) * .20)).ToString()); window.AppendLineBreak(); window.AppendString("Brawling: "); window.AppendNormal(Math.Floor(((Test / 4) * .60)).ToString()); window.AppendLineBreak(); window.AppendString("Martial Arts: "); window.AppendNormal(Math.Floor(((Test / 4) * .20)).ToString()); window.AppendLineBreak(); window.AppendString("Swimming: "); window.AppendNormal(Math.Floor(((Test / 4) * .20)).ToString()); window.AppendLineBreak(); window.AppendLineBreak(); window.AppendString(" Melee"); window.AppendLineBreak(); window.AppendString("1 Handed Blunt: "); window.AppendNormal(Math.Floor(((Test / 4) * .40)).ToString()); window.AppendLineBreak(); window.AppendString("1 Handed Edged: "); window.AppendNormal(Math.Floor(((Test / 4) * .60)).ToString()); window.AppendLineBreak(); window.AppendString("2 Handed Blunt: "); window.AppendNormal(Math.Floor(((Test / 4) * .50)).ToString()); window.AppendLineBreak(); window.AppendString("2 Handed Edged: "); window.AppendNormal(Math.Floor(((Test / 4) * .30)).ToString()); window.AppendLineBreak(); window.AppendString("Multiple Melee: "); window.AppendNormal(Math.Floor(((Test / 4) * .30)).ToString()); window.AppendLineBreak(); window.AppendString("Parry: "); window.AppendNormal(Math.Floor(((Test / 4) * .50)).ToString()); window.AppendLineBreak(); window.AppendString("Piercing: "); window.AppendNormal(Math.Floor(((Test / 4) * .20)).ToString()); window.AppendLineBreak(); window.AppendLineBreak(); window.AppendString(" Misc"); window.AppendLineBreak(); window.AppendString("Heavy Weapons: "); window.AppendNormal(Math.Floor(((Test / 4) * .40)).ToString()); window.AppendLineBreak(); window.AppendString("Sharp Object: "); window.AppendNormal(Math.Floor(((Test / 4) * .20)).ToString()); window.AppendLineBreak(); window.AppendLineBreak(); window.AppendString(" Ranged"); window.AppendLineBreak(); window.AppendString("Assault Rifle: "); window.AppendNormal(Math.Floor(((Test / 4) * .10)).ToString()); window.AppendLineBreak(); window.AppendString("Bow Special Attack: "); window.AppendNormal(Math.Floor(((Test / 4) * .10)).ToString()); window.AppendLineBreak(); window.AppendString("Bow: "); window.AppendNormal(Math.Floor(((Test / 4) * .20)).ToString()); window.AppendLineBreak(); window.AppendString("Burst: "); window.AppendNormal(Math.Floor(((Test / 4) * .30)).ToString()); window.AppendLineBreak(); window.AppendString("Full Auto: "); window.AppendNormal(Math.Floor(((Test / 4) * .60)).ToString()); window.AppendLineBreak(); window.AppendString("Shotgun: "); window.AppendNormal(Math.Floor(((Test / 4) * .40)).ToString()); window.AppendLineBreak(); window.AppendString("SMG/MG: "); window.AppendNormal(Math.Floor(((Test / 4) * .30)).ToString()); window.AppendLineBreak(); window.AppendLineBreak(); window.AppendString(" Speed"); window.AppendLineBreak(); window.AppendString("Runspeed: "); window.AppendNormal(Math.Floor(((Test / 4) * .20)).ToString()); window.AppendLineBreak(); window.AppendLineBreak(); window.AppendString(" Trade & Repair"); window.AppendLineBreak(); window.AppendString("Weapon Smithing: "); window.AppendNormal(Math.Floor(((Test / 4) * .50)).ToString()); window.AppendLineBreak(); window.AppendLineBreak(); window.AppendString(" Nano and Aiding"); window.AppendLineBreak(); window.AppendString("Sensory Improvement: "); window.AppendNormal(Math.Floor(((Test / 4) * .20)).ToString()); window.AppendLineBreak(); bot.SendReply(e, bot.ColorHeader + "Trickling " + bot.ColorHighlight + e.Args[0] + bot.ColorHeader + " To Strength " + bot.ColorHighlight + " »» ", window); }
public void OnVictoryCommand(BotShell bot, CommandArgs e) { try { using (IDbCommand command = this._database.Connection.CreateCommand()) { RichTextWindow window = new RichTextWindow(bot); window.AppendTitle("Tower Victory History"); window.AppendLineBreak(); command.CommandText = "SELECT [time], [atkrSide], [atkrOrg], [defSide], [defOrg], [zone] FROM [towerhistory] WHERE victory = 1 ORDER BY [time] DESC LIMIT 10"; IDataReader reader = command.ExecuteReader(); while (reader.Read()) { window.AppendHeader(Format.DateTime(reader.GetInt64(0), FormatStyle.Compact) + " GMT"); if (!reader.IsDBNull(1)) { window.AppendHighlight("Attacker: "); window.AppendColorString(this.sideColorWindow(reader.GetString(2), reader.GetString(1)), reader.GetString(2)); window.AppendLineBreak(); window.AppendHighlight("Defender: "); window.AppendColorString(this.sideColorWindow(reader.GetString(4), reader.GetString(3)), reader.GetString(4)); window.AppendLineBreak(); window.AppendHighlight("Location: "); window.AppendNormal(reader.GetString(5)); window.AppendLineBreak(2); } else { window.AppendColorString(this.sideColor(reader.GetString(4), reader.GetString(3)), reader.GetString(4)); window.AppendNormal(" lost their base in " + reader.GetString(5) + "."); window.AppendLineBreak(2); } } bot.SendReply(e, " Tower Victory Results »» ", window); return; } } catch { bot.SendReply(e, "Error retrieving battle victory history!"); } }