Beispiel #1
0
        private void MainBotLoop()
        {
            var main = new MainRoutine(GameState);
            ScreenReader.DetectSide(GameState);
            main.Root.Start(GameState);

            while (true)
                if (!MainWindow.IsPaused)
                {
                    counterCallsPerSecond++;
                    try
                    {
                        var tack = main.Root.Tick(GameState);
                        if (tack != RunStatus.Running)
                        {
                            main.Root.Stop(GameState);

                            main.Root.Start(GameState);
                        }
                        Thread.Sleep(50);
                    }
                    catch (Exception e)
                    {
                    }
                }
                else
                {
                    Thread.Sleep(1000);
                }
        }
 public MainWindow()
 {
     var main = new MainRoutine(null);
     TreeDebug td = new TreeDebug();
     td.AnalyzeComposite(main.Root, null);
     td.ShowDialog();
     InitializeComponent();
     Instance = this;
     keyboardHook = new KeyboardHook();
     keyboardHook.RegisterHotKey(0, Keys.F1);
     keyboardHook.KeyPressed += KeyboardHook_KeyPressed;
     IsPaused = false;
     var myTimer = new Timer();
     myTimer.Elapsed += DisplayTimeEvent;
     myTimer.Interval = 1000; // 1000 ms is one second
     myTimer.Start();
     ControlInput.SetupHeroesWindow();
 }