public void CheckRefill() { if (NeedRefill()) { Debug.WriteLine("Perform refill"); Emulator.Click(RunnerConfig.OpenShopPoint); Helper.Sleep(2000, 3000); Emulator.Click(RunnerConfig.BuyEnergyWithCrystalPoint); Helper.Sleep(1000, 2000); string pattern = TryGetQuizPattern(); if (!string.IsNullOrEmpty(pattern)) { while (!string.IsNullOrEmpty(pattern)) { Debug.Write("Try to solve: " + pattern); QuizSolver.SolveQuiz(Emulator); Thread.Sleep(3000); Emulator.PressEsc(); Thread.Sleep(1000); pattern = TryGetQuizPattern(); } } Emulator.Click(RunnerConfig.ConfirmBuyPoint); Helper.Sleep(8000, 10000); Emulator.Click(RunnerConfig.BuyOKPoint); Helper.Sleep(1500, 2000); Emulator.Click(RunnerConfig.CloseShopPoint); Helper.Sleep(1500, 2000); Emulator.Click(RunnerConfig.ReplayPoint); } Debug.WriteLine("No need to refill"); }
public void TestQuiz() { NoxEmulator emulator = new NoxEmulator(); QuizSolver.SolveQuiz(emulator); }