コード例 #1
0
ファイル: raffle.cs プロジェクト: jerpdoesgames/TwitchJerpBot
        public raffle(jerpBot aJerpBot) : base(aJerpBot, true, true, false)
        {
            m_Throttler                     = new throttler(aJerpBot);
            m_Throttler.waitTimeMax         = 15000;
            m_Throttler.lineCountMinimum    = 8;
            m_Throttler.messagesReduceTimer = false;

            userList           = new Dictionary <string, userEntry>();
            usersAddedRecently = new List <userEntry>();

            load();

            chatCommandDef tempDef = new chatCommandDef("raffle", addUser, true, true);

            tempDef.addSubCommand(new chatCommandDef("open", open, true, false));
            tempDef.addSubCommand(new chatCommandDef("close", close, true, false));
            tempDef.addSubCommand(new chatCommandDef("clear", reset, true, false));
            tempDef.addSubCommand(new chatCommandDef("draw", draw, true, false));
            tempDef.addSubCommand(new chatCommandDef("count", count, true, false));
            tempDef.addSubCommand(new chatCommandDef("describe", describe, true, false));
            tempDef.addSubCommand(new chatCommandDef("about", about, true, true));
            tempDef.addSubCommand(new chatCommandDef("useredemptions", toggleUseRedemptions, false, false));
            tempDef.useGlobalCooldown = false;
            m_BotBrain.addChatCommand(tempDef);
        }
コード例 #2
0
        public counter(jerpBot aJerpBot) : base(aJerpBot, true, true, false)
        {
            string        createCounterTableQuery   = "CREATE TABLE IF NOT EXISTS counters (counterID INTEGER PRIMARY KEY ASC, name TEXT, game TEXT, description TEXT, count INTEGER, UNIQUE(name, game))";
            SQLiteCommand createCounterTableCommand = new SQLiteCommand(createCounterTableQuery, m_BotBrain.storageDB);

            createCounterTableCommand.ExecuteNonQuery();

            m_Entries = new Dictionary <string, Dictionary <string, counterEntry> >();
            checkInitializeList(GAME_NOGAME);

            chatCommandDef tempDef;

            tempDef = new chatCommandDef("count", display, true, true);
            tempDef.addSubCommand(new chatCommandDef("add", add, true, false));
            tempDef.addSubCommand(new chatCommandDef("remove", remove, true, false));
            tempDef.addSubCommand(new chatCommandDef("delete", delete, true, false));
            tempDef.addSubCommand(new chatCommandDef("describe", describe, true, false));
            tempDef.addSubCommand(new chatCommandDef("set", set, true, false));
            tempDef.addSubCommand(new chatCommandDef("forcegame", forceGame, true, false));
            tempDef.addSubCommand(new chatCommandDef("cleargame", clearGame, true, false));
            tempDef.addSubCommand(new chatCommandDef("setowner", setOwner, false, false));
            tempDef.addSubCommand(new chatCommandDef("clearowner", clearOwner, false, false));
            tempDef.addSubCommand(new chatCommandDef("about", about, true, true));
            tempDef.addSubCommand(new chatCommandDef("outputlist", outputList, false, false));
            m_BotBrain.addChatCommand(tempDef);
        }
コード例 #3
0
        public commandAlias(jerpBot botGeneral) : base(botGeneral)
        {
            chatCommandDef tempDef = new chatCommandDef("alias", null, false, false);

            tempDef.addSubCommand(new chatCommandDef("add", add, false, false));
            tempDef.addSubCommand(new chatCommandDef("remove", remove, false, false));
            tempDef.addSubCommand(new chatCommandDef("outputlist", outputList, false, false));
            m_BotBrain.addChatCommand(tempDef);
        }
コード例 #4
0
        public predictionManager(jerpBot aJerpBot) : base(aJerpBot, true, true, false)
        {
            chatCommandDef tempDef = new chatCommandDef("prediction", null, false, false);

            tempDef.addSubCommand(new chatCommandDef("last", displayLast, true, true));
            tempDef.addSubCommand(new chatCommandDef("create", create, true, false));
            tempDef.addSubCommand(new chatCommandDef("close", close, true, false));
            tempDef.addSubCommand(new chatCommandDef("cancel", cancel, true, false));
            tempDef.addSubCommand(new chatCommandDef("decide", decide, true, false));
            m_BotBrain.addChatCommand(tempDef);
        }
コード例 #5
0
        public delaySender(jerpBot aJerpBot) : base(aJerpBot, true, true, false)
        {
            m_Entries = new List <delaySendEntry>();

            chatCommandDef tempDef = new chatCommandDef("delay", addEntry, true, false);

            tempDef.addSubCommand(new chatCommandDef("purge", purgeEntries, false, false));
            tempDef.addSubCommand(new chatCommandDef("count", getCount, false, false));
            tempDef.useGlobalCooldown = false;
            m_BotBrain.addChatCommand(tempDef);
        }
コード例 #6
0
        public hostMessages(jerpBot aJerpBot) : base(aJerpBot, true, true, false)
        {
            m_IsLoaded = loadConfig();

            if (m_IsLoaded)
            {
                chatCommandDef tempDef = new chatCommandDef("hostmessages", null, true, true);
                tempDef.addSubCommand(new chatCommandDef("reload", reloadMessages, false, false));

                m_BotBrain.addChatCommand(tempDef);
            }
        }
コード例 #7
0
        // TODO: variant that applies properties before creating table
        public gameCommand(jerpBot botGeneral) : base(botGeneral)
        {
            formatHint = m_BotBrain.localizer.getString("commandGameFormatHint");
            chatCommandDef tempDef = new chatCommandDef("gamecommand", null, false, false);

            tempDef.addSubCommand(new chatCommandDef("add", add, true, false));
            tempDef.addSubCommand(new chatCommandDef("remove", remove, true, false));
            tempDef.addSubCommand(new chatCommandDef("setgame", setGame, true, false));
            tempDef.addSubCommand(new chatCommandDef("cleargame", clearGame, true, false));
            tempDef.addSubCommand(new chatCommandDef("outputlist", outputList, false, false));
            m_BotBrain.addChatCommand(tempDef);
        }
コード例 #8
0
        public hydrateReminder(jerpBot aJerpBot) : base(aJerpBot, true, true, false)
        {
            m_Throttler = new throttler(aJerpBot);
            m_Throttler.requiresUserMessages = false;
            m_Throttler.messagesReduceTimer  = false;
            m_Throttler.waitTimeMax          = 30000;
            chatCommandDef tempDef = new chatCommandDef("hydrate", null, false, false);

            tempDef.addSubCommand(new chatCommandDef("current", current, true, true));
            tempDef.addSubCommand(new chatCommandDef("offset", setOffset, false, false));

            m_BotBrain.addChatCommand(tempDef);
        }
コード例 #9
0
        public messageRoll(jerpBot aJerpBot) : base(aJerpBot, true, true, false)
        {
            if (loadConfig())
            {
                m_Loaded = true;

                m_Throttler                       = new throttler(aJerpBot);
                m_Throttler.waitTimeMax           = 900000;
                m_Throttler.lineCountReduction    = 23333;
                m_Throttler.lineCountReductionMax = 30;

                chatCommandDef tempDef = new chatCommandDef("message", null, false, false);
                tempDef.addSubCommand(new chatCommandDef("next", forceNext, false, false));

                m_BotBrain.addChatCommand(tempDef);
            }
        }
コード例 #10
0
ファイル: quotes.cs プロジェクト: jerpdoesgames/TwitchJerpBot
        public quotes(jerpBot aJerpBot) : base(aJerpBot, true, true, false)
        {
            string        createQuoteTableQuery   = "CREATE TABLE IF NOT EXISTS quotes (quoteID INTEGER PRIMARY KEY ASC, submitter TEXT, message TEXT, game TEXT)";
            SQLiteCommand createQuoteTableCommand = new SQLiteCommand(createQuoteTableQuery, m_BotBrain.storageDB);

            createQuoteTableCommand.ExecuteNonQuery();

            chatCommandDef tempDef = new chatCommandDef("quote", display, true, true);

            tempDef.addSubCommand(new chatCommandDef("add", add, true, false));
            tempDef.addSubCommand(new chatCommandDef("remove", remove, true, false));
            tempDef.addSubCommand(new chatCommandDef("edit", edit, true, false));
            tempDef.addSubCommand(new chatCommandDef("setgame", setGame, true, false));
            tempDef.addSubCommand(new chatCommandDef("outputlist", outputList, false, false));
            // TODO: Add command to return total number of quotes.
            m_BotBrain.addChatCommand(tempDef);
        }
コード例 #11
0
        public soundCommands(jerpBot aJerpBot) : base(aJerpBot, true, true, false)
        {
            if (loadSounds())
            {
                isEnabled = m_Config.enabled;

                chatCommandDef tempDef = new chatCommandDef("sound", playSound, true, true);
                tempDef.addSubCommand(new chatCommandDef("volume", setVolume, false, false));
                tempDef.addSubCommand(new chatCommandDef("list", getList, true, true));
                tempDef.addSubCommand(new chatCommandDef("enable", enable, true, false));
                tempDef.addSubCommand(new chatCommandDef("disable", disable, true, false));
                tempDef.addSubCommand(new chatCommandDef("reload", reloadSounds, false, false));
                tempDef.addSubCommand(new chatCommandDef("random", playRandom, true, true));
                tempDef.addSubCommand(new chatCommandDef("getdevices", getDeviceList, false, false));
                tempDef.addSubCommand(new chatCommandDef("setdevice", setDevice, false, false));

                m_BotBrain.addChatCommand(tempDef);
                m_OutputEvent = new WaveOutEvent();
            }
        }
コード例 #12
0
        public trivia(jerpBot aJerpBot) : base(aJerpBot, true, true, false)
        {
            m_Throttler                       = new throttler(aJerpBot);
            m_Throttler.waitTimeMax           = 120000;
            m_Throttler.lineCountReductionMax = 15;
            m_Throttler.lineCountReduction    = 4000;

            m_LoadSuccessful = load();
            m_Scores         = new Dictionary <userEntry, int>();
            m_Questions      = new List <triviaQuestion>();

            chatCommandDef tempDef = new chatCommandDef("trivia", null, true, true);

            tempDef.addSubCommand(new chatCommandDef("start", start, false, false));
            tempDef.addSubCommand(new chatCommandDef("stop", stop, true, false));
            tempDef.addSubCommand(new chatCommandDef("scores", scores, true, true));
            tempDef.addSubCommand(new chatCommandDef("topics", topics, true, true));
            tempDef.addSubCommand(new chatCommandDef("setmax", setMaxQuestions, true, true));
            tempDef.addSubCommand(new chatCommandDef("reload", reload, false, false));
            tempDef.useGlobalCooldown = false;
            m_BotBrain.addChatCommand(tempDef);
        }
コード例 #13
0
        public pollManager(jerpBot aJerpBot) : base(aJerpBot, true, true, false)
        {
            m_Throttler                  = new throttler(aJerpBot);
            m_Throttler.waitTimeMax      = 30000;
            m_Throttler.lineCountMinimum = 8;

            userChoices = new Dictionary <userEntry, int>();

            chatCommandDef tempDef = new chatCommandDef("poll", null, false, false);

            tempDef.addSubCommand(new chatCommandDef("open", open, true, false));
            tempDef.addSubCommand(new chatCommandDef("close", close, true, false));
            tempDef.addSubCommand(new chatCommandDef("about", about, true, true));
            tempDef.addSubCommand(new chatCommandDef("describe", describe, true, false));
            tempDef.addSubCommand(new chatCommandDef("count", count, true, false));
            tempDef.addSubCommand(new chatCommandDef("results", results, true, false));
            tempDef.addSubCommand(new chatCommandDef("choices", choices, true, false));
            m_BotBrain.addChatCommand(tempDef);

            tempDef = new chatCommandDef("vote", vote, true, true);
            tempDef.useGlobalCooldown = false;
            m_BotBrain.addChatCommand(tempDef);
        }
コード例 #14
0
        public streamProfiles(jerpBot aJerpBot) : base(aJerpBot, true, true, false)
        {
            string configPath = System.IO.Path.Combine(jerpBot.storagePath, "config\\jerpdoesbots_streamprofiles.json");

            if (File.Exists(configPath))
            {
                string configFileString = File.ReadAllText(configPath);
                if (!string.IsNullOrEmpty(configFileString))
                {
                    configData = new JavaScriptSerializer().Deserialize <streamProfilesConfig>(configFileString);
                    loaded     = true;
                }
            }

            if (loaded)
            {
                chatCommandDef tempDef = new chatCommandDef("profile", null, false, false);
                tempDef.addSubCommand(new chatCommandDef("apply", applyProfile, false, false));
                tempDef.addSubCommand(new chatCommandDef("setrewards", applyRewardGroup, false, false));

                m_BotBrain.addChatCommand(tempDef);
            }
        }
コード例 #15
0
 public void addSubCommand(chatCommandDef newSub)
 {
     newSub.m_ParentCommand = this;
     m_SubCommands.Add(newSub);
 }