示例#1
0
        public void DailyBot()
        {
            DailyDungeon[] bots = new DailyDungeon[EmulatorCount];
            for (int ind = EmulatorCount - 1; ind >= 0; ind--)
            {
                bots[ind] = new DailyDungeon(Emulators[ind]);
                Rectangle screen = Screen.GetRect(Emulators[ind]);
                User32.SetWindowPos(Emulators[ind].MainWindowHandle, 0, 0, 0, screen.Width, screen.Width, 1);
            }


            while (true)//replace with start stop button states
            {
                for (int ind = EmulatorCount - 1; ind >= 0; ind--)
                {
                    if (Emulators[ind].HasExited == true)
                    {
                        MainWindow.main.UpdateLog = Emulators[ind].MainWindowTitle + " has terminated. Please stop bot.";
                        return;
                    }
                    bots[ind].Start();
                }
            }
        }
示例#2
0
        public void DailyBot()
        {
            //Build Bot[]
            DailyDungeon[] bots = new DailyDungeon[0];

            //Builds Bot[] to for ADB clients
            if (L2RDevices != null)
            {
                bots = new DailyDungeon[L2RDevices.Length];

                for (int i = 0; i < bots.Length; i++)
                {
                    bots[i] = new DailyDungeon(NullEmulator, L2RDevices[i]);
                }
            }

            //Builds Bot[] to for ADB clients
            if (Emulators != null)
            {
                bots = new DailyDungeon[Emulators.Length];

                for (int i = 0; i < bots.Length; i++)
                {
                    bots[i] = new DailyDungeon(Emulators[i], NullL2RDev);
                }
            }

            foreach (DailyDungeon bot in bots)
            {
                //Checks if user deselected process to exclude from automation.
                foreach (ListBoxItem item in listProcessList.Items)
                {
                    bool isSelected = false;

                    string itemContent = "";

                    item.Dispatcher.Invoke(new Action(() => isSelected = item.IsSelected));

                    item.Dispatcher.Invoke(new Action(() => itemContent = item.Content.ToString()));

                    if (isSelected && itemContent == bot.BotName)
                    {
                        bot.Complete = true;
                    }
                }

                BotBuilder(bot);
            }


            while (true)//replace with start stop button states
            {
                for (int i = 0; i < bots.Length; i++)
                {
                    if (bots[i].Complete == false)
                    {
                        bots[i].Start();
                    }
                }
            }
        }