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 OnTeamsCommand(BotShell bot, CommandArgs e) { RichTextWindow window = new RichTextWindow(bot); window.AppendHighlight(":: "); window.AppendColorString(bot.ColorHeaderHex, "Teams"); window.AppendHighlight(" ::"); bool found = false; int currentTeam = -1; int currentMember = 0; using (IDbCommand command = this._database.Connection.CreateCommand()) { command.CommandText = "SELECT username, team, leader FROM teams ORDER BY team, username"; IDataReader reader = command.ExecuteReader(); while (reader.Read()) { string username = Format.UppercaseFirst(reader.GetString(0)); int team = (int)reader.GetInt64(1); bool leader = (reader.GetInt64(2) > 0); if (team != currentTeam) { currentMember = 0; currentTeam = team; window.AppendLineBreak(); window.AppendHighlight(" Team " + team + ": "); } currentMember++; window.AppendNormalStart(); window.AppendString(""); if (leader) { window.AppendColorString(RichTextWindow.ColorRed, username); } else { window.AppendString(username); } window.AppendString(" "); window.AppendColorEnd(); found = true; } reader.Close(); } if (found) { bot.SendReply(e, window.Text); return; } bot.SendReply(e, "There are currently no teams setup"); }
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); }
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"); } }
private void CreateSelectLine(BotShell bot, ref RichTextWindow window, string command) { CommandRights rights = bot.Commands.GetRights(command); command = command.Replace(" ", "_"); this.CreateSelectPanel(ref window, rights.PrivateMessage, "commands set " + command + " tell"); window.AppendString(" "); this.CreateSelectPanel(ref window, rights.PrivateChannel, "commands set " + command + " pg"); window.AppendString(" "); this.CreateSelectPanel(ref window, rights.Organization, "commands set " + command + " org"); window.AppendHighlight(" " + Format.UppercaseFirst(command.Replace("_", " "))); window.AppendNormalStart(); window.AppendString(" ["); window.AppendBotCommand("Reset", "commands reset " + command); window.AppendString("]"); window.AppendColorEnd(); }
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); }
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 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"); } }
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 CreateSelectPanel(ref RichTextWindow window, UserLevel right, string command) { command = command.Trim(); window.AppendNormalStart(); window.AppendString("["); window.AppendBotCommand("D", command + " Disabled", (right == UserLevel.Disabled)); window.AppendString(" "); window.AppendBotCommand("G", command + " Guest", (right == UserLevel.Guest)); window.AppendString(" "); window.AppendBotCommand("M", command + " Member", (right == UserLevel.Member)); window.AppendString(" "); window.AppendBotCommand("L", command + " Leader", (right == UserLevel.Leader)); window.AppendString(" "); window.AppendBotCommand("A", command + " Admin", (right == UserLevel.Admin)); window.AppendString(" "); window.AppendBotCommand("S", command + " SuperAdmin", (right == UserLevel.SuperAdmin)); window.AppendString("]"); window.AppendColorEnd(); }
private void OnRaidLogs(BotShell bot, CommandArgs e) { Dictionary <string, string> colors = new Dictionary <string, string>(); colors.Add("raid", RichTextWindow.ColorOrange); colors.Add("raiders", "FF4500"); colors.Add("credits", "ADFF2F"); colors.Add("points", "00FFFF"); colors.Add("auction", "A52A2A"); int max = 250; RaidCore.LogEntry[] logs = new RaidCore.LogEntry[0]; string title; if (e.Args.Length > 0) { try { // Try if it's a raid ID logs = this._core.GetLogs(0, Convert.ToInt32(e.Args[0])); title = logs.Length + " Log Entries on Raid #" + Convert.ToInt32(e.Args[0]); } catch { // No raid ID, player maybe? e.Args[0] = bot.Users.GetMain(e.Args[0]); logs = this._core.GetLogs(0, e.Args[0]); title = logs.Length + " Log Entries for " + Format.UppercaseFirst(e.Args[0]); } } else { // No arguments, let's just fetch the last entries logs = this._core.GetLogs(max); title = logs.Length + " Last Log Entries"; } if (logs.Length == 0) { bot.SendReply(e, "No log entries found"); return; } RichTextWindow window = new RichTextWindow(bot); window.AppendTitle(title); foreach (RaidCore.LogEntry log in logs) { window.AppendHighlight("[" + log.Time.ToString("dd/MM/yyyy hh:mm:ss") + "] "); window.AppendNormalStart(); if (log.RaidID > 0) { window.AppendString("["); window.AppendColorString(colors["raid"], "Raid #" + log.RaidID); window.AppendString("] "); } window.AppendString("["); if (colors.ContainsKey(log.Type.ToLower())) { window.AppendColorString(colors[log.Type.ToLower()], Format.UppercaseFirst(log.Type)); } else { window.AppendString(Format.UppercaseFirst(log.Type)); } window.AppendString("] "); window.AppendString(log.Message); if (log.Admin != null && log.Admin != string.Empty) { window.AppendString(" (Admin: " + log.Admin + ")"); } window.AppendColorEnd(); window.AppendLineBreak(); } bot.SendReply(e, title + " »» ", window); }
private void OnRaidListCommand(BotShell bot, CommandArgs e) { if (!this._core.Running) { bot.SendReply(e, "There is currently no raid active"); return; } RaidCore.Raider[] raiders = this._core.GetRaiders(); if (raiders.Length == 0) { bot.SendReply(e, "There is currently nobody on the raid"); return; } RichTextWindow window = new RichTextWindow(bot); window.AppendTitle("Raiders List"); SortedDictionary <string, Dictionary <RaidCore.Raider, WhoisResult> > sorted = new SortedDictionary <string, Dictionary <RaidCore.Raider, WhoisResult> >(); foreach (RaidCore.Raider raider in raiders) { WhoisResult whois = XML.GetWhois(raider.Character, bot.Dimension); if (whois == null || !whois.Success) { whois = new WhoisResult(); whois.Name = new WhoisResult_Name(); whois.Name.Nickname = raider.Character; whois.Stats = new WhoisResult_Stats(); whois.Stats.Level = 0; whois.Stats.Profession = "Unknown"; whois.Stats.DefenderLevel = 0; } if (!sorted.ContainsKey(whois.Stats.Profession)) { sorted.Add(whois.Stats.Profession, new Dictionary <RaidCore.Raider, WhoisResult>()); } sorted[whois.Stats.Profession].Add(raider, whois); } foreach (KeyValuePair <string, Dictionary <RaidCore.Raider, WhoisResult> > kvp in sorted) { window.AppendHighlight(kvp.Key); window.AppendLineBreak(); foreach (KeyValuePair <RaidCore.Raider, WhoisResult> raider in kvp.Value) { window.AppendNormalStart(); window.AppendString("- " + raider.Key.Character); if (raider.Key.Main != raider.Key.Character) { window.AppendString(" (" + raider.Key.Main + ")"); } if (raider.Value.Stats.Profession != "Unknown") { window.AppendString(" (L " + raider.Value.Stats.Level + "/" + raider.Value.Stats.DefenderLevel + ")"); } if (!raider.Key.OnRaid) { window.AppendString(" ("); window.AppendColorString(RichTextWindow.ColorRed, "Inactive"); window.AppendString(")"); } window.AppendString(" ["); window.AppendCommand("Check", "/assist " + raider.Key.Character); window.AppendString("] ["); window.AppendBotCommand("Kick", "raid kick " + raider.Key.Character); window.AppendString("] "); window.AppendColorEnd(); window.AppendLineBreak(true); } window.AppendLineBreak(); } bot.SendReply(e, "Raiders List »» ", window); }
public void OnPluginsInfoCommand(BotShell bot, CommandArgs e) { PluginLoader info = bot.Plugins.GetLoader(e.Args[1]); if (info == null) { bot.SendReply(e, "Unable to get plugin information"); return; } RichTextWindow infoWindow = new RichTextWindow(bot); infoWindow.AppendTitle("Plugin Information"); infoWindow.AppendHighlight("Name: "); infoWindow.AppendNormal(info.Name); infoWindow.AppendLineBreak(); infoWindow.AppendHighlight("Version: "); infoWindow.AppendNormal(info.Version.ToString()); infoWindow.AppendLineBreak(); infoWindow.AppendHighlight("Author: "); infoWindow.AppendNormal(info.Author); infoWindow.AppendLineBreak(); infoWindow.AppendHighlight("Internal Name: "); infoWindow.AppendNormal(info.InternalName); infoWindow.AppendLineBreak(); if (info.Description != null) { infoWindow.AppendHighlight("Description: "); infoWindow.AppendNormal(info.Description); infoWindow.AppendLineBreak(); } infoWindow.AppendHighlight("State: "); infoWindow.AppendNormal(bot.Plugins.GetState(info.InternalName).ToString()); infoWindow.AppendLineBreak(); if (info.Commands.Length > 0) { infoWindow.AppendHighlight("Commands: "); infoWindow.AppendLineBreak(); bool isLoaded = bot.Plugins.IsLoaded(info.InternalName); lock (info) { foreach (Command command in info.Commands) { infoWindow.AppendNormalStart(); infoWindow.AppendString(" " + Format.UppercaseFirst(command.CommandName)); if (!isLoaded && bot.Commands.Exists(command.CommandName)) { infoWindow.AppendString(" ("); infoWindow.AppendColorString(RichTextWindow.ColorRed, "Conflict with " + bot.Plugins.GetName(bot.Commands.GetInternalName(command.CommandName))); infoWindow.AppendString(")"); } infoWindow.AppendColorEnd(); infoWindow.AppendLineBreak(); } } } if (info.Dependencies.Length > 0) { infoWindow.AppendHighlight("Dependencies: "); infoWindow.AppendLineBreak(); lock (info) { foreach (string dependency in info.Dependencies) { infoWindow.AppendNormalStart(); infoWindow.AppendString(" "); if (bot.Plugins.Exists(dependency)) { infoWindow.AppendString(bot.Plugins.GetName(dependency)); infoWindow.AppendString(" ("); if (bot.Plugins.IsLoaded(dependency)) { infoWindow.AppendColorString(RichTextWindow.ColorGreen, "Loaded"); } else { infoWindow.AppendColorString(RichTextWindow.ColorOrange, "Not Loaded"); } infoWindow.AppendString(") ["); infoWindow.AppendCommand("Info", "plugins info " + dependency); infoWindow.AppendString("]"); } else { infoWindow.AppendString(dependency + " ("); infoWindow.AppendColorString(RichTextWindow.ColorRed, "Not Found"); infoWindow.AppendString(")"); } infoWindow.AppendColorEnd(); infoWindow.AppendLineBreak(); } } } bot.SendReply(e, "Plugin Information »» " + infoWindow.ToString()); }
public override void OnCommand(BotShell bot, CommandArgs e) { if (e.FromSlave && e.Type == CommandType.PrivateChannel) { return; } switch (e.Command) { case "lock": if (this._locked) { bot.SendReply(e, "The private channel already is locked"); return; } this._lockedBy = e.Sender; this._locked = true; string lockMessage = bot.ColorHeader + e.Sender + bot.ColorHighlight + " has locked the private channel"; this.SendMessage(bot, lockMessage); break; case "unlock": if (!this._locked) { bot.SendReply(e, "The private channel already is unlocked"); return; } this._locked = false; string unlockMessage = bot.ColorHeader + e.Sender + bot.ColorHighlight + " has unlocked the private channel"; this.SendMessage(bot, unlockMessage); break; case "join": if (bot.PrivateChannel.IsOn(e.SenderID)) { bot.SendReply(e, "You already are on the private channel"); return; } if (this._locked && bot.Users.GetUser(e.Sender) < UserLevel.Leader) { bot.SendReply(e, "The private channel is currently locked by " + bot.ColorHeader + this._lockedBy); return; } bot.SendReply(e, "Inviting you to the private channel"); bot.PrivateChannel.Invite(e.SenderID); break; case "leave": if (!bot.PrivateChannel.IsOn(e.SenderID)) { bot.SendReply(e, "You're not on the private channel"); return; } if (e.Type != CommandType.PrivateChannel) { bot.SendReply(e, "Kicking you from the private channel"); } // Remove a user from the vhabot raid system before letting him leave if (bot.Plugins.IsLoaded("raidcore")) { bot.SendPluginMessageAndWait(this.InternalName, "raidcore", "RemoveRaider", 1000, e.Sender); } bot.PrivateChannel.Kick(e.SenderID); break; case "invite": if (e.Args.Length < 1) { bot.SendReply(e, "Correct Usage: invite [username]"); break; } if (bot.GetUserID(e.Args[0]) < 1) { bot.SendReply(e, "No such user: "******" already is on the private channel"); break; } if (this._locked && bot.Users.GetUser(e.Sender) < UserLevel.Leader) { bot.SendReply(e, "The private channel is currently locked by " + bot.ColorHeader + this._lockedBy); return; } bot.SendReply(e, "Inviting " + HTML.CreateColorString(bot.ColorHeaderHex, Format.UppercaseFirst(e.Args[0])) + " to the private channel"); bot.PrivateChannel.Invite(e.Args[0]); break; case "kick": if (e.Args.Length < 1) { bot.SendReply(e, "Correct Usage: kick [username]"); break; } if (e.Args[0].ToLower() == "all") { bot.SendReply(e, "Clearing the private channel"); bot.PrivateChannel.KickAll(); break; } if (bot.GetUserID(e.Args[0]) < 1) { bot.SendReply(e, "No such user: "******" isn't on the private channel"); break; } if (bot.Users.GetMain(e.Args[0]).Equals(bot.Admin, StringComparison.CurrentCultureIgnoreCase)) { bot.SendReply(e, "You can't kick the bot owner"); break; } if (bot.Users.GetUser(e.Args[0]) > bot.Users.GetUser(e.Sender)) { bot.SendReply(e, HTML.CreateColorString(bot.ColorHeaderHex, Format.UppercaseFirst(e.Args[0])) + " outranks you"); break; } // Remove a user from the vhabot raid system before kicking them if (bot.Plugins.IsLoaded("RaidCore")) { bot.SendPluginMessageAndWait(this.InternalName, "raidcore", "RemoveRaider", 1000, e.Args[0]); } bot.SendReply(e, "Kicking " + HTML.CreateColorString(bot.ColorHeaderHex, Format.UppercaseFirst(e.Args[0])) + " from the private channel"); bot.PrivateChannel.Kick(e.Args[0]); break; case "guestlist": string[] guestlist = bot.FriendList.List("guestlist"); if (guestlist.Length == 0) { bot.SendReply(e, "There are no users on the guestlist"); break; } RichTextWindow window = new RichTextWindow(bot); window.AppendTitle("Guestlist"); foreach (string guest in guestlist) { window.AppendHighlight(Format.UppercaseFirst(guest)); window.AppendNormalStart(); window.AppendString(" ["); window.AppendBotCommand("Remove", "guestlist remove " + guest); window.AppendString("]"); window.AppendColorEnd(); window.AppendLineBreak(); } bot.SendReply(e, guestlist.Length + " Guests »» ", window); break; case "guestlist add": if (e.Args.Length < 1) { bot.SendReply(e, "Correct Usage: guestlist add [username]"); break; } if (bot.GetUserID(e.Args[0]) < 1) { bot.SendReply(e, "No such user: "******"guestlist", e.Args[0])) { bot.SendReply(e, HTML.CreateColorString(bot.ColorHeaderHex, Format.UppercaseFirst(e.Args[0])) + " already is on the guestlist"); break; } bot.FriendList.Add("guestlist", e.Args[0]); bot.SendReply(e, HTML.CreateColorString(bot.ColorHeaderHex, Format.UppercaseFirst(e.Args[0])) + " has been added to the guestlist"); break; case "guestlist remove": if (e.Args.Length < 1) { if (bot.FriendList.IsFriend("guestlist", e.Sender)) { bot.SendReply(e, "You have been removed from the guestlist"); bot.FriendList.Remove("guestlist", e.Sender); } else { bot.SendReply(e, "You're not on the guestlist"); } break; } if (bot.GetUserID(e.Args[0]) < 1) { bot.SendReply(e, "No such user: "******"guestlist", e.Args[0])) { bot.SendReply(e, HTML.CreateColorString(bot.ColorHeaderHex, Format.UppercaseFirst(e.Args[0])) + " is not on the guestlist"); break; } bot.FriendList.Remove("guestlist", e.Args[0]); bot.SendReply(e, HTML.CreateColorString(bot.ColorHeaderHex, Format.UppercaseFirst(e.Args[0])) + " has been removed from the guestlist"); break; } }
private void OnTeamsAdminCommand(BotShell bot, CommandArgs e) { List <string> seen = new List <string>(); List <int> teams = new List <int>(); using (IDbCommand command = this._database.Connection.CreateCommand()) { command.CommandText = "SELECT team FROM teams GROUP BY team"; IDataReader reader = command.ExecuteReader(); while (reader.Read()) { teams.Add((int)reader.GetInt64(0)); } reader.Close(); } RichTextWindow window = new RichTextWindow(bot); window.AppendTitle("Teams Manager"); window.AppendCommand("Display Teams", "/g " + bot.Character + " " + bot.CommandSyntax + "teams"); window.AppendLineBreak(); window.AppendBotCommand("Refresh Manager", "teams admin"); window.AppendLineBreak(); window.AppendBotCommand("Clear Teams", "teams clear"); window.AppendLineBreak(); int currentTeam = -1; int currentMember = 0; using (IDbCommand command = this._database.Connection.CreateCommand()) { command.CommandText = "SELECT username, team, leader FROM teams ORDER BY team, username"; IDataReader reader = command.ExecuteReader(); while (reader.Read()) { string username = Format.UppercaseFirst(reader.GetString(0)); seen.Add(username); int team = (int)reader.GetInt64(1); bool leader = (reader.GetInt64(2) > 0); if (team != currentTeam) { currentMember = 0; currentTeam = team; window.AppendLineBreak(); window.AppendHeader("Team " + team); } currentMember++; WhoisResult whois = XML.GetWhois(username, bot.Dimension); if (whois != null && whois.Success) { window.AppendHighlight(Format.Whois(whois, FormatStyle.Compact)); } else { window.AppendHighlight(username); } window.AppendNormalStart(); if (leader) { window.AppendString(" ("); window.AppendColorString(RichTextWindow.ColorRed, "Leader"); window.AppendString(")"); } foreach (int tm in teams) { if (tm == team) { continue; } window.AppendString(" ["); window.AppendBotCommand(tm.ToString(), "teams set " + username + " " + tm); window.AppendString("]"); } if (!leader) { window.AppendString(" ["); window.AppendBotCommand("Leader", "teams leader " + username + " " + team); window.AppendString("]"); } window.AppendString(" ["); window.AppendBotCommand("Remove", "teams remove " + username); window.AppendString("]"); window.AppendString(" ["); window.AppendBotCommand("New Team", "teams start " + username); window.AppendString("]"); window.AppendColorEnd(); window.AppendLineBreak(); } reader.Close(); } window.AppendLineBreak(); window.AppendHeader("Looking for Team"); int lft = 0; List <string> list = new List <string>(); foreach (Friend user in bot.PrivateChannel.List().Values) { list.Add(user.User); } // If 'Raid :: Core' is loaded, fetch the lft list from there List <string> raiders = new List <string>(); if (bot.Plugins.IsLoaded("raidcore")) { try { ReplyMessage reply = bot.SendPluginMessageAndWait(this.InternalName, "raidcore", "GetActiveRaiders", 100); if (reply != null && reply.Args.Length > 0) { raiders = new List <string>((string[])reply.Args); } } catch { } } // Sort LFT list SortedDictionary <string, SortedDictionary <string, WhoisResult> > sorted = new SortedDictionary <string, SortedDictionary <string, WhoisResult> >(); foreach (string member in list) { WhoisResult whois = XML.GetWhois(member, bot.Dimension); if (whois == null || !whois.Success) { whois = null; } if (!sorted.ContainsKey(whois.Stats.Profession)) { sorted.Add(whois.Stats.Profession, new SortedDictionary <string, WhoisResult>()); } sorted[whois.Stats.Profession].Add(member, whois); } // Display LFT list foreach (KeyValuePair <string, SortedDictionary <string, WhoisResult> > kvp in sorted) { window.AppendHighlight(kvp.Key); window.AppendLineBreak(); foreach (KeyValuePair <string, WhoisResult> member in kvp.Value) { if (seen.Contains(member.Key)) { continue; } window.AppendNormalStart(); window.AppendString("- "); if (member.Value != null && member.Value.Success) { window.AppendString(Format.Whois(member.Value, FormatStyle.Compact)); } else { window.AppendString(member.Key); } if (raiders.Contains(member.Key)) { window.AppendString(" ["); window.AppendColorString(RichTextWindow.ColorGreen, "R"); window.AppendString("]"); } foreach (int tm in teams) { window.AppendString(" ["); window.AppendBotCommand(tm.ToString(), "teams set " + member.Key + " " + tm); window.AppendString("]"); } window.AppendString(" ["); window.AppendBotCommand("New Team", "teams start " + member.Key); window.AppendString("]"); window.AppendColorEnd(); window.AppendLineBreak(); lft++; } window.AppendLineBreak(); } if (lft == 0) { window.AppendHighlight("None"); } bot.SendReply(e, "Teams Manager »» ", window); }
public override void OnCommand(BotShell bot, CommandArgs e) { switch (e.Command) { case "umob": if (e.Args.Length < 1) { bot.SendReply(e, "Correct Usage: umob [search string]"); return; } string search = string.Empty; search = e.Words[0]; search = search.ToLower(); string url = string.Format(this.UrlTemplate, this.Server, HttpUtility.UrlEncode(search)); string xml = HTML.GetHtml(url, 20000); if (xml == null || xml == string.Empty) { bot.SendReply(e, "Unable to query the unique mobs database"); return; } // if (xml.ToLower().StartsWith("<error>")) // { // if (xml.Length > 13) // { // bot.SendReply(e, "Error: " + xml.Substring(7, xml.Length - 13)); // return; // } // else // { // bot.SendReply(e, "An unknown error has occured!"); // return; // } // } string result = string.Empty; MemoryStream stream = null; try { stream = new MemoryStream(Encoding.UTF8.GetBytes(xml)); XmlSerializer serializer = new XmlSerializer(typeof(UniquesResults)); UniquesResults search_results = (UniquesResults)serializer.Deserialize(stream); stream.Close(); if (search_results.Mobs == null || search_results.Mobs.Length == 0) { result = "No mobs were found"; } else { RichTextWindow window = new RichTextWindow(bot); if (search_results.Mobs.Length > this.NonPageSize) { window.AppendTitle("Unique Mobs Database"); window.AppendHighlight("Server: "); window.AppendNormal(this.Server); window.AppendLineBreak(); window.AppendHighlight("Version: "); window.AppendNormal(search_results.Version); window.AppendLineBreak(); window.AppendHighlight("Search String: "); window.AppendNormal(search); window.AppendLineBreak(); window.AppendHighlight("Results: "); window.AppendNormal(search_results.Mobs.Length.ToString() + " / " + search_results.Max); window.AppendLineBreak(2); window.AppendHeader("Search Results"); } else { window.AppendLineBreak(); } foreach (UniqueMob mob in search_results.Mobs) { if (search_results.Mobs.Length <= this.NonPageSize) { window.AppendString(" "); } window.AppendHighlight(mob.name + " "); window.AppendNormalStart(); window.AppendLineBreak(); window.AppendString(" Level: " + mob.level); window.AppendLineBreak(); window.AppendString(" Location: " + mob.location + " (" + mob.coords + ")"); window.AppendLineBreak(); window.AppendString(" Drops: "); window.AppendLineBreak(); foreach (UItemsResults_Item item in mob.Items) { window.AppendHighlight(item.Name + " "); window.AppendNormalStart(); window.AppendString("["); window.AppendItem("QL " + item._ql, item.LowID, item.HighID, item.QL); window.AppendString("] (" + item._droprate + "%)"); window.AppendColorEnd(); window.AppendLineBreak(); } window.AppendLineBreak(2); //window.AppendLineBreak(); } if (search_results.Mobs.Length > this.NonPageSize) { bot.SendReply(e, HTML.CreateColorString(bot.ColorHeaderHex, search_results.Mobs.Length.ToString()) + " Results »» ", window); } else { bot.SendReply(e, HTML.CreateColorString(bot.ColorHeaderHex, search_results.Mobs.Length.ToString()) + " Results »»" + window.Text.TrimEnd('\n')); } return; } } catch { result = "Unable to query the unique mobs database"; } finally { if (stream != null) { stream.Close(); } } bot.SendReply(e, result); break; } }
public override void OnCommand(BotShell bot, CommandArgs e) { switch (e.Command) { case "items": if (e.Args.Length < 1) { bot.SendReply(e, "Correct Usage: items [search string]"); return; } int ql = 0; try { ql = Convert.ToInt32(e.Args[0]); if (ql <= 0 || ql >= 1000) { bot.SendReply(e, "Quality level has to be between 0 and 999"); return; } } catch { } if (ql != 0 && e.Words.Length == 1) { bot.SendReply(e, "Correct Usage: items [quality level] [search string]"); return; } string search = string.Empty; if (ql != 0) { search = e.Words[1]; } else { search = e.Words[0]; } search = search.ToLower(); string url = string.Format(this.UrlTemplate, this.Server, HttpUtility.UrlEncode(search), ql, Max); string xml = HTML.GetHtml(url, 60000); if (xml == null || xml == string.Empty) { bot.SendReply(e, "Unable to query the central items database"); return; } if (xml.ToLower().StartsWith("<error>")) { if (xml.Length > 13) { bot.SendReply(e, "Error: " + xml.Substring(7, xml.Length - 13)); return; } else { bot.SendReply(e, "An unknown error has occured!"); return; } } string result = string.Empty; MemoryStream stream = null; try { stream = new MemoryStream(Encoding.UTF8.GetBytes(xml)); XmlSerializer serializer = new XmlSerializer(typeof(ItemsResults)); ItemsResults items = (ItemsResults)serializer.Deserialize(stream); stream.Close(); if (items.Items == null || items.Items.Length == 0) { result = "No items were found"; } else { RichTextWindow window = new RichTextWindow(bot); if (items.Items.Length > this.NonPageSize) { window.AppendTitle("Central Items Database"); window.AppendHighlight("Server: "); window.AppendNormal(this.Server); window.AppendLineBreak(); window.AppendHighlight("Version: "); window.AppendNormal(items.Version); window.AppendLineBreak(); window.AppendHighlight("Search String: "); window.AppendNormal(search); window.AppendLineBreak(); window.AppendHighlight("Results: "); window.AppendNormal(items.Items.Length.ToString() + " / " + items.Max); window.AppendLineBreak(2); window.AppendHeader("Search Results"); } else { window.AppendLineBreak(); } foreach (ItemsResults_Item item in items.Items) { if (items.Items.Length <= this.NonPageSize) { window.AppendString(" "); } window.AppendHighlight(item.Name + " "); window.AppendNormalStart(); window.AppendString("["); window.AppendItem("QL " + item.LowQL, item.LowID, item.HighID, item.LowQL); window.AppendString("] "); if (ql != 0 && ql > item.LowQL && ql < item.HighQL) { window.AppendString("["); window.AppendItem("QL " + ql, item.LowID, item.HighID, ql); window.AppendString("] "); } if (item.HighQL != item.LowQL) { window.AppendString("["); window.AppendItem("QL " + item.HighQL, item.LowID, item.HighID, item.HighQL); window.AppendString("] "); } window.AppendColorEnd(); window.AppendLineBreak(); if (item.IconID > 0 && items.Items.Length > this.NonPageSize) { window.AppendIcon(item.IconID); window.AppendLineBreak(); } } if (items.Items.Length > this.NonPageSize) { bot.SendReply(e, HTML.CreateColorString(bot.ColorHeaderHex, items.Items.Length.ToString()) + " Results »» ", window); } else { bot.SendReply(e, HTML.CreateColorString(bot.ColorHeaderHex, items.Items.Length.ToString()) + " Results »»" + window.Text.TrimEnd('\n')); } return; } } catch { result = "Unable to query the central items database"; } finally { if (stream != null) { stream.Close(); } } bot.SendReply(e, result); break; } }
private void TrickleAgi(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) * .50)).ToString()); window.AppendLineBreak(); window.AppendString("Martial Arts: "); window.AppendNormal(Math.Floor(((Test / 4) * .50)).ToString()); window.AppendLineBreak(); window.AppendString("Riposte: "); window.AppendNormal(Math.Floor(((Test / 4) * .50)).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) * .10)).ToString()); window.AppendLineBreak(); window.AppendString("1 Handed Edged: "); window.AppendNormal(Math.Floor(((Test / 4) * .40)).ToString()); window.AppendLineBreak(); window.AppendString("Fast Attack: "); window.AppendNormal(Math.Floor(((Test / 4) * .60)).ToString()); window.AppendLineBreak(); window.AppendLineBreak(); window.AppendString("Multiple Melee: "); window.AppendNormal(Math.Floor(((Test / 4) * .60)).ToString()); window.AppendLineBreak(); window.AppendString("Parry: "); window.AppendNormal(Math.Floor(((Test / 4) * .20)).ToString()); window.AppendLineBreak(); window.AppendString("Piercing: "); window.AppendNormal(Math.Floor(((Test / 4) * .50)).ToString()); window.AppendLineBreak(); window.AppendString(" Misc"); window.AppendLineBreak(); window.AppendString("Grenade: "); window.AppendNormal(Math.Floor(((Test / 4) * .40)).ToString()); window.AppendLineBreak(); window.AppendString("Heavy Weapons: "); window.AppendNormal(Math.Floor(((Test / 4) * .60)).ToString()); window.AppendLineBreak(); window.AppendString("Sharp Object: "); window.AppendNormal(Math.Floor(((Test / 4) * .60)).ToString()); window.AppendLineBreak(); window.AppendLineBreak(); window.AppendString(" Ranged"); window.AppendLineBreak(); window.AppendString("Assault Rifle: "); window.AppendNormal(Math.Floor(((Test / 4) * .30)).ToString()); window.AppendLineBreak(); window.AppendString("Bow Special Attack: "); window.AppendNormal(Math.Floor(((Test / 4) * .50)).ToString()); window.AppendLineBreak(); window.AppendString("Bow: "); window.AppendNormal(Math.Floor(((Test / 4) * .40)).ToString()); window.AppendLineBreak(); window.AppendString("Burst: "); window.AppendNormal(Math.Floor(((Test / 4) * .50)).ToString()); window.AppendLineBreak(); window.AppendString("Fling Shot: "); window.AppendNormal(Math.Floor(((Test / 4) * 1)).ToString()); window.AppendLineBreak(); window.AppendString("Multiple Ranged: "); window.AppendNormal(Math.Floor(((Test / 4) * .60)).ToString()); window.AppendLineBreak(); window.AppendString("Pistol: "); window.AppendNormal(Math.Floor(((Test / 4) * .60)).ToString()); window.AppendLineBreak(); window.AppendString("Rifle: "); window.AppendNormal(Math.Floor(((Test / 4) * .60)).ToString()); window.AppendLineBreak(); window.AppendString("Shotgun: "); window.AppendNormal(Math.Floor(((Test / 4) * .60)).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("Dodge Ranged: "); window.AppendNormal(Math.Floor(((Test / 4) * .50)).ToString()); window.AppendLineBreak(); window.AppendString("Duck Explosions: "); window.AppendNormal(Math.Floor(((Test / 4) * .50)).ToString()); window.AppendLineBreak(); window.AppendString("Evade Close: "); window.AppendNormal(Math.Floor(((Test / 4) * .50)).ToString()); window.AppendLineBreak(); window.AppendString("Melee Initiative: "); window.AppendNormal(Math.Floor(((Test / 4) * .10)).ToString()); window.AppendLineBreak(); window.AppendString("Nano Cast Initiative: "); window.AppendNormal(Math.Floor(((Test / 4) * .40)).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.AppendString("Runspeed: "); window.AppendNormal(Math.Floor(((Test / 4) * .40)).ToString()); window.AppendLineBreak(); window.AppendLineBreak(); window.AppendString(" Trade & Repair"); window.AppendLineBreak(); window.AppendString("Electrical Engineering: "); window.AppendNormal(Math.Floor(((Test / 4) * .30)).ToString()); window.AppendLineBreak(); window.AppendString("Mechanical Engineering: "); window.AppendNormal(Math.Floor(((Test / 4) * .50)).ToString()); window.AppendLineBreak(); window.AppendLineBreak(); window.AppendString(" Nano and Aiding"); window.AppendLineBreak(); window.AppendString("First Aid: "); window.AppendNormal(Math.Floor(((Test / 4) * .30)).ToString()); window.AppendLineBreak(); window.AppendString("Time and Space: "); window.AppendNormal(Math.Floor(((Test / 4) * .20)).ToString()); window.AppendLineBreak(); window.AppendString("Treatment: "); window.AppendNormal(Math.Floor(((Test / 4) * .30)).ToString()); window.AppendLineBreak(); window.AppendLineBreak(); window.AppendString(" Spying"); window.AppendLineBreak(); window.AppendString("Breaking and Entering: "); window.AppendNormal(Math.Floor(((Test / 4) * .40)).ToString()); window.AppendLineBreak(); window.AppendString("Concealment: "); window.AppendNormal(Math.Floor(((Test / 4) * .30)).ToString()); window.AppendLineBreak(); window.AppendString("Trap Disarm: "); window.AppendNormal(Math.Floor(((Test / 4) * .30)).ToString()); window.AppendLineBreak(); window.AppendLineBreak(); window.AppendString(" Navigation"); 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 Agility " + 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 OnConfigurationDisplayCommand(BotShell bot, CommandArgs e) { string internalName = e.Args[0].ToLower(); if (!bot.Plugins.Exists(internalName)) { bot.SendReply(e, "No such plugin!"); return; } ConfigurationEntry[] entires = bot.Configuration.List(internalName); if (entires.Length < 1) { bot.SendReply(e, "This plugin has no settings to configure"); return; } RichTextWindow window = new RichTextWindow(bot); PluginLoader loader = bot.Plugins.GetLoader(internalName); window.AppendTitle("Configuration"); foreach (ConfigurationEntry entry in entires) { window.AppendHighlight(entry.Name + ": "); window.AppendNormalStart(); string command = "configuration set " + internalName + " " + entry.Key.ToLower(); switch (entry.Type) { case ConfigType.String: string value1 = bot.Configuration.GetString(entry.Section, entry.Key, (string)entry.DefaultValue); if (entry.Values != null && entry.Values.Length > 0) { window.AppendMultiBox(command, value1, entry.StringValues); } else { window.AppendString(value1 + " ["); window.AppendCommand("Edit", "/text /tell " + bot.Character + " " + command + " [text]"); window.AppendString("]"); } break; case ConfigType.Integer: string value2 = bot.Configuration.GetInteger(entry.Section, entry.Key, (int)entry.DefaultValue).ToString(); if (entry.Values != null && entry.Values.Length > 0) { window.AppendMultiBox(command, value2, entry.StringValues); } else { window.AppendString(value2 + " ["); window.AppendCommand("Edit", "/text /tell " + bot.Character + " " + command + " [number]"); window.AppendString("]"); } break; case ConfigType.Boolean: string value3 = "Off"; if (bot.Configuration.GetBoolean(entry.Section, entry.Key, (bool)entry.DefaultValue)) { value3 = "On"; } window.AppendMultiBox(command, value3, "On", "Off"); break; case ConfigType.Username: string value4 = bot.Configuration.GetUsername(entry.Section, entry.Key, (string)entry.DefaultValue); window.AppendString(value4 + " ["); window.AppendCommand("Edit", "/text /tell " + bot.Character + " " + command + " [username]"); window.AppendString("]"); break; case ConfigType.Date: DateTime value5 = bot.Configuration.GetDate(entry.Section, entry.Key, (DateTime)entry.DefaultValue); window.AppendString(value5.ToString("dd/MM/yyyy") + " ["); window.AppendCommand("Edit", "/text /tell " + bot.Character + " " + command + " [dd]/[mm]/[yyyy]"); window.AppendString("]"); break; case ConfigType.Time: TimeSpan value6 = bot.Configuration.GetTime(entry.Section, entry.Key, (TimeSpan)entry.DefaultValue); window.AppendString(string.Format("{0:00}:{1:00}:{2:00}", Math.Floor(value6.TotalHours), value6.Minutes, value6.Seconds) + " ["); window.AppendCommand("Edit", "/text /tell " + bot.Character + " " + command + " [hh]:[mm]:[ss]"); window.AppendString("]"); break; case ConfigType.Dimension: string value7 = bot.Configuration.GetDimension(entry.Section, entry.Key, (Server)entry.DefaultValue).ToString(); window.AppendMultiBox(command, value7, Server.RubiKa.ToString(), Server.Test.ToString()); break; case ConfigType.Color: string value8 = bot.Configuration.GetColor(entry.Section, entry.Key, (string)entry.DefaultValue); window.AppendColorString(value8, value8); window.AppendString(" ["); window.AppendBotCommand("Edit", "configuration color " + internalName + " " + entry.Key.ToLower()); window.AppendString("]"); break; case ConfigType.Password: string value9 = bot.Configuration.GetPassword(entry.Section, entry.Key, (string)entry.DefaultValue); for (int i = 0; i < value9.Length; i++) { window.AppendString("*"); } window.AppendString(" ["); window.AppendCommand("Edit", "/text /tell " + bot.Character + " " + command + " [password]"); window.AppendString("]"); break; case ConfigType.Custom: string value10 = bot.Configuration.GetCustom(entry.Section, entry.Key); if (value10 != null) { window.AppendRawString(value10); } break; } window.AppendString(" ["); window.AppendBotCommand("Default", "configuration reset " + internalName + " " + entry.Key.ToLower()); window.AppendString("]"); window.AppendColorEnd(); window.AppendLineBreak(); } bot.SendReply(e, "Configuration »» " + loader.Name + " »» ", window); }
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); } }
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 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); }
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) { if (e.Args.Length < 1) { bot.SendReply(e, "Correct Usage: aigen [ankari/ilari/rimah/jaax/xoch/cha]"); return; } string msg = String.Empty; string botName = String.Empty; string bioName1 = String.Empty; string bioName2 = String.Empty; string genName = String.Empty; string botInfo = String.Empty; int bioId1 = 0; int bioId2 = 0; int botImageId = 100337; int bioImageId = 255705; int botId = 0; switch (e.Args[0]) { case "ankari": genName = "General - Ankari'Khaz"; botId = 247145; botName = "Arithmetic Lead Viralbots"; bioId1 = 247684; bioName1 = "Kyr'Ozch Bio-Material - Type 1"; bioId2 = 247685; bioName2 = "Kyr'Ozch Bio-Material - Type 2"; msg = "Low Evade/Dodge,low AR, casting Viral/Virral nukes."; botInfo = "(Nanoskill / Tradeskill)"; break; case "ilari": genName = "General - Ilari'Khaz"; botId = 247146; botName = "Spiritual Lead Viralbots"; bioId1 = 247681; bioName1 = "Kyr'Ozch Bio-Material - Type 992"; bioId2 = 247679; bioName2 = "Kyr'Ozch Bio-Material - Type 880"; msg = "Low Evade/Dodge."; botInfo = "(Nanocost / Nanopool / Max Nano)"; break; case "rimah": genName = "General - Rimah'Khaz"; botId = 247143; botName = "Observant Lead Viralbots"; bioId1 = 247675; bioName1 = "Kyr'Ozch Bio-Material - Type 112"; bioId2 = 247678; bioName2 = "Kyr'Ozch Bio-Material - Type 240"; msg = "Low Evade/Dodge."; botInfo = "(Init / Evades)"; break; case "jaax": genName = "General - Jaax'Khaz"; botId = 247139; botName = "Strong Lead Viralbots"; bioId1 = 247694; bioName1 = "Kyr'Ozch Bio-Material - Type 3"; bioId2 = 247688; bioName2 = "Kyr'Ozch Bio-Material - Type 4"; msg = "High Evade, Low Dodge."; botInfo = "(Melee / Spec Melee / Add All Def / Add Damage)"; break; case "xoch": genName = "General - Xoch'Khaz"; botId = 247137; botName = "Enduring Lead Viralbots"; bioId1 = 247690; bioName1 = "Kyr'Ozch Bio-Material - Type 5"; bioId2 = 247692; bioName2 = "Kyr'Ozch Bio-Material - Type 12"; msg = "High Evade/Dodge, casting Ilari Biorejuvenation heals."; botInfo = "(Max Health / Body Dev)"; break; case "cha": genName = "General - Cha'Khaz"; botId = 247141; botName = "Supple Lead Viralbots"; bioId1 = 247696; bioName1 = "Kyr'Ozch Bio-Material - Type 13"; bioId2 = 247674; bioName2 = "Kyr'Ozch Bio-Material - Type 76"; msg = "High Evade/NR, Low Dodge."; botInfo = "(Ranged / Spec Ranged / Add All Off)"; break; default: bot.SendReply(e, "Unknown Alien General. Available options are: " + HTML.CreateColorString(bot.ColorHeaderHex, "ankari, ilari, rimah, jaax, xoch, cha")); return; } RichTextWindow window = new RichTextWindow(bot); window.AppendTitle(genName); window.AppendHighlight("Type: "); window.AppendNormal(msg); window.AppendLineBreak(2); window.AppendHeader("Drops"); window.AppendHighlight(botName + " "); window.AppendNormalStart(); window.AppendString(botInfo + " ["); window.AppendItem("QL " + 300, botId, botId, 300); window.AppendString("] "); window.AppendColorEnd(); window.AppendLineBreak(); window.AppendIcon(botImageId); window.AppendLineBreak(2); window.AppendHighlight(bioName1 + " "); window.AppendNormalStart(); window.AppendString("["); window.AppendItem("QL " + 300, bioId1, bioId1, 300); window.AppendString("] "); window.AppendColorEnd(); window.AppendLineBreak(); window.AppendIcon(bioImageId); window.AppendLineBreak(); window.AppendLineBreak(); window.AppendHighlight(bioName2 + " "); window.AppendNormalStart(); window.AppendString("["); window.AppendItem("QL " + 300, bioId2, bioId2, 300); window.AppendString("] "); window.AppendColorEnd(); window.AppendLineBreak(); window.AppendIcon(bioImageId); window.AppendLineBreak(); bot.SendReply(e, genName + " »» ", window); }
private void OnAdminsCommand(BotShell bot, CommandArgs e) { SortedDictionary <string, UserLevel> members = bot.Users.GetUsers(); List <string> chars = new List <string>(); RichTextWindow window = new RichTextWindow(bot); RichTextWindow superadmins = new RichTextWindow(bot); RichTextWindow admins = new RichTextWindow(bot); RichTextWindow leaders = new RichTextWindow(bot); int adminCount = 0; foreach (KeyValuePair <string, UserLevel> member in members) { RichTextWindow tmp = null; switch (member.Value) { case UserLevel.SuperAdmin: tmp = superadmins; break; case UserLevel.Admin: tmp = admins; break; case UserLevel.Leader: tmp = leaders; break; default: continue; } chars.Add(member.Key.ToLower()); tmp.AppendHighlightStart(); tmp.AppendString(member.Key); tmp.AppendString(" is "); if (bot.FriendList.IsOnline(member.Key) == OnlineState.Online) { tmp.AppendColorString(RichTextWindow.ColorGreen, "Online"); } else { tmp.AppendColorString(RichTextWindow.ColorRed, "Offline"); } tmp.AppendColorEnd(); tmp.AppendLineBreak(); if (!bot.FriendList.IsFriend(member.Key)) { bot.FriendList.Add(this.InternalName, member.Key); } foreach (string alt in bot.Users.GetAlts(member.Key)) { chars.Add(alt.ToLower()); tmp.AppendNormalStart(); tmp.AppendString("- " + Format.UppercaseFirst(alt)); tmp.AppendString(" is "); if (bot.FriendList.IsOnline(alt) == OnlineState.Online) { tmp.AppendColorString(RichTextWindow.ColorGreen, "Online"); } else { tmp.AppendColorString(RichTextWindow.ColorRed, "Offline"); } tmp.AppendColorEnd(); tmp.AppendLineBreak(); if (!bot.FriendList.IsFriend(alt)) { bot.FriendList.Add(this.InternalName, alt); } } adminCount++; } foreach (string friend in bot.FriendList.List(this.InternalName)) { if (!chars.Contains(friend.ToLower())) { bot.FriendList.Remove(this.InternalName, friend); } } window.AppendTitle("Super Admins"); window.AppendRawString(superadmins.Text); window.AppendLineBreak(); window.AppendHeader("Admins"); window.AppendRawString(admins.Text); window.AppendLineBreak(); window.AppendHeader("Leaders"); window.AppendRawString(leaders.Text); window.AppendLineBreak(); bot.SendReply(e, HTML.CreateColorString(bot.ColorHeaderHex, adminCount.ToString()) + " Admins »» ", window); }
private void OnHelpDisplayCommand(BotShell bot, CommandArgs e) { string command = e.Words[0]; command = bot.Commands.GetMainCommand(command); if (!bot.Commands.Exists(command) || !bot.Commands.GetRights(command).Help) { bot.SendReply(e, "No such help topic"); return; } PluginLoader loader = bot.Plugins.GetLoader(bot.Commands.GetInternalName(command)); CommandRights rights = bot.Commands.GetRights(command); UserLevel level = bot.Users.GetUser(e.Sender); RichTextWindow window = new RichTextWindow(bot); window.AppendTitle("Information"); window.AppendHighlight("Command: "); window.AppendNormal(Format.UppercaseFirst(command)); window.AppendLineBreak(); window.AppendHighlight("Plugin: "); window.AppendNormal(loader.ToString()); window.AppendLineBreak(); window.AppendHighlight("Private Message Access: "); if (level >= rights.PrivateMessage) { window.AppendColorString(RichTextWindow.ColorGreen, rights.PrivateMessage.ToString()); } else { window.AppendColorString(RichTextWindow.ColorRed, rights.PrivateMessage.ToString()); } window.AppendLineBreak(); window.AppendHighlight("Private Channel Access: "); if (level >= rights.PrivateChannel) { window.AppendColorString(RichTextWindow.ColorGreen, rights.PrivateChannel.ToString()); } else { window.AppendColorString(RichTextWindow.ColorRed, rights.PrivateChannel.ToString()); } window.AppendLineBreak(); window.AppendHighlight("Organization Access: "); if (level >= rights.Organization) { window.AppendColorString(RichTextWindow.ColorGreen, rights.Organization.ToString()); } else { window.AppendColorString(RichTextWindow.ColorRed, rights.Organization.ToString()); } window.AppendLineBreak(2); window.AppendHeader("Help"); window.AppendHighlightStart(); string help = bot.Commands.GetHelp(command); if (help == null || help.Trim() == string.Empty) { window.AppendString("No additional help available for this command"); } else { window.AppendRawString(help); } window.AppendColorEnd(); bot.SendReply(e, "VhaBot Help »» " + Format.UppercaseFirst(command) + " »» ", window); }
private void TrickleSta(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) * .30)).ToString()); window.AppendLineBreak(); window.AppendString("Body Dev: "); window.AppendNormal(Math.Floor(((Test / 4) * 1)).ToString()); window.AppendLineBreak(); window.AppendString("Brawling: "); window.AppendNormal(Math.Floor(((Test / 4) * .40)).ToString()); window.AppendLineBreak(); window.AppendString("Nano Pool: "); window.AppendNormal(Math.Floor(((Test / 4) * .10)).ToString()); window.AppendLineBreak(); window.AppendString("Swimming: "); window.AppendNormal(Math.Floor(((Test / 4) * .60)).ToString()); window.AppendLineBreak(); window.AppendLineBreak(); window.AppendString(" Melee"); window.AppendLineBreak(); window.AppendString("1 Handed Blunt: "); window.AppendNormal(Math.Floor(((Test / 4) * .50)).ToString()); window.AppendLineBreak(); window.AppendString("1 Handed Edged: "); window.AppendNormal(Math.Floor(((Test / 4) * .30)).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) * .40)).ToString()); window.AppendLineBreak(); window.AppendString("Melee Energy: "); window.AppendNormal(Math.Floor(((Test / 4) * .50)).ToString()); window.AppendLineBreak(); window.AppendString("Multiple Melee: "); window.AppendNormal(Math.Floor(((Test / 4) * .10)).ToString()); window.AppendLineBreak(); window.AppendString("Piercing: "); window.AppendNormal(Math.Floor(((Test / 4) * .30)).ToString()); window.AppendLineBreak(); window.AppendLineBreak(); window.AppendString(" Ranged"); window.AppendLineBreak(); window.AppendString("Assault Rifle: "); window.AppendNormal(Math.Floor(((Test / 4) * .40)).ToString()); window.AppendLineBreak(); window.AppendString("Burst: "); window.AppendNormal(Math.Floor(((Test / 4) * .20)).ToString()); window.AppendLineBreak(); window.AppendString("Full Auto: "); 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) * .40)).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("Electrical Engineering: "); window.AppendNormal(Math.Floor(((Test / 4) * .20)).ToString()); window.AppendLineBreak(); window.AppendLineBreak(); window.AppendString(" Nano and Aiding"); window.AppendLineBreak(); window.AppendString("Matter Creations: "); window.AppendNormal(Math.Floor(((Test / 4) * .20)).ToString()); window.AppendLineBreak(); bot.SendReply(e, bot.ColorHeader + "Trickling " + bot.ColorHighlight + e.Args[0] + bot.ColorHeader + " To Stamina " + bot.ColorHighlight + " »» ", window); }