Skip to content

Commit

Permalink
Add encounter round coords
Browse files Browse the repository at this point in the history
Add encounter round coords
  • Loading branch information
anthony5301 authored Mar 23, 2024
2 parents 4f4134b + aea00ae commit de0a26b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
6 changes: 5 additions & 1 deletion game_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 5 additions & 3 deletions screen_coords.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down

0 comments on commit de0a26b

Please sign in to comment.