private void CheckRunning() { lostRuningCount = 0; while (running) { //Console.WriteLine("check run"); if (!bh3window.IsFighting()) { //Console.WriteLine("not run"); if (lostRuningCount >= 1) { currentScript.Stop(); currentScript.ReleaseKeyup(); //Console.WriteLine("丢失"); ScriptStopEvent(); //while (!currentScript.running) ; } lostRuningCount += 1; } else { //Console.WriteLine("run"); lostRuningCount = 0; } Thread.Sleep(1000); } }
private void CheckRunning() { lostRuningCount = 0; while (running) { if (!bh3window.IsFighting()) { if (lostRuningCount >= 2) { currentScript.Stop(); currentScript.ReleaseKeyup(); Console.WriteLine("丢失"); Thread.Sleep(2000); } lostRuningCount += 1; } else { lostRuningCount = 0; } Thread.Sleep(1000); } }