diff --git a/game_functions.py b/game_functions.py index 9b96ed9..d82448e 100644 --- a/game_functions.py +++ b/game_functions.py @@ -13,11 +13,15 @@ def get_round() -> str: """Gets the current game round""" screen_capture = ImageGrab.grab(bbox=screen_coords.ROUND_POS.get_coords()) + round_three = screen_capture.crop(screen_coords.ROUND_POS_THREE.get_coords()) + game_round: str = ocr.get_text_from_image(image=round_three, whitelist=ocr.ROUND_WHITELIST) + if game_round in game_assets.ROUNDS: + return game_round + round_two = screen_capture.crop(screen_coords.ROUND_POS_TWO.get_coords()) game_round: str = ocr.get_text_from_image(image=round_two, whitelist=ocr.ROUND_WHITELIST) if game_round in game_assets.ROUNDS: return game_round - round_one = screen_capture.crop(screen_coords.ROUND_POS_ONE.get_coords()) game_round: str = ocr.get_text_from_image(image=round_one, whitelist=ocr.ROUND_WHITELIST) return game_round diff --git a/screen_coords.py b/screen_coords.py index 8d7a0b0..6c01f9d 100644 --- a/screen_coords.py +++ b/screen_coords.py @@ -32,11 +32,13 @@ [Vec2(457, 628), Vec4(GameWindow(559, 670, 797, 701))], ] -ROUND_POS: Vec4 = Vec4(GameWindow(767, 10, 870, 34)) +ROUND_POS: Vec4 = Vec4(GameWindow(753, 10, 870, 34)) -ROUND_POS_ONE: Vec4 = Vec4(GameWindow(2, 0, 42, 24), use_screen_offset=False) +ROUND_POS_ONE: Vec4 = Vec4(GameWindow(0, 0, 40, 24), use_screen_offset=False) -ROUND_POS_TWO: Vec4 = Vec4(GameWindow(57, 0, 96, 24), use_screen_offset=False) +ROUND_POS_TWO: Vec4 = Vec4(GameWindow(16, 0, 56, 24), use_screen_offset=False) + +ROUND_POS_THREE: Vec4 = Vec4(GameWindow(71, 0, 110, 24), use_screen_offset=False) SHOP_POS: Vec4 = Vec4(GameWindow(481, 1039, 1476, 1070))