From 90b7177273ebdaaa9167981939144d676019f878 Mon Sep 17 00:00:00 2001 From: Thaloria Date: Mon, 31 Oct 2022 16:29:41 +0100 Subject: [PATCH] added fruit game support --- fruit.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fruit.py b/fruit.py index 20f9d84..9fd0ecb 100644 --- a/fruit.py +++ b/fruit.py @@ -71,11 +71,12 @@ class Fruit(GameBase): def get_current_board_state(self): # get an updated image of the game screenshot = self.capture_window.get_screenshot() + screenshot = screenshot[900:1100, 1100:1450] # screenshot = cv.imread("field_farm.jpg") # 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, 540, 180): + if self.check_for_button_and_execute(screenshot, self.ok_button, 900, 1100): cv.waitKey(500) screenshot = self.capture_window.get_screenshot()