示例#1
0
        public override void OnLoad(BotShell bot)
        {
            try { this._database = (RaidDatabase)bot.Plugins.GetPlugin("RaidDatabase"); }
            catch { throw new Exception("Unable to connect to 'Raid :: Database' Plugin!"); }
            try { this._core = (RaidCore)bot.Plugins.GetPlugin("RaidCore"); }
            catch { throw new Exception("Unable to connect to 'Raid :: Core' Plugin!"); }
            if (!this._database.Connected)
            {
                throw new Exception("Not connected to the database!");
            }

            this._database.ExecuteNonQuery("CREATE TABLE IF NOT EXISTS credits (main VARCHAR(20) NOT NULL, type INT NOT NULL, credits INT NOT NULL, lastRaidID INT NOT NULL, PRIMARY KEY (main, type))");
            this._database.ExecuteNonQuery("CREATE TABLE IF NOT EXISTS credits_types (type INT NOT NULL, name VARCHAR(50) NOT NULL, description VARCHAR(255) NOT NULL, credits INT NOT NULL, PRIMARY KEY (type))");
            this._bot = bot;

            this._core.StoppedEvent += new EventHandler(StoppedEvent);
            this._core.StartedEvent += new EventHandler(StartedEvent);
            bot.Events.ConfigurationChangedEvent += new ConfigurationChangedHandler(ConfigurationChangedEvent);
            bot.Events.UserLeaveChannelEvent     += new UserLeaveChannelHandler(UserLeaveChannelEvent);
            bot.Events.UserJoinChannelEvent      += new UserJoinChannelHandler(UserJoinChannelEvent);

            bot.Configuration.Register(ConfigType.Boolean, this.InternalName, "autoban", "Automatically Raid-Ban Kicked Users", false);
            bot.Configuration.Register(ConfigType.Integer, this.InternalName, "banduraction", "Default Raid-Ban Duration", 5);
            bot.Configuration.Register(ConfigType.Boolean, this.InternalName, "creditsenabled", "Enable Raid Credits System", this.CreditsEnabled);
            bot.Configuration.Register(ConfigType.Integer, this.InternalName, "creditsmax", "Maximum Amount of Raid Credits spent", this.CreditsMax);
            bot.Configuration.Register(ConfigType.Integer, this.InternalName, "mainslevelreq", "Level Requirement to Join the Raid (Mains)", 0);
            bot.Configuration.Register(ConfigType.Integer, this.InternalName, "altslevelreq", "Level Requirement to Join the Raid (Alts)", 0);
            this.ReloadConfig(bot);
            this._timer           = new System.Timers.Timer();
            this._timer.Interval  = 1000;
            this._timer.AutoReset = true;
            this._timer.Elapsed  += new System.Timers.ElapsedEventHandler(TimerEvent);
            this._timer.Start();
        }
示例#2
0
        public override void OnLoad(BotShell bot)
        {
            try { this._core = (RaidCore)bot.Plugins.GetPlugin("RaidCore"); }
            catch { throw new Exception("Unable to connect to 'Raid :: Core' Plugin!"); }
            try { this._database = (RaidDatabase)bot.Plugins.GetPlugin("RaidDatabase"); }
            catch { throw new Exception("Unable to connect to 'Raid :: Database' Plugin!"); }

            this._database.ExecuteNonQuery("CREATE TABLE IF NOT EXISTS rules (id INT NOT NULL AUTO_INCREMENT, title VARCHAR(255), rule TEXT NOT NULL, visible ENUM('true','false') NOT NULL, PRIMARY KEY (id))");
        }
示例#3
0
 public override void OnLoad(BotShell bot)
 {
     try { this._database = (RaidDatabase)bot.Plugins.GetPlugin("RaidDatabase"); }
     catch { throw new Exception("Unable to connect to 'Raid :: Database' Plugin!"); }
     try { this._core = (RaidCore)bot.Plugins.GetPlugin("RaidCore"); }
     catch { throw new Exception("Unable to connect to 'Raid :: Core' Plugin!"); }
     if (!this._database.Connected)
     {
         throw new Exception("Not connected to the database!");
     }
     this._bot = bot;
 }
示例#4
0
        public override void OnLoad(BotShell bot)
        {
            try { this._database = (RaidDatabase)bot.Plugins.GetPlugin("RaidDatabase"); }
            catch { throw new Exception("Unable to connect to 'Raid :: Database' Plugin!"); }
            try { this._core = (RaidCore)bot.Plugins.GetPlugin("RaidCore"); }
            catch { throw new Exception("Unable to connect to 'Raid :: Core' Plugin!"); }
            if (!this._database.Connected)
            {
                throw new Exception("Not connected to the database!");
            }

            this._database.ExecuteNonQuery("CREATE TABLE IF NOT EXISTS loot_history (id INT NOT NULL AUTO_INCREMENT, main VARCHAR(14), admin VARCHAR(14), points INT NOT NULL, date INT NOT NULL, item INT NOT NULL, PRIMARY KEY (id))");
            this._database.ExecuteNonQuery("CREATE TABLE IF NOT EXISTS loot (id INT NOT NULL AUTO_INCREMENT, name VARCHAR(255), monster VARCHAR(255), lowid INT NOT NULL, highid INT NOT NULL, ql INT NOT NULL, icon INT NOT NULL, visible ENUM('true','false') NOT NULL, PRIMARY KEY (id))");

            this._bot            = bot;
            this._timer          = new Timer();
            this._timer.Interval = 1000;
            this._timer.Elapsed += new ElapsedEventHandler(OnTimer);
        }
示例#5
0
        public override void OnLoad(BotShell bot)
        {
            try { this._core = (RaidCore)bot.Plugins.GetPlugin("RaidCore"); }
            catch { throw new Exception("Unable to connect to 'Raid :: Core' Plugin!"); }
            try { this._database = (RaidDatabase)bot.Plugins.GetPlugin("RaidDatabase"); }
            catch { throw new Exception("Unable to connect to 'Raid :: Database' Plugin!"); }
            bot.Events.PrivateChannelMessageEvent += new PrivateChannelMessageHandler(OnPrivateChannelMessageEvent);
            this._database.ExecuteNonQuery("CREATE TABLE IF NOT EXISTS glyphs (id INT NOT NULL AUTO_INCREMENT, item INT NOT NULL, looter VARCHAR(255), time INT NOT NULL, visible ENUM('true','false') NOT NULL, PRIMARY KEY (id))");

            this._items = new Dictionary <int, string>();
            this._items.Add(218348, "Blue Glyph of Aban");
            this._items.Add(218349, "Blue Glyph of Enel");
            this._items.Add(218350, "Blue Glyph of Ocra");

            this._professions = new Dictionary <string, int>();
            this._professions.Add("enforcer", 218348);
            this._professions.Add("engineer", 218348);
            this._professions.Add("keeper", 218348);
            this._professions.Add("martial artist", 218348);
            this._professions.Add("shade", 218348);

            this._professions.Add("agent", 218349);
            this._professions.Add("bureaucrat", 218349);
            this._professions.Add("nano-technician", 218349);
            this._professions.Add("soldier", 218349);

            this._professions.Add("adventurer", 218350);
            this._professions.Add("doctor", 218350);
            this._professions.Add("fixer", 218350);
            this._professions.Add("meta-physicist", 218350);
            this._professions.Add("trader", 218350);

            this._bot                  = bot;
            this._raffleTimer          = new Timer();
            this._raffleTimer.Interval = 1000;
            this._raffleTimer.Elapsed += new ElapsedEventHandler(OnRaffleTimer);
        }
示例#6
0
 public override void OnLoad(BotShell bot)
 {
     try { this._core = (RaidCore)bot.Plugins.GetPlugin("RaidCore"); }
     catch { throw new Exception("Unable to connect to 'Raid :: Core' Plugin!"); }
 }