Ejemplo n.º 1
0
        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());
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        private void OnAltsCommand(BotShell bot, CommandArgs e)
        {
            string username = "";

            if (e.Args.Length < 1)
            {
                //{
                //     bot.SendReply(e, "Correct Usage: " + e.Command + " [username]");
                //     return;
                //}
                username = e.Sender;
            }
            else
            {
                username = e.Args[0];
            }
            if (bot.GetUserID(username) < 1)
            {
                bot.SendReply(e, "No such user: "******" doesn't have any alts");
                return;
            }
            bot.SendReply(e, main + "'s characters »» ", window);
        }
Ejemplo n.º 4
0
        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);
        }
Ejemplo n.º 5
0
 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);
     }
 }
Ejemplo n.º 6
0
        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);
        }
Ejemplo n.º 7
0
        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);
        }
Ejemplo n.º 8
0
        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);
        }
Ejemplo n.º 9
0
        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);
        }
Ejemplo n.º 10
0
        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);
        }
Ejemplo n.º 11
0
        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);
        }
Ejemplo n.º 12
0
        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);
        }
Ejemplo n.º 13
0
 public void OnRaffleTimer(object sender, ElapsedEventArgs e)
 {
     if (!this._raffleActive)
     {
         this._raffleTimer.Stop();
         return;
     }
     this._raffleTime--;
     if (this._raffleTime == 30 || this._raffleTime == 15)
     {
         this._bot.SendPrivateChannelMessage(this._bot.ColorHighlight + "The glyph raffle is closing in " + HTML.CreateColorString(this._bot.ColorHeaderHex, this._raffleTime.ToString()) + " seconds »» " + this._raffleWindow.ToString());
         return;
     }
     if (this._raffleTime <= 0)
     {
         try
         {
             lock (this._raffleItems)
             {
                 Random random  = new Random();
                 string winners = this._bot.ColorHighlight + "\n¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯";
                 foreach (KeyValuePair <int, int> kvp in this._raffleItems)
                 {
                     lock (this._raffleJoined)
                     {
                         lock (this._items)
                             winners += "\n    " + this._bot.ColorHeader + this._items[kvp.Key] + ": " + this._bot.ColorHighlight;
                         for (int i = 0; i < kvp.Value; i++)
                         {
                             if (this._raffleJoined[kvp.Key].Count > 0)
                             {
                                 this._raffleJoined[kvp.Key].Sort();
                                 int winner = random.Next(0, this._raffleJoined[kvp.Key].Count);
                                 winners += this._raffleJoined[kvp.Key][winner] + " ";
                                 this._raffleJoined[kvp.Key].RemoveAt(winner);
                             }
                         }
                     }
                 }
                 winners += "\n______________________________________________";
                 this._bot.SendPrivateChannelMessage(winners);
                 this._raffleTimer.Stop();
                 this._raffleActive = false;
                 this._raffleTime   = 0;
                 this._raffleItems  = null;
                 lock (this._raffleJoined)
                     this._raffleJoined.Clear();
                 lock (this._raffleMains)
                     this._raffleMains.Clear();
                 this._raffleWindow = null;
             }
         }
         catch (Exception ex) { Console.WriteLine(ex.ToString()); }
     }
 }
Ejemplo n.º 14
0
        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");
            }
        }
Ejemplo n.º 15
0
        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);
            }
        }
Ejemplo n.º 16
0
        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;
            }
        }
Ejemplo n.º 17
0
        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");
            }
        }
Ejemplo n.º 18
0
        private void UserLogonEvent(BotShell bot, UserLogonArgs e)
        {
            if (e.First)
            {
                return;
            }
            if (!e.Sections.Contains("notify"))
            {
                return;
            }
            string logon  = "";
            string sender = HTML.CreateColorString(bot.ColorHeaderHex, e.Sender);

            if (e.SenderWhois != null)
            {
                switch (this._displayMode)
                {
                case "compact":
                    sender = HTML.CreateColorString(bot.ColorHeaderHex, Format.Whois(e.SenderWhois, FormatStyle.Compact));
                    break;

                case "large":
                    sender = HTML.CreateColorString(bot.ColorHeaderHex, Format.Whois(e.SenderWhois, FormatStyle.Large));
                    break;

                default:
                    sender = HTML.CreateColorString(bot.ColorHeaderHex, Format.Whois(e.SenderWhois, FormatStyle.Medium));
                    break;
                }
            }
            using (IDbCommand command = this._database.Connection.CreateCommand())
            {
                command.CommandText = "SELECT Message FROM logon WHERE Username = '******'";
                IDataReader reader = command.ExecuteReader();
                if (reader.Read())
                {
                    logon = " - " + reader.GetString(0);
                }
                reader.Close();
            }
            string alts = "";

            if (bot.Plugins.IsLoaded("vhMembersViewer"))
            {
                RichTextWindow window = ((MembersViewer)bot.Plugins.GetPlugin("vhMembersViewer")).GetAltsWindow(bot, e.Sender);
                if (window != null)
                {
                    alts = " - " + window.ToString(bot.Users.GetMain(e.Sender) + "'s Alts");
                }
            }
            this.SendNotify(bot, sender + " has logged on" + alts + logon);
        }
Ejemplo n.º 19
0
        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);
        }
Ejemplo n.º 20
0
        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");
        }
Ejemplo n.º 21
0
        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;
            }
        }
Ejemplo n.º 22
0
        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);
        }
Ejemplo n.º 23
0
        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);
        }
Ejemplo n.º 24
0
        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);
        }
Ejemplo n.º 25
0
 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"));
         }
     }
 }
Ejemplo n.º 26
0
 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!");
     }
 }
Ejemplo n.º 27
0
        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");
            }
        }
Ejemplo n.º 28
0
        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());
        }
Ejemplo n.º 29
0
        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);
        }
Ejemplo n.º 30
0
 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());
     }
 }