Exemplo n.º 1
0
        public void WeeklyBot()
        {
            Weekly[] bots = new Weekly[EmulatorCount];
            for (int ind = EmulatorCount - 1; ind >= 0; ind--)
            {
                bots[ind] = new Weekly(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;
                    }

                    if (bots[ind].Complete == false)
                    {
                        bots[ind].Start();
                    }
                }
            }
        }
Exemplo n.º 2
0
        public void WeeklyBot()
        {
            //Build Bot[]
            Weekly[] bots = new Weekly[0];

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

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

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

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

            foreach (Weekly 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();
                    }
                }
            }
        }