示例#1
0
        private void LoadButton_Click(object sender, RoutedEventArgs e)
        {
            this.Hide();
            GameObjects options = LoadOptions.LoadObjects(" ");
            Rooms       room    = GameOptions.MakeRoom(options.Rooms, options.Player.RoomID);

            SearchCommands.ViewRoom(room.Name);

            GeneralCommands.CommandInput(options);
        }
示例#2
0
        public CommandSource(CommandsHandler handler, BotLog log)
        {
            this._Utils    = new UtilsCommands();
            this._Social   = new SocialCommands();
            this._NSFW     = new NSFWCommands();
            this._Search   = new SearchCommands();
            this._Image    = new ImageCommands();
            this._Fun      = new FunCommands();
            this._Warframe = new WarframeCommands();

            Setup(handler, log);
        }
示例#3
0
        public void RunSearchProcessOnExecuted(object sender, ExecutedRoutedEventArgs e)
        {
            var i = SearchCommands.IndexOf(e.Command as RoutedUICommand);

            if (i < 0 || i > SearchAlgorithms.Count)
            {
                MessageBox.Show("No Search Process found for " + e.Command);
            }
            else
            {
                addAndShowSearchController(new searchProcessController(SearchAlgorithms[i],
                                                                       windowsMgr.SearchProcessID),
                                           (GSApp.settings.SearchControllerPlayOnStart || SearchAlgorithms[i].AutoPlay));
            }
        }
示例#4
0
        private void NewButton_Click(object sender, RoutedEventArgs e)
        {
            this.Hide();
            Player player = GameOptions.NewPlayer();

            GameOptions.CreateUserOptions(player.Name);
            GameObjects options = LoadOptions.InitializeObjects(player);

            MessageBox.Show(StandardMessages.TitleCard());

            Rooms room = GameOptions.MakeRoom(options.Rooms, options.Player.RoomID);

            SearchCommands.ViewRoom(room.Name);

            GeneralCommands.CommandInput(options);
        }
示例#5
0
        public void RunSearchProcessCanExecute(object sender, CanExecuteRoutedEventArgs e)
        {
            var i = SearchCommands.IndexOf(e.Command as RoutedUICommand);

            if (i < 0 || i > SearchAlgorithms.Count)
            {
                e.CanExecute = false;
            }
            else
            {
                var s           = SearchAlgorithms[i];
                var numRuleSets = 0;
                while ((numRuleSets < GSApp.settings.rulesets.GetLength(0)) &&
                       (GSApp.settings.rulesets[numRuleSets] != null))
                {
                    numRuleSets++;
                }
                e.CanExecute = ((!s.RequireSeed || (s.RequireSeed && GSApp.settings.seed != null)) &&
                                (s.RequiredNumRuleSets <= numRuleSets));
            }
        }
示例#6
0
        public ClasherDynBot()
        {
            rand    = new Random();
            discord = new DiscordClient(x =>
            {
                x.LogLevel   = LogSeverity.Info;
                x.LogHandler = Log;
            });

            discord.UsingCommands(x =>
            {
                x.PrefixChar         = '!';
                x.AllowMentionPrefix = true;
            });

            commands = discord.GetService <CommandService>();

            #region register command groups
            HelpCommands.RegisterHelpCommands(commands, discord);
            FunCommands.RegisterFunCommands(commands, discord);
            SettingCommands.RegisterWebsiteCommands(commands, discord);
            SearchCommands.RegisterSearchCommands(commands, discord);
            AttendanceCommands.RegisterAttendanceCommands(commands, discord);
            WarningCommands.RegisterWarningCommands(commands, discord);
            EnemyNoteCommands.RegisterEnemyNoteCommands(commands, discord);
            WarCommands.RegisterWarCommands(commands, discord);
            AdminCommands.RegisterAdminCommands(commands, discord);
            #endregion

            discord.ExecuteAndWait(async() =>
            {
                string key = ConfigurationManager.AppSettings["Key"];
                await discord.Connect(key, Discord.TokenType.Bot);
                //auto start notifications
                await StartNotifications();
            });
        }