Esempio n. 1
0
 private void SlaveEvents_PrivateChannelMessageEvent(BotShell bot, SlaveArgs slave, PrivateChannelMessageArgs e)
 {
     this.Output(e.Channel, String.Format("[{0}] {1}: {2}", slave.Slave, e.Sender, HTML.UnescapeString(HTML.StripTags(e.Message))));
 }
Esempio n. 2
0
 public override void OnUnload(BotShell bot)
 {
     bot.Events.PrivateChannelMessageEvent -= new PrivateChannelMessageHandler(OnPrivateChannelMessageEvent);
 }
Esempio n. 3
0
 public override void OnLoad(BotShell bot)
 {
 }
Esempio n. 4
0
 public override void OnLoad(BotShell bot)
 {
     this._bot = bot;
 }
Esempio n. 5
0
        private void OnGlyphsRaffleCommand(BotShell bot, CommandArgs e)
        {
            if (this._raffleActive)
            {
                bot.SendReply(e, "There's currently already a glyph raffle active");
                return;
            }
            Dictionary <int, int> items  = new Dictionary <int, int>();
            RichTextWindow        window = new RichTextWindow(bot);

            window.AppendTitle("Glyph Raffle");
            lock (this._items)
            {
                if (e.Args.Length != this._items.Count)
                {
                    bot.SendReply(e, "You need to specify " + this._items.Count + " numbers");
                    return;
                }
                if (this._items.Count == 0)
                {
                    bot.SendReply(e, "This plugin hasn't been properly configured for raffling");
                    return;
                }

                int i = 0;
                this._raffleJoined.Clear();
                foreach (KeyValuePair <int, string> kvp in this._items)
                {
                    try
                    {
                        items.Add(kvp.Key, Convert.ToInt32(e.Args[i]));
                        if (items[kvp.Key] > 0)
                        {
                            window.AppendHighlight(kvp.Value + " ");
                            window.AppendNormal("(" + items[kvp.Key].ToString() + " total) [");
                            window.AppendBotCommand("Join", "glyphs join " + kvp.Key);
                            window.AppendNormal("]");
                            window.AppendLineBreak();
                            this._raffleJoined.Add(kvp.Key, new List <string>());
                        }
                    }
                    catch
                    {
                        this._raffleJoined.Clear();
                        bot.SendReply(e, "Invalid value specified: " + e.Args[i]);
                        return;
                    }
                    i++;
                }
            }
            this._raffleTime   = 60;
            this._raffleItems  = items;
            this._raffleJoined = new Dictionary <int, List <string> >();
            this._raffleActive = true;
            this._raffleTimer.Start();
            this._raffleWindow = window;
            string output = bot.ColorHighlight + "\n¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\n    " + HTML.CreateColorString(bot.ColorHeaderHex, e.Sender) + " has started a glyph raffle »» " + window.ToString();

            lock (this._items)
            {
                foreach (KeyValuePair <int, string> kvp in this._items)
                {
                    if (items[kvp.Key] > 0)
                    {
                        lock (this._raffleJoined)
                            this._raffleJoined.Add(kvp.Key, new List <string>());
                        output += "\n    " + HTML.CreateColorString(bot.ColorHeaderHex, items[kvp.Key].ToString()) + " " + kvp.Value;
                    }
                }
            }
            output += "\n______________________________________________";
            bot.SendPrivateChannelMessage(output);
            bot.SendReply(e, "You have started the glyph raffle");
        }
Esempio n. 6
0
 private void LoadConfiguration(BotShell bot)
 {
     this._sendgc   = bot.Configuration.GetBoolean(this.InternalName, "sendgc", this._sendgc);
     this._sendpg   = bot.Configuration.GetBoolean(this.InternalName, "sendpg", this._sendpg);
     this._announce = bot.Configuration.GetBoolean(this.InternalName, "announce", this._announce);
 }
Esempio n. 7
0
 public override void OnUnload(BotShell bot)
 {
     bot.Events.ConfigurationChangedEvent -= new ConfigurationChangedHandler(OnConfigurationChangedEvent);
     bot.Events.PrivateMessageEvent       -= new PrivateMessageHandler(OnPrivateMessageEvent);
 }
Esempio n. 8
0
        private void OnRaffleStartCommand(BotShell bot, CommandArgs e)
        {
            if (this._running)
            {
                bot.SendReply(e, "A raffle has already been started");
                return;
            }
            if (e.Words.Length < 1)
            {
                bot.SendReply(e, "Correct Usage: raffle start [item]");
                return;
            }
            this._item     = e.Words[0];
            this._realItem = null;
            this._admin    = e.Sender;
            if (e.Items.Length > 0)
            {
                this._item     = e.Items[0].ToLink();
                this._realItem = e.Items[0];
            }
            else if (e.Args[0].StartsWith("item:") && e.Args.Length > 1)
            {
                string[] tmp = e.Args[0].Substring(5).Split(':');
                if (tmp.Length == 3)
                {
                    try
                    {
                        int    lowID  = Convert.ToInt32(tmp[0]);
                        int    highID = Convert.ToInt32(tmp[0]);
                        int    ql     = Convert.ToInt32(tmp[0]);
                        string name   = HTML.UnescapeString(e.Words[1]);
                        this._realItem = new AoItem(name, lowID, highID, ql, null);
                        this._item     = this._realItem.ToLink();
                    }
                    catch { }
                }
            }
            this._running = true;

            RichTextWindow window = new RichTextWindow(bot);

            window.AppendTitle("Raffle");
            window.AppendLineBreak();
            window.AppendNormalStart();
            window.AppendString("[");
            window.AppendBotCommand("Join", "raffle join");
            window.AppendString("] [");
            window.AppendBotCommand("Leave", "raffle leave");
            window.AppendString("]");

            string output = string.Format("{1}{2}{0} has started a raffle for {1}{3}{0} »» ", bot.ColorHighlight, bot.ColorHeader, e.Sender, this._item) + window.ToString();

            bot.SendPrivateChannelMessage(output);

            window = new RichTextWindow(bot);
            window.AppendTitle("Raffle");
            window.AppendLineBreak();
            window.AppendNormalStart();
            window.AppendString("[");
            window.AppendBotCommand("Abort", "raffle abort");
            window.AppendString("] [");
            window.AppendBotCommand("Finish & Announce Winner", "raffle stop");
            window.AppendString("]");

            bot.SendReply(e, "You started a raffle for " + bot.ColorHeader + this._item + bot.ColorHighlight + " »» ", window);
        }
Esempio n. 9
0
 public PrivateChannel(BotShell parent)
 {
     this.Parent = parent;
 }
Esempio n. 10
0
        public void OnTimersAddCommand(BotShell bot, CommandArgs e)
        {
            // Check arguments
            if (e.Args.Length < 2)
            {
                bot.SendReply(e, "Correct Usage: timers add [duration] [description]");
                return;
            }

            // Parse duration
            DateTime end   = DateTime.UtcNow;
            DateTime start = DateTime.UtcNow;

            string[] parts = e.Args[0].Split(':');
            int      depth = 0;

            for (int i = parts.Length - 1; i >= 0; i--)
            {
                uint part;
                if (!uint.TryParse(parts[i], out part))
                {
                    bot.SendReply(e, "Invalid duration syntax given. The correct syntax is [[[[days:]hours:]minutes:]seconds]");
                    return;
                }
                depth++;
                switch (depth)
                {
                case 1:
                    end = end.AddSeconds(part);
                    break;

                case 2:
                    end = end.AddMinutes(part);
                    break;

                case 3:
                    end = end.AddHours(part);
                    break;

                case 4:
                    end = end.AddDays(part);
                    break;
                }
            }
            TimeSpan duration = end - start;

            // Save timer
            long   endStamp      = TimeStamp.FromDateTime(end);
            long   startStamp    = TimeStamp.FromDateTime(start);
            long   durationStamp = (long)Math.Ceiling(duration.TotalSeconds);
            string description   = e.Words[1];
            string source        = e.Sender;

            if (e.Type == CommandType.Organization)
            {
                source = "gc";
            }
            if (e.Type == CommandType.PrivateChannel)
            {
                source = "pg";
            }
            int id = -1;

            lock (this._database)
            {
                using (IDbCommand command = this._database.Connection.CreateCommand())
                {
                    command.CommandText = string.Format("INSERT INTO timers (owner, source, start, end, duration, description) VALUES ('{0}', '{1}', {2}, {3}, {4}, '{5}')", e.Sender, source, startStamp, endStamp, durationStamp, Config.EscapeString(description));
                    if (command.ExecuteNonQuery() < 1)
                    {
                        bot.SendReply(e, "An error has occurred while adding the timer to the database");
                        return;
                    }
                    command.CommandText = "SELECT LAST_INSERT_ROWID()";
                    id = (int)(Int64)command.ExecuteScalar();
                }
            }

            // Save cache
            CachedTimer timer = new CachedTimer(id, source, e.Sender, start, end, duration, description);

            lock (this._timers) this._timers.Add(id, timer);
            bot.SendReply(e, "Timer " + HTML.CreateColorString(bot.ColorHeaderHex, "#" + id) + " with a duration of " + HTML.CreateColorString(bot.ColorHeaderHex, Format.Time(duration, FormatStyle.Large)) + " has been added");
        }
Esempio n. 11
0
 public override void OnUnload(BotShell bot)
 {
     this._timer.Stop();
     this._timer.Dispose();
     this._database.Close();
 }
Esempio n. 12
0
        public override void OnCommand(BotShell bot, CommandArgs e)
        {
            string raider;
            bool   other = false;

            if (e.Args.Length > 0 && (bot.Users.GetUser(e.Sender) > bot.Commands.GetRight(e.Command, e.Type) || bot.Users.GetUser(e.Sender) == UserLevel.SuperAdmin))
            {
                other = true;
            }
            if (other)
            {
                raider = bot.Users.GetMain(e.Args[0]);
            }
            else
            {
                raider = bot.Users.GetMain(e.Sender);
            }

            double points   = this._core.GetPoints(raider);
            int    activity = (int)((float)this._core.GetActivity(raider) / 60);

            string[] alts = bot.Users.GetAlts(raider);

            if (points < this._core.MinimumPoints)
            {
                bot.SendReply(e, "There is no information available for " + HTML.CreateColorString(bot.ColorHeaderHex, raider));
                return;
            }

            RichTextWindow window = new RichTextWindow(bot);

            window.AppendTitle(raider + "'s Information");
            User user = bot.Users.GetUserInformation(raider);

            if (user != null)
            {
                window.AppendHighlight("Added By: ");
                window.AppendNormal(user.AddedBy);
                window.AppendLineBreak();
                window.AppendHighlight("Added On: ");
                if (user.AddedOn > 0)
                {
                    window.AppendNormal(Format.DateTime(user.AddedOn, FormatStyle.Medium));
                }
                else
                {
                    window.AppendNormal("N/A");
                }
                window.AppendLineBreak();
                window.AppendHighlight("User Level: ");
                window.AppendNormal(user.UserLevel.ToString());
                window.AppendLineBreak();
            }
            if (alts.Length > 0)
            {
                window.AppendHighlight("Alts: ");
                window.AppendNormal(string.Join(", ", alts));
                window.AppendLineBreak();
            }
            window.AppendHighlight("Points: ");
            window.AppendNormal(points.ToString() + " points");
            window.AppendLineBreak();
            window.AppendHighlight("Activity: ");
            window.AppendNormal(activity.ToString() + " minutes");
            window.AppendLineBreak();
            if (this._core.Running)
            {
                window.AppendLineBreak();
                window.AppendHeader("Raid Information");
                RaidCore.Raider account = this._core.GetRaiderByMain(raider);
                window.AppendHighlight("Status: ");
                if (account == null || !account.OnRaid)
                {
                    window.AppendNormal("Not on the current raid");
                    window.AppendLineBreak();
                }
                else
                {
                    window.AppendNormal("Currently on this raid");
                    window.AppendLineBreak();
                    window.AppendHighlight("Character: ");
                    window.AppendNormal(account.Character);
                    window.AppendLineBreak();
                    window.AppendHighlight("Joined on: ");
                    window.AppendNormal(Format.DateTime(account.JoinTime, FormatStyle.Compact));
                    window.AppendLineBreak();
                    window.AppendHighlight("Contribution: ");
                    window.AppendNormal(Math.Floor((float)account.Activity / 60) + " minutes (" + ((float)((float)account.Activity / ((float)this._core.TimeRunning.TotalSeconds - (float)this._core.TimePaused.TotalSeconds) * 100)).ToString("##0.0") + "%)");
                    window.AppendLineBreak();
                }
            }

            bot.SendReply(e, raider + "'s Information »» ", window);
        }
Esempio n. 13
0
        public override void OnCommand(BotShell bot, CommandArgs e)
        {
            if (e.Items.Length < 1)
            {
                bot.SendReply(e, "Correct Usage: inspect [item]");
                return;
            }
            foreach (AoItem item in e.Items)
            {
                string result = string.Empty;
                switch (item.HighID)
                {
                case 205842:
                    result = "Funny Arrow";
                    break;

                case 205843:
                    result = "Monster Sunglasses";
                    break;

                case 205844:
                    result = "Karlsson Propellor Cap";
                    break;

                case 216286:
                    result = "Funk Flamingo Sunglasses or Disco Duck Sunglasses or Electric Boogie Sunglasses or Gurgling River Sprite";
                    break;

                case 245658:
                    result = "Blackpack";
                    break;

                case 245596:
                    result = "Doctor's Pill Pack";
                    break;

                case 245594:
                    result = "Syndicate Shades";
                    break;

                case 269800:
                    result = "Galactic Jewel of the Infinite Moebius (HP/Nano Resist/Max Nano) ";
                    break;

                case 269811:
                    result = "Galactic Jewel of the Bruised Brawler (HP/+add Melee dam)";
                    break;

                case 269812:
                    result = "Galactic Jewel of the Searing Desert (HP/+add Fire dam)";
                    break;

                case 269813:
                    result = "Galactic Jewel of the Frozen Tundra (HP/+add Cold dam)";
                    break;

                case 269814:
                    result = "Galactic Jewel of the Jagged Landscape (HP/+add Projectile dam)";
                    break;

                case 269815:
                    result = "Galactic Jewel of the Silent Killer (HP/+add Poison dam)";
                    break;

                case 269816:
                    result = "Galactic Jewel of the Frail Juggernaut (HP low jewel)";
                    break;

                case 269817:
                    result = "Galactic Jewel of the Icy Tundra (HP/+add Cold dam, low jewel)";
                    break;

                case 269818:
                    result = "Galactic Jewel of the Craggy Landscape (HP/+add Projectile dam, low jewel)";
                    break;

                case 269819:
                    result = "Galactic Jewel of the Scarlet Sky (HP/+add Radiation dam, low jewel)";
                    break;

                case 270000:
                    result = "Robe of City Lights";
                    break;
                }
                if (result != string.Empty)
                {
                    bot.SendReply(e, HTML.CreateColorString(bot.ColorHeaderHex, item.Name) + " contains " + HTML.CreateColorString(bot.ColorHeaderHex, result));
                }
                else
                {
                    bot.SendReply(e, "Unable to identify " + HTML.CreateColorString(bot.ColorHeaderHex, item.Name));
                }
            }
        }
Esempio n. 14
0
 private void Events_UserLeaveChannelEvent(BotShell bot, UserLeaveChannelArgs e)
 {
     this.Output(e.Channel, String.Format("[{0}] {1} Left the channel", e.Channel, e.Sender));
 }
Esempio n. 15
0
        public override void OnCommand(BotShell bot, CommandArgs e)
        {
            if (e.Args.Length < 1)
            {
                bot.SendReply(e, "Correct Usage: merge [username]");
                return;
            }
            string[] alts = bot.Users.GetAlts(e.Args[0]);
            if (alts.Length < 1)
            {
                bot.SendReply(e, "You're required to specify an account with alts in order to start the merge process");
                return;
            }
            string main = Config.EscapeString(Format.UppercaseFirst(e.Args[0]));

            lock (this)
            {
                bot.SendReply(e, "Now merging/fixing " + HTML.CreateColorString(bot.ColorHeaderHex, main + "'s") + " account...");
                this.Log(main, e.Sender + " has started an account merge");

                // Points
                int points = (int)(this._core.GetPoints(main) * 10);
                if (this._core.GetPoints(main) < this._core.MinimumPoints)
                {
                    points = 0;
                }
                int activity = this._core.GetActivity(main);
                if (activity < 0)
                {
                    activity = 0;
                }
                this.Log(main, main + "'s Old Raw Points: " + points);
                this.Log(main, main + "'s Old Activity: " + activity);
                foreach (string alt in alts)
                {
                    lock (this._database.Connection)
                    {
                        using (IDbCommand command = this._database.Connection.CreateCommand())
                        {
                            command.CommandText = "SELECT points, activity FROM points WHERE main = '" + alt + "'";
                            IDataReader reader = command.ExecuteReader();
                            if (reader.Read())
                            {
                                int tmpPoints   = reader.GetInt32(0);
                                int tmpActivity = reader.GetInt32(1);
                                this.Log(main, alt + "'s Old Raw Points: " + tmpPoints);
                                this.Log(main, alt + "'s Old Activity: " + tmpActivity);
                                points   += tmpPoints;
                                activity += tmpActivity;
                            }
                            reader.Close();
                        }
                    }
                }
                this._database.ExecuteNonQuery("REPLACE INTO points SET main = '" + main + "', points = " + points + ", activity = " + activity);
                this.Log(main, "New Raw Points: " + points);
                this.Log(main, "New Activity: " + activity);
                foreach (string alt in alts)
                {
                    this.Log(main, "Removing points account " + alt);
                    this._database.ExecuteNonQuery("DELETE FROM points WHERE main = '" + alt + "'");
                }

                /*// Credits
                 * int credits = this._members.GetCredits(main);
                 * if (credits < 0)
                 *  this.Log(main, "No credits history");
                 * else
                 *  this.Log(main, "Old Credits: " + credits);
                 * foreach (string alt in alts)
                 * {
                 *  lock (this._database.Connection)
                 *  {
                 *      using (IDbCommand command = this._database.Connection.CreateCommand())
                 *      {
                 *          command.CommandText = "SELECT credits FROM credits WHERE main = '" + alt + "'";
                 *          IDataReader reader = command.ExecuteReader();
                 *          if (reader.Read())
                 *          {
                 *              int tmpCredits = reader.GetInt32(0);
                 *              this.Log(main, alt + ": Old Credits: " + tmpCredits);
                 *              if (tmpCredits < credits)
                 *                  credits = tmpCredits;
                 *              else if (credits < 0)
                 *                  credits = tmpCredits;
                 *          }
                 *          reader.Close();
                 *      }
                 *  }
                 * }
                 * if (credits >= 0)
                 * {
                 *  this.Log(main, "New Credits: " + credits);
                 *  this._database.ExecuteNonQuery("INSERT INTO credits (`main`, `credits`, `lastRaidID`) VALUES ('" + main + "', " + credits + ", 0) ON DUPLICATE KEY UPDATE credits = " + credits);
                 *  foreach (string alt in alts)
                 *  {
                 *      this.Log(main, "Removing credits account " + alt);
                 *      this._database.ExecuteNonQuery("DELETE FROM credits WHERE main = '" + alt + "'");
                 *  }
                 * }
                 * else
                 * {
                 *  this.Log(main, "No credits change");
                 * }*/

                // Update raid history
                foreach (string alt in alts)
                {
                    this.Log(main, "Converting raid history from " + alt);
                    int tmpAffected = this._database.ExecuteNonQuery("UPDATE raiders SET main = '" + main + "' WHERE main = '" + alt + "'");
                    this.Log(main, "Converted: " + tmpAffected + " entries");
                }

                // Update loot history
                foreach (string alt in alts)
                {
                    this.Log(main, "Converting loot history from " + alt);
                    int tmpAffected = this._database.ExecuteNonQuery("UPDATE loot_history SET main = '" + main + "' WHERE main = '" + alt + "'");
                    this.Log(main, "Converted: " + tmpAffected + " entries");
                }
                this.Log(main, "Merge completed");
                this.Log(main, "-----------------------------------------");
                bot.SendReply(e, "Merging/fixing " + HTML.CreateColorString(bot.ColorHeaderHex, main + "'s") + " account done");
            }
        }
 public FireOnCommandContext(string command, BotShell bot, CommandArgs args)
 {
     Command = command;
     Bot     = bot;
     Args    = args;
 }
Esempio n. 17
0
        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;
            }
        }
Esempio n. 18
0
 public override void OnCommand(BotShell bot, CommandArgs e)
 {
     if (e.Args.Length == 0)
     {
         bot.SendReply(e, "Usage: breed [breed]");
         return;
     }
     else
     {
         foreach (BreedStats Breed in Breeds)
         {
             foreach (string Name in Breed.Name)
             {
                 if (Name.ToLower() == e.Args[0].ToLower())
                 {
                     /*
                      *  Strength     - ### / ###
                      *  Agility      - ### / ###
                      *  Stamina      - ### / ###
                      *  Intelligence - ### / ###
                      *  Sense        - ### / ###
                      *  Psychic      - ### / ###
                      *
                      *  NanoCost%    - ##%
                      *  HP / BodyDev - #
                      */
                     RichTextWindow window = new RichTextWindow(bot);
                     window.AppendTitle(Breed.Name[0]);
                     window.AppendLineBreak();
                     window.AppendHighlight("Breed Caps - (Normal Caps / Shadow Level Caps)");
                     window.AppendLineBreak(2);
                     window.AppendColorString(this.StatColor(Breed.ColorStr), "Strength");
                     window.AppendNormal(" - " + Breed.MinStr + " / " + Breed.MaxStr);
                     window.AppendLineBreak();
                     window.AppendColorString(this.StatColor(Breed.ColorAgil), "Agility");
                     window.AppendNormal(" - " + Breed.MinAgil + " / " + Breed.MaxAgil);
                     window.AppendLineBreak();
                     window.AppendColorString(this.StatColor(Breed.ColorSta), "Stamina");
                     window.AppendNormal(" - " + Breed.MinSta + " / " + Breed.MaxSta);
                     window.AppendLineBreak();
                     window.AppendColorString(this.StatColor(Breed.ColorInt), "Intelligence");
                     window.AppendNormal(" - " + Breed.MinInt + " / " + Breed.MaxInt);
                     window.AppendLineBreak();
                     window.AppendColorString(this.StatColor(Breed.ColorSen), "Sense");
                     window.AppendNormal(" - " + Breed.MinSen + " / " + Breed.MaxSen);
                     window.AppendLineBreak();
                     window.AppendColorString(this.StatColor(Breed.ColorPsy), "Psychic");
                     window.AppendNormal(" - " + Breed.MinPsy + " / " + Breed.MaxPsy);
                     window.AppendLineBreak(2);
                     window.AppendHighlight("NanoCost%");
                     window.AppendNormal(" - " + Breed.NanoCap + "%");
                     window.AppendLineBreak();
                     window.AppendHighlight("HP / BodyDev");
                     window.AppendNormal(" - " + Breed.HPPerBD);
                     bot.SendReply(e, Breed.Name[0] + " Stats »» ", window);
                     return;
                 }
             }
         }
         bot.SendReply(e, "No results found for \"" + e.Words[0] + "\"!");
         return;
     }
 }
Esempio n. 19
0
        public void OnAutomemberCommand(BotShell bot, CommandArgs e)
        {
            RichTextWindow window = new RichTextWindow(bot);

            window.AppendTitle("Automated Membership");

            window.AppendHighlight("Enabled: ");
            if (this._enabled)
            {
                window.AppendColorString(RichTextWindow.ColorGreen, "Yes");
            }
            else
            {
                window.AppendColorString(RichTextWindow.ColorRed, "No");
            }
            window.AppendLineBreak();

            window.AppendHighlight("Add to guestlist: ");
            if (this._guestlist)
            {
                window.AppendColorString(RichTextWindow.ColorGreen, "Yes");
            }
            else
            {
                window.AppendColorString(RichTextWindow.ColorRed, "No");
            }
            window.AppendLineBreak();

            if (this._factions.Count > 0)
            {
                window.AppendHighlight("Factions: ");
                window.AppendNormal(string.Join(", ", this._factions.ToArray()));
                window.AppendLineBreak();
            }

            if (this._levels.Count > 0)
            {
                window.AppendHighlight("Levels: ");
                window.AppendNormal(string.Join(", ", this.ToStringArray(this._levels)));
                window.AppendLineBreak();
            }

            if (this._defenderRanks.Count > 0)
            {
                window.AppendHighlight("Defender Ranks: ");
                window.AppendNormal(string.Join(", ", this.ToStringArray(this._defenderRanks)));
                window.AppendLineBreak();
            }

            if (this._professions.Count > 0)
            {
                window.AppendHighlight("Professions: ");
                window.AppendNormal(string.Join(", ", this._professions.ToArray()));
                window.AppendLineBreak();
            }

            if (this._breeds.Count > 0)
            {
                window.AppendHighlight("Breeds: ");
                window.AppendNormal(string.Join(", ", this._breeds.ToArray()));
                window.AppendLineBreak();
            }

            if (this._genders.Count > 0)
            {
                window.AppendHighlight("Genders: ");
                window.AppendNormal(string.Join(", ", this._genders.ToArray()));
                window.AppendLineBreak();
            }

            bot.SendReply(e, "Automated Membership »» ", window);
        }
Esempio n. 20
0
        public override void OnLoad(BotShell bot)
        {
            this._clumps.Add(247103, new VhBioClump(0, "Pristine Kyr'Ozch Bio-Material", "Used for making alien armor"));
            this._clumps.Add(247105, new VhBioClump(0, "Mutated Kyr'Ozch Bio-Material", "Used for making alien armor"));
            this._clumps.Add(254804, new VhBioClump(0, "Kyr'Ozch Viral Serum", "Used for making high QL buildings"));

            VhBioClump clump = new VhBioClump(1, "Kyr'Ozch Bio-Material - Type 1", "Fling shot");

            clump.Weapons.Add(new VhBioWeapon("Grenade Gun", 1, 99, 247437, 247438));
            clump.Weapons.Add(new VhBioWeapon("Grenade Gun", 100, 199, 247439, 247440));
            clump.Weapons.Add(new VhBioWeapon("Grenade Gun", 200, 299, 247441, 247442));
            clump.Weapons.Add(new VhBioWeapon("Grenade Gun", 300, 300, 247443, 247443));
            clump.Weapons.Add(new VhBioWeapon("Pistol", 1, 99, 254619, 254620));
            clump.Weapons.Add(new VhBioWeapon("Pistol", 100, 199, 254621, 254622));
            clump.Weapons.Add(new VhBioWeapon("Pistol", 200, 299, 254623, 254624));
            clump.Weapons.Add(new VhBioWeapon("Pistol", 300, 300, 254625, 254625));
            clump.Weapons.Add(new VhBioWeapon("Shotgun", 1, 99, 247437, 247438));
            clump.Weapons.Add(new VhBioWeapon("Shotgun", 200, 199, 254539, 254540));
            clump.Weapons.Add(new VhBioWeapon("Shotgun", 200, 299, 254541, 254542));
            clump.Weapons.Add(new VhBioWeapon("Shotgun", 300, 300, 254543, 254543));
            this._clumps.Add(247708, clump);

            clump = new VhBioClump(2, "Kyr'Ozch Bio-Material - Type 2", "Aimed Shot");
            clump.Weapons.Add(new VhBioWeapon("Crossbow", 1, 99, 254605, 254606));
            clump.Weapons.Add(new VhBioWeapon("Crossbow", 100, 199, 254607, 254608));
            clump.Weapons.Add(new VhBioWeapon("Crossbow", 200, 299, 254609, 254610));
            clump.Weapons.Add(new VhBioWeapon("Crossbow", 300, 300, 254611, 254611));
            clump.Weapons.Add(new VhBioWeapon("Rifle", 1, 99, 254472, 254473));
            clump.Weapons.Add(new VhBioWeapon("Rifle", 100, 199, 254474, 254475));
            clump.Weapons.Add(new VhBioWeapon("Rifle", 200, 299, 254476, 254477));
            clump.Weapons.Add(new VhBioWeapon("Rifle", 300, 300, 254478, 254478));
            this._clumps.Add(247710, clump);

            clump = new VhBioClump(3, "Kyr'Ozch Bio-Material - Type 3", "Fling Shot and Aimed Shot");
            clump.Weapons.Add(new VhBioWeapon("Crossbow", 1, 99, 254598, 254599));
            clump.Weapons.Add(new VhBioWeapon("Crossbow", 100, 199, 254600, 254601));
            clump.Weapons.Add(new VhBioWeapon("Crossbow", 200, 299, 254602, 254603));
            clump.Weapons.Add(new VhBioWeapon("Crossbow", 300, 300, 254604, 254604));
            clump.Weapons.Add(new VhBioWeapon("Energy Carbine", 1, 99, 254556, 254557));
            clump.Weapons.Add(new VhBioWeapon("Energy Carbine", 100, 199, 254558, 254559));
            clump.Weapons.Add(new VhBioWeapon("Energy Carbine", 200, 299, 254560, 254561));
            clump.Weapons.Add(new VhBioWeapon("Energy Carbine", 300, 300, 254562, 254562));
            clump.Weapons.Add(new VhBioWeapon("Rifle", 1, 99, 254479, 254480));
            clump.Weapons.Add(new VhBioWeapon("Rifle", 100, 199, 254481, 254482));
            clump.Weapons.Add(new VhBioWeapon("Rifle", 200, 299, 254483, 254484));
            clump.Weapons.Add(new VhBioWeapon("Rifle", 300, 300, 254485, 254485));
            this._clumps.Add(247718, clump);

            clump = new VhBioClump(4, "Kyr'Ozch Bio-Material - Type 4", "Burst");
            clump.Weapons.Add(new VhBioWeapon("Machine Pistol", 1, 99, 254654, 254655));
            clump.Weapons.Add(new VhBioWeapon("Machine Pistol", 100, 199, 254656, 254657));
            clump.Weapons.Add(new VhBioWeapon("Machine Pistol", 200, 299, 254658, 254659));
            clump.Weapons.Add(new VhBioWeapon("Machine Pistol", 300, 300, 54660, 254660));
            clump.Weapons.Add(new VhBioWeapon("Pistol", 1, 99, 54626, 254627));
            clump.Weapons.Add(new VhBioWeapon("Pistol", 100, 199, 254628, 254629));
            clump.Weapons.Add(new VhBioWeapon("Pistol", 200, 299, 254630, 254631));
            clump.Weapons.Add(new VhBioWeapon("Pistol", 300, 300, 254632, 254632));
            clump.Weapons.Add(new VhBioWeapon("Submachine Gun", 1, 99, 254521, 254522));
            clump.Weapons.Add(new VhBioWeapon("Submachine Gun", 100, 199, 254523, 254524));
            clump.Weapons.Add(new VhBioWeapon("Submachine Gun", 200, 299, 254525, 254526));
            clump.Weapons.Add(new VhBioWeapon("Submachine Gun", 300, 300, 254527, 254527));
            this._clumps.Add(247712, clump);

            clump = new VhBioClump(5, "Kyr'Ozch Bio-Material - Type 5", "Fling Shot and Burst");
            clump.Weapons.Add(new VhBioWeapon("Carbine", 1, 99, 254493, 254494));
            clump.Weapons.Add(new VhBioWeapon("Carbine", 100, 199, 254495, 254496));
            clump.Weapons.Add(new VhBioWeapon("Carbine", 200, 299, 254497, 254498));
            clump.Weapons.Add(new VhBioWeapon("Carbine", 300, 300, 254499, 254499));
            clump.Weapons.Add(new VhBioWeapon("Energy Carbine", 1, 99, 254549, 254550));
            clump.Weapons.Add(new VhBioWeapon("Energy Carbine", 100, 199, 254551, 254552));
            clump.Weapons.Add(new VhBioWeapon("Energy Carbine", 200, 299, 254553, 254554));
            clump.Weapons.Add(new VhBioWeapon("Energy Carbine", 300, 300, 254555, 254555));
            clump.Weapons.Add(new VhBioWeapon("Pistol", 1, 99, 254640, 254641));
            clump.Weapons.Add(new VhBioWeapon("Pistol", 100, 199, 254642, 254643));
            clump.Weapons.Add(new VhBioWeapon("Pistol", 200, 299, 254644, 254645));
            clump.Weapons.Add(new VhBioWeapon("Pistol", 300, 300, 254646, 254646));
            clump.Weapons.Add(new VhBioWeapon("Machine Pistol", 1, 99, 254661, 254662));
            clump.Weapons.Add(new VhBioWeapon("Machine Pistol", 100, 199, 254663, 254664));
            clump.Weapons.Add(new VhBioWeapon("Machine Pistol", 200, 299, 254665, 254666));
            clump.Weapons.Add(new VhBioWeapon("Machine Pistol", 300, 300, 254667, 254667));
            clump.Weapons.Add(new VhBioWeapon("Submachine gun", 1, 99, 254528, 254529));
            clump.Weapons.Add(new VhBioWeapon("Submachine gun", 100, 199, 254530, 254531));
            clump.Weapons.Add(new VhBioWeapon("Submachine gun", 200, 299, 254532, 254533));
            clump.Weapons.Add(new VhBioWeapon("Submachine gun", 300, 300, 254534, 254534));
            this._clumps.Add(247714, clump);

            clump = new VhBioClump(12, "Kyr'Ozch Bio-Material - Type 12", "Burst and Full Auto");
            clump.Weapons.Add(new VhBioWeapon("Carbine", 1, 99, 254500, 254501));
            clump.Weapons.Add(new VhBioWeapon("Carbine", 100, 199, 254502, 254503));
            clump.Weapons.Add(new VhBioWeapon("Carbine", 200, 299, 254504, 254505));
            clump.Weapons.Add(new VhBioWeapon("Carbine", 300, 300, 254506, 254506));
            clump.Weapons.Add(new VhBioWeapon("Submachine Gun", 1, 99, 254535, 254536));
            clump.Weapons.Add(new VhBioWeapon("Submachine Gun", 100, 199, 254537, 254538));
            clump.Weapons.Add(new VhBioWeapon("Submachine Gun", 200, 299, 254539, 254540));
            clump.Weapons.Add(new VhBioWeapon("Submachine Gun", 300, 300, 254541, 254541));
            this._clumps.Add(247716, clump);

            clump = new VhBioClump(13, "Kyr'Ozch Bio-Material - Type 13", "Burst, Fling Shot and Full Auto");
            clump.Weapons.Add(new VhBioWeapon("Carbine", 1, 99, 254507, 254508));
            clump.Weapons.Add(new VhBioWeapon("Carbine", 100, 199, 254509, 254510));
            clump.Weapons.Add(new VhBioWeapon("Carbine", 200, 299, 254511, 254512));
            clump.Weapons.Add(new VhBioWeapon("Carbine", 300, 300, 254513, 254513));
            this._clumps.Add(247720, clump);

            clump = new VhBioClump(76, "Kyr'Ozch Bio-Material - Type 76", "Brawl and Fast Attack");
            clump.Weapons.Add(new VhBioWeapon("Energy Sword", 1, 99, 254745, 254746));
            clump.Weapons.Add(new VhBioWeapon("Energy Sword", 100, 199, 254747, 254748));
            clump.Weapons.Add(new VhBioWeapon("Energy Sword", 200, 299, 254749, 254750));
            clump.Weapons.Add(new VhBioWeapon("Energy Sword", 300, 300, 254751, 254751));
            clump.Weapons.Add(new VhBioWeapon("Sledgehammer", 1, 99, 254731, 254732));
            clump.Weapons.Add(new VhBioWeapon("Sledgehammer", 100, 199, 254733, 254734));
            clump.Weapons.Add(new VhBioWeapon("Sledgehammer", 200, 299, 254735, 254736));
            clump.Weapons.Add(new VhBioWeapon("Sledgehammer", 300, 300, 254737, 254737));
            this._clumps.Add(247698, clump);

            clump = new VhBioClump(112, "Kyr'Ozch Bio-Material - Type 112", "Brawl, Dimach and Fast Attack");
            clump.Weapons.Add(new VhBioWeapon("Energy Hammer", 1, 99, 254703, 254704));
            clump.Weapons.Add(new VhBioWeapon("Energy Hammer", 100, 199, 254705, 254706));
            clump.Weapons.Add(new VhBioWeapon("Energy Hammer", 200, 299, 254707, 254708));
            clump.Weapons.Add(new VhBioWeapon("Energy Hammer", 300, 300, 254709, 254709));
            clump.Weapons.Add(new VhBioWeapon("Hammer", 1, 99, 254675, 254676));
            clump.Weapons.Add(new VhBioWeapon("Hammer", 100, 199, 254677, 254678));
            clump.Weapons.Add(new VhBioWeapon("Hammer", 200, 299, 254679, 254680));
            clump.Weapons.Add(new VhBioWeapon("Hammer", 300, 300, 254681, 254681));
            clump.Weapons.Add(new VhBioWeapon("Spear", 1, 99, 254780, 254781));
            clump.Weapons.Add(new VhBioWeapon("Spear", 100, 199, 254782, 254783));
            clump.Weapons.Add(new VhBioWeapon("Spear", 200, 299, 254784, 254785));
            clump.Weapons.Add(new VhBioWeapon("Spear", 300, 300, 254786, 254786));
            clump.Weapons.Add(new VhBioWeapon("Sword", 1, 99, 254759, 254760));
            clump.Weapons.Add(new VhBioWeapon("Sword", 100, 199, 254761, 254762));
            clump.Weapons.Add(new VhBioWeapon("Sword", 200, 299, 254763, 254764));
            clump.Weapons.Add(new VhBioWeapon("Sword", 300, 300, 254765, 254765));
            this._clumps.Add(247700, clump);

            clump = new VhBioClump(240, "Kyr'Ozch Bio-Material - Type 240", "Brawl, Dimach, Fast Attack and Sneak Attack");
            clump.Weapons.Add(new VhBioWeapon("Axe", 1, 99, 254689, 254690));
            clump.Weapons.Add(new VhBioWeapon("Axe", 100, 199, 254691, 254692));
            clump.Weapons.Add(new VhBioWeapon("Axe", 200, 299, 254693, 254694));
            clump.Weapons.Add(new VhBioWeapon("Axe", 300, 300, 254695, 254695));
            this._clumps.Add(247702, clump);

            clump = new VhBioClump(880, "Kyr'Ozch Bio-Material - Type 880", "Dimach, Fast Attack, Parry and Riposte");
            clump.Weapons.Add(new VhBioWeapon("Sword", 1, 99, 254766, 254767));
            clump.Weapons.Add(new VhBioWeapon("Sword", 100, 199, 254768, 254769));
            clump.Weapons.Add(new VhBioWeapon("Sword", 200, 299, 254770, 254771));
            clump.Weapons.Add(new VhBioWeapon("Sword", 300, 300, 254772, 254772));
            this._clumps.Add(247704, clump);

            clump = new VhBioClump(992, "Kyr'Ozch Bio-Material - Type 992", "Dimach, Fast Attack, Sneak Attack, Parry and Riposte");
            clump.Weapons.Add(new VhBioWeapon("Energy Rapier", 1, 99, 254717, 254718));
            clump.Weapons.Add(new VhBioWeapon("Energy Rapier", 100, 199, 254719, 254720));
            clump.Weapons.Add(new VhBioWeapon("Energy Rapier", 200, 299, 254721, 254722));
            clump.Weapons.Add(new VhBioWeapon("Energy Rapier", 300, 300, 254723, 254723));
            this._clumps.Add(247706, clump);
        }
Esempio n. 21
0
        public override void OnCommand(BotShell bot, CommandArgs e)
        {
            RichTextWindow window = new RichTextWindow(bot);

            window.AppendTitle("Clien Lag Tweak");
            window.AppendLineBreak();
            window.AppendHighlight("Environment and Visual (No Zoning Required)");
            window.AppendLineBreak();
            window.AppendCommand("Enable", "/option ShowAllNames 1");
            window.AppendNormal("  ");
            window.AppendCommand("Disable", "/option ShowAllNames 0");
            window.AppendNormal(" Character names show over head");
            window.AppendLineBreak();
            window.AppendCommand("Enable", "/option SimpleClouds 1");
            window.AppendNormal("  ");
            window.AppendCommand("Disable", "/option SimpleClouds 0");
            window.AppendNormal(" Display Simple Clouds ");
            window.AppendLineBreak();
            window.AppendCommand("Enable", "/option RealisticClouds 1");
            window.AppendNormal("  ");
            window.AppendCommand("Disable", "/option RealisticClouds 0");
            window.AppendNormal(" Display Realistic Clouds ");
            window.AppendLineBreak();
            window.AppendCommand("Enable", "/option RealisticMoons 1");
            window.AppendNormal("  ");
            window.AppendCommand("Disable", "/option RealisticMoons 0");
            window.AppendNormal(" Display Realistic Moons");
            window.AppendLineBreak();
            window.AppendCommand("Enable", "/option StarRotation 1");
            window.AppendNormal("  ");
            window.AppendCommand("Disable", "/option StarRotation 0");
            window.AppendNormal(" Star rotation at night");
            window.AppendLineBreak();
            window.AppendCommand("Enable", "/option Wildlife 1");
            window.AppendNormal("  ");
            window.AppendCommand("Disable", "/option Wildlife 0");
            window.AppendNormal(" Show wildlife");
            window.AppendLineBreak();
            window.AppendCommand("Enable", "/option IsSpaceShipsShown 1");
            window.AppendNormal("  ");
            window.AppendCommand("Disable", "/option IsSpaceShipsShown 0");
            window.AppendNormal(" Show Sace Ships");
            window.AppendLineBreak();
            window.AppendCommand("Enable", "/option Shadows 1");
            window.AppendNormal("  ");
            window.AppendCommand("Disable", "/option Shadows 0");
            window.AppendNormal(" Show Ground Shadows");
            window.AppendLineBreak(2);
            window.AppendHighlight("Environment and Visual (Zoning Required)");
            window.AppendLineBreak();
            window.AppendCommand("Enable", "/option BuffsFX 1");
            window.AppendNormal("  ");
            window.AppendCommand("Disable", "/option BuffsFX 0");
            window.AppendNormal(" Show Buff Effects");
            window.AppendLineBreak();
            window.AppendCommand("Enable", "/option EnvironmentFX 1");
            window.AppendNormal("  ");
            window.AppendCommand("Disable", "/option EnvironmentFX 0");
            window.AppendNormal(" Show Environment Effects");
            window.AppendLineBreak();
            window.AppendCommand("Enable", "/option MuzzleFlashFX 1");
            window.AppendNormal("  ");
            window.AppendCommand("Disable", "/option MuzzleFlashFX 0");
            window.AppendNormal(" Show Muzzle Flash");
            window.AppendLineBreak();
            window.AppendCommand("Enable", "/option NanoEffectFX 1");
            window.AppendNormal("  ");
            window.AppendCommand("Disable", "/option NanoEffectFX 0");
            window.AppendNormal(" Show Nano Effects (Calms, Damage Shields, etc.)");
            window.AppendLineBreak();
            window.AppendCommand("Enable", "/option TracersFX 1");
            window.AppendNormal("  ");
            window.AppendCommand("Disable", "/option TracersFX 0");
            window.AppendNormal(" Show Tracers");
            window.AppendLineBreak();
            window.AppendCommand("Enable", "/option OthersFX 1");
            window.AppendNormal("  ");
            window.AppendCommand("Disable", "/option OthersFX 0");
            window.AppendNormal(" Show Others Effects");
            window.AppendLineBreak(2);
            window.AppendHighlight("Audio Settings (No Zoning Required)");
            window.AppendLineBreak();
            window.AppendCommand("Enable", "/option SoundOnOff 1");
            window.AppendNormal("  ");
            window.AppendCommand("Disable", "/option SoundOnOff 0");
            window.AppendNormal(" Sound Master ");
            window.AppendLineBreak();
            window.AppendCommand("Enable", "/option SoundFXOn 1");
            window.AppendNormal("  ");
            window.AppendCommand("Disable", "/option SoundFXOn 0");
            window.AppendNormal(" Sound Effects");
            window.AppendLineBreak();
            window.AppendCommand("Enable", "/option MusicOn 1");
            window.AppendNormal("  ");
            window.AppendCommand("Disable", "/option MusicOn 0");
            window.AppendNormal(" Music");
            window.AppendLineBreak();
            window.AppendCommand("Enable", "/option VoiceSndFxOn 1");
            window.AppendNormal("  ");
            window.AppendCommand("Disable", "/option VoiceSndFxOn 0");
            window.AppendNormal(" Voices");
            window.AppendLineBreak(2);
            window.AppendHighlight("View Distance Settings (No Zoning Required)");
            window.AppendLineBreak();
            window.AppendCommand("Min", "/option ViewDistance 0.05");
            window.AppendNormal("  ");
            window.AppendCommand("Low", "/option ViewDistance 0.30");
            window.AppendNormal("  ");
            window.AppendCommand("Medium", "/option ViewDistance 0.50");
            window.AppendNormal("  ");
            window.AppendCommand("High", "/option ViewDistance 0.75");
            window.AppendNormal("  ");
            window.AppendCommand("Max", "/option ViewDistance 1");
            window.AppendNormal(" View Distance");
            window.AppendLineBreak();
            window.AppendCommand("Min", "/CharDist 5");
            window.AppendNormal("  ");
            window.AppendCommand("Low", "/CharDist 30");
            window.AppendNormal("  ");
            window.AppendCommand("Medium", "/CharDist 50");
            window.AppendNormal("  ");
            window.AppendCommand("High", "/CharDist 75");
            window.AppendNormal("  ");
            window.AppendCommand("Max", "/CharDist 100");
            window.AppendNormal(" Character View Distance");
            window.AppendLineBreak(2);
            bot.SendReply(e, " Lag Tweak »» ", window);
        }
Esempio n. 22
0
        public void OnOnlineCommand(BotShell bot, CommandArgs e)
        {
            List <string>         titles  = new List <string>();
            List <RichTextWindow> windows = new List <RichTextWindow>();
            string args = string.Empty;

            if (e.Args.Length > 0)
            {
                args = e.Args[0];
            }

            // Notify List
            if (this.IncludeNotifyList)
            {
                string[] online = bot.FriendList.Online("notify");
                if (online.Length > 0)
                {
                    RichTextWindow notifyWindow = new RichTextWindow(bot);
                    notifyWindow.AppendHeader(online.Length + " Users Online");
                    int results = 0;
                    this.BuildList(bot, online, ref notifyWindow, ref results, args);
                    if (results > 0)
                    {
                        titles.Add(HTML.CreateColorString(bot.ColorHeaderHex, results.ToString()) + " Users Online");
                        windows.Add(notifyWindow);
                    }
                }
            }

            // Private Channel
            if (this.IncludePrivateChannel)
            {
                Dictionary <UInt32, Friend> list = bot.PrivateChannel.List();
                List <string> guests             = new List <string>();
                foreach (KeyValuePair <UInt32, Friend> user in list)
                {
                    guests.Add(user.Value.User);
                }
                if (guests.Count > 0)
                {
                    RichTextWindow guestsWindow = new RichTextWindow(bot);
                    guestsWindow.AppendHeader(guests.Count + " Users on the Private Channel");
                    int results = 0;
                    this.BuildList(bot, guests.ToArray(), ref guestsWindow, ref results, args);
                    if (results > 0)
                    {
                        titles.Add(HTML.CreateColorString(bot.ColorHeaderHex, results.ToString()) + " Users on the Private Channel");
                        windows.Add(guestsWindow);
                    }
                }
            }

            // Output
            if (titles.Count < 1)
            {
                bot.SendReply(e, "The are currently no users online");
                return;
            }
            if (SeperateSections)
            {
                for (int i = 0; i < windows.Count; i++)
                {
                    RichTextWindow window = new RichTextWindow(bot);
                    window.AppendTitle();
                    window.AppendRawString(windows[i].Text);
                    bot.SendReply(e, titles[i] + " »» ", window);
                }
            }
            else
            {
                RichTextWindow window = new RichTextWindow(bot);
                window.AppendTitle();
                foreach (RichTextWindow subWindow in windows)
                {
                    window.AppendRawString(subWindow.Text);
                }
                bot.SendReply(e, string.Join(", ", titles.ToArray()) + " »» ", window);
            }
        }
Esempio n. 23
0
 private void OnGlyphsClearCommand(BotShell bot, CommandArgs e)
 {
     this._database.ExecuteNonQuery("UPDATE glyphs SET visible = 'false'");
     bot.SendReply(e, "The glyph list has been cleared");
 }
Esempio n. 24
0
 public void BuildList(BotShell bot, string[] users, ref RichTextWindow window)
 {
     int results = 0; this.BuildList(bot, users, ref window, ref results, string.Empty);
 }
Esempio n. 25
0
        private void OnGlyphsJoinCommand(BotShell bot, CommandArgs e)
        {
            if (!this._raffleActive)
            {
                bot.SendReply(e, "There's no glyph raffle active");
                return;
            }

            if (e.Args.Length < 1)
            {
                bot.SendReply(e, "Glyph Raffle »» ", this._raffleWindow);
                return;
            }
            int    id       = 0;
            string username = bot.Users.GetMain(e.Sender);

            try { id = Convert.ToInt32(e.Args[0]); }
            catch
            {
                bot.SendReply(e, "Invalid ID");
                return;
            }
            lock (this._raffleMains)
            {
                if (this._raffleMains.Contains(username))
                {
                    bot.SendReply(e, "You can only join 1 raffle");
                    return;
                }
            }
            lock (this._raffleJoined)
            {
                if (!this._raffleJoined.ContainsKey(id))
                {
                    bot.SendReply(e, "There's no item with that ID in the current glyph raffle");
                    return;
                }
                if (this._raffleJoined[id].Contains(e.Sender))
                {
                    bot.SendReply(e, "You already joined this raffle");
                    return;
                }
                lock (this._professions)
                {
                    if (this._professions.ContainsValue(id))
                    {
                        WhoisResult whois = XML.GetWhois(e.Sender, bot.Dimension);
                        if (whois == null || !whois.Success)
                        {
                            bot.SendReply(e, "Unable to get your profession. This is required to join this raffle. Please try again later");
                            return;
                        }
                        if (!this._professions.ContainsKey(whois.Stats.Profession.ToLower()))
                        {
                            bot.SendReply(e, "Your profession was not found in our database. Please contact an administrator if you feel this is an error");
                            return;
                        }
                        if (this._professions[whois.Stats.Profession.ToLower()] != id)
                        {
                            bot.SendReply(e, "Profession restrictions prevent you from joining this raffle");
                            return;
                        }
                    }
                }
                this._raffleJoined[id].Add(e.Sender);
                lock (this._raffleMains)
                    this._raffleMains.Add(username);
            }
            bot.SendReply(e, "You have joined the raffle");
            return;
        }
Esempio n. 26
0
        public void BuildList(BotShell bot, string[] users, ref RichTextWindow window, ref int results, string profs)
        {
            if (window == null)
            {
                return;
            }
            if (users.Length == 0)
            {
                return;
            }

            SortedDictionary <string, SortedDictionary <string, WhoisResult> > list = new SortedDictionary <string, SortedDictionary <string, WhoisResult> >();
            Dictionary <string, WhoisResult> whoisResults = new Dictionary <string, WhoisResult>();

            foreach (string user in users)
            {
                if (user == null || user == string.Empty)
                {
                    continue;
                }

                string      header;
                WhoisResult whois = XML.GetWhois(user, bot.Dimension);
                if (profs != null && profs != string.Empty)
                {
                    if (whois == null || whois.Stats == null)
                    {
                        continue;
                    }
                    if (!whois.Stats.Profession.StartsWith(profs, StringComparison.CurrentCultureIgnoreCase))
                    {
                        continue;
                    }
                }
                if (whois != null && whois.Stats != null)
                {
                    if (this.DisplayMode == "Level")
                    {
                        header = whois.Stats.Level.ToString();
                    }
                    else
                    {
                        header = whois.Stats.Profession;
                    }

                    if (!whoisResults.ContainsKey(user.ToLower()))
                    {
                        whoisResults.Add(user.ToLower(), whois);
                    }
                }
                else
                if (this.DisplayMode == "Level")
                {
                    header = "0";
                }
                else
                {
                    header = "Unknown";
                }

                if (this.DisplayMode == "Alphabetical")
                {
                    header = user.ToUpper().ToCharArray()[0].ToString();
                }

                if (!list.ContainsKey(header))
                {
                    list.Add(header, new SortedDictionary <string, WhoisResult>());
                }
                list[header].Add(user, whois);
            }
            results = 0;
            foreach (KeyValuePair <string, SortedDictionary <string, WhoisResult> > prof in list)
            {
                if (this.DisplayHeaders == "Text")
                {
                    window.AppendHighlight(prof.Key);
                    window.AppendLineBreak();
                }
                else if (this.DisplayHeaders == "Icons")
                {
                    window.AppendImage("GFX_GUI_FRIENDLIST_SPLITTER");
                    window.AppendLineBreak();
                    window.AppendIcon(Icons[prof.Key]);
                    window.AppendHighlight(prof.Key);
                    window.AppendLineBreak();
                    window.AppendImage("GFX_GUI_FRIENDLIST_SPLITTER");
                    window.AppendLineBreak();
                }
                foreach (KeyValuePair <string, WhoisResult> user in prof.Value)
                {
                    // Name
                    window.AppendNormalStart();
                    window.AppendString("   ");
                    int    level   = 0;
                    int    ailevel = 0;
                    string name    = Format.UppercaseFirst(user.Key);

                    // Level
                    if (user.Value != null && user.Value.Stats != null)
                    {
                        level   = user.Value.Stats.Level;
                        ailevel = user.Value.Stats.DefenderLevel;
                    }
                    if (level < 10)
                    {
                        window.AppendColorString("000000", "00");
                    }
                    else if (level < 100)
                    {
                        window.AppendColorString("000000", "0");
                    }
                    window.AppendString(level + " ");

                    if (ailevel < 10)
                    {
                        window.AppendColorString("000000", "0");
                    }
                    window.AppendColorString(RichTextWindow.ColorGreen, ailevel + " ");
                    window.AppendString(name);

                    // Organization
                    bool displayOrganization = false;
                    if (this.DisplayOrganization == "Always")
                    {
                        displayOrganization = true;
                    }

                    if (this.DisplayOrganization == "Foreign")
                    {
                        displayOrganization = true;
                        if (bot.InOrganization && whoisResults.ContainsKey(name.ToLower()) && whoisResults[name.ToLower()].InOrganization && bot.Organization == whoisResults[name.ToLower()].Organization.Name)
                        {
                            displayOrganization = false;
                        }
                    }

                    if (displayOrganization)
                    {
                        if (!whoisResults.ContainsKey(name.ToLower()))
                        {
                            window.AppendString(" (Unknown)");
                        }
                        else if (whoisResults[name.ToLower()].InOrganization)
                        {
                            window.AppendString(" (" + whoisResults[name.ToLower()].Organization.ToString() + ")");
                        }
                        else
                        {
                            window.AppendString(" (Not Guilded)");
                        }
                    }

                    // Rank
                    if (this.DisplayRanks)
                    {
                        UserLevel userLevel = bot.Users.GetUser(name);
                        if (userLevel > UserLevel.Member)
                        {
                            window.AppendString(" (");
                            window.AppendColorString(RichTextWindow.ColorRed, bot.Users.GetUser(name).ToString());
                            window.AppendString(")");
                        }
                    }

                    // Alts
                    if (this.DisplayAlts)
                    {
                        string   main = bot.Users.GetMain(name);
                        string[] alts = bot.Users.GetAlts(main);
                        if (alts.Length > 0)
                        {
                            window.AppendString(" :: ");
                            if (main == name)
                            {
                                window.AppendBotCommand("Alts", "alts " + main);
                            }
                            else
                            {
                                window.AppendBotCommand(main + "'s Alts", "alts " + main);
                            }
                        }
                    }

                    // Afk
                    if (this.DisplayAfk)
                    {
                        lock (this.Afk)
                        {
                            if (this.Afk.ContainsKey(name))
                            {
                                window.AppendString(" :: ");
                                window.AppendColorString(RichTextWindow.ColorRed, "AFK");
                            }
                        }
                    }
                    window.AppendColorEnd();
                    window.AppendLineBreak();
                    results++;
                }
                if (this.DisplayHeaders == "Text" || this.DisplayHeaders == "Icons")
                {
                    window.AppendLineBreak();
                }
            }
            if (this.DisplayHeaders == "Off")
            {
                window.AppendLineBreak();
            }
        }
Esempio n. 27
0
        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);
        }
Esempio n. 28
0
 public override void OnUnload(BotShell bot)
 {
     bot.Events.ConfigurationChangedEvent -= new ConfigurationChangedHandler(Events_ConfigurationChangedEvent);
 }
Esempio n. 29
0
 private void TrickleBase(BotShell bot, CommandArgs e)
 {
     bot.SendReply(e, "Usage: trickle str/sta/agi/sen/int/psy [amount]");
     return;
 }
Esempio n. 30
0
 public VhanetMembers(BotShell bot, string group, VhanetDatabase database)
 {
     this._bot      = bot;
     this._group    = group;
     this._database = database;
 }