Exemple #1
0
        public void run()
        {
            Console.WriteLine(c.name);

            bool goNxt     = true;
            bool firstFail = false;

            if (timer == null)
            {
                timer = new E7Timer(1000);
                timer.SetFunction(nxtTimer);
            }

            if (!timer.isStart)
            {
                for (int i = 0; i < c.lActions.Count; i++)
                {
                    goNxt = c.lActions[i].run();

                    if (!goNxt && !firstFail)
                    {
                        firstFail = true;
                    }
                }

                if (c.left != null)
                {
                    c.left.active = !firstFail;

                    if (c.right != null && !c.left.active)
                    {
                        for (int i = 0; i < c.rActions.Count; i++)
                        {
                            goNxt = c.rActions[i].run();
                            if (!goNxt)
                            {
                                break;
                            }
                        }

                        c.right.active = goNxt;
                    }
                }
            }

            if (!goNxt && c.click)
            {
                VirtualMouse.LeftClick();
            }


            if (goNxt)
            {
                if (!timer.isStart)
                {
                    timer.Start();
                }
            }
        }
Exemple #2
0
        public static void shutDownPc(Object source, ElapsedEventArgs e)
        {
            Console.Write("shutting down PC...");
            Profile shutdownCfg = SaveNLoad.deSerialize(Config.CFG_PATH + "ShutDownPc");

            shutdownCfg.actionBT.run();
            Thread.Sleep(2000);
            shutdownCfg.actionBT.run();
            E7Timer shutDown = new E7Timer(5000);

            shutDown.SetFunction(shutFct);
            shutDown.Start();
        }
Exemple #3
0
 private void Btn_OnClick(object sender, RoutedEventArgs e)
 {
     timerTest.Start();
     iterateThroughList(null, null);
     Config.shutDowntime.Start();
     //iterateThroughList(null, null);
     Config.actionBT.resetToRoot();
     i = 0;
     if (timerTest.isStart)
     {
         btn.Content = "Stop Bot";
     }
     else
     {
         btn.Content = "Start Bot";
     }
 }