Beispiel #1
0
        public void ScrollBot()
        {
            Scroll[] bots = new Scroll[EmulatorCount];
            for (int ind = EmulatorCount - 1; ind >= 0; ind--)
            {
                bots[ind] = new Scroll(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();
                }
            }
        }
Beispiel #2
0
        public void ScrollBot()
        {
            //Build Bot[]
            Scroll[] bots = new Scroll[0];

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

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

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

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

            foreach (Scroll 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++)
                {
                    #region Scroll_CheckBox_Logic
                    //Reset CheckBox
                    bool?isResetChecked = null;

                    ScrollReset.Dispatcher.Invoke(new Action(() =>
                    {
                        isResetChecked = ScrollReset.IsChecked;
                    }), DispatcherPriority.Normal);

                    if ((bool)isResetChecked)
                    {
                        bots[i].Reset = true;
                    }

                    //ScrollS CheckBox
                    bool?isScrollSChecked = null;

                    ScrollReset.Dispatcher.Invoke(new Action(() =>
                    {
                        isScrollSChecked = ScrollS.IsChecked;
                    }), DispatcherPriority.Normal);

                    if ((bool)isScrollSChecked)
                    {
                        bots[i].Preference.Add(Grade.S);
                    }

                    //ScrollA Checkbox
                    bool?isScrollAChecked = null;

                    ScrollReset.Dispatcher.Invoke(new Action(() =>
                    {
                        isScrollAChecked = ScrollA.IsChecked;
                    }), DispatcherPriority.Normal);

                    if ((bool)isScrollAChecked)
                    {
                        bots[i].Preference.Add(Grade.A);
                    }

                    //ScrollB CheckBox
                    bool?isScrollBChecked = null;

                    ScrollReset.Dispatcher.Invoke(new Action(() =>
                    {
                        isScrollBChecked = ScrollB.IsChecked;
                    }), DispatcherPriority.Normal);

                    if ((bool)isScrollBChecked)
                    {
                        bots[i].Preference.Add(Grade.B);
                    }

                    //ScrollC CheckBox
                    bool?isScrollCChecked = null;

                    ScrollReset.Dispatcher.Invoke(new Action(() =>
                    {
                        isScrollCChecked = ScrollC.IsChecked;
                    }), DispatcherPriority.Normal);

                    if ((bool)isScrollCChecked)
                    {
                        bots[i].Preference.Add(Grade.C);
                    }
                    #endregion

                    if (bots[i].Complete == false)
                    {
                        bots[i].Start();
                    }
                }
            }
        }