added fruit game support

This commit is contained in:
2022-10-31 16:24:21 +01:00
parent 9931b9804e
commit 52e3fd001a

View File

@@ -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)