diff --git a/fruit.py b/fruit.py index 366182b..20f9d84 100644 --- a/fruit.py +++ b/fruit.py @@ -49,7 +49,9 @@ class Fruit(GameBase): self.reset_counter += 1 if self.reset_counter == 1: pass - elif self.reset_counter >= 2: + elif self.reset_counter == 2: + pass + elif self.reset_counter >= 3: screenshot = self.capture_window.get_screenshot() if self.check_for_button_and_execute(screenshot, self.reset_board): cv.waitKey(500) @@ -73,16 +75,10 @@ class Fruit(GameBase): # gray = cv.cvtColor(screenshot, cv.COLOR_BGR2GRAY) # thresh = cv.threshold(gray, 0, 255, cv.THRESH_BINARY_INV + cv.THRESH_OTSU)[1] - if self.check_for_button_and_execute(screenshot, self.ok_button): + if self.check_for_button_and_execute(screenshot, self.ok_button, 540, 180): cv.waitKey(500) - screenshot = self.capture_window.get_screenshot() - if self.check_for_button_and_execute(screenshot, self.reset_board): - cv.waitKey(500) - screenshot = self.capture_window.get_screenshot() - if self.check_for_button_and_execute(screenshot, self.reset_confirm): - cv.waitKey(500) - screenshot = self.capture_window.get_screenshot() + screenshot = self.capture_window.get_screenshot() screenshot = screenshot[180:1030, 540:1870] # cv.imshow("screenshot", screenshot) # cv.waitKey(150)