Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
anthony5301 authored Apr 5, 2024
1 parent fa12fe0 commit 36547aa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions game.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def callback(self, hwnd, extra) -> None: # pylint: disable=unused-argument
def loading_screen(self) -> None:
"""Loop that runs while the game is in the loading screen"""
game_functions.default_pos()
while game_functions.get_round()[0] != "1-1":
while game_functions.get_round() != "1-1":
if self.check_failed_to_connect_window():
return
sleep(1)
Expand Down Expand Up @@ -107,7 +107,7 @@ def game_loop(self) -> None:
break
last_game_health = game_health

self.round, self.round_from = game_functions.get_round()
self.round = game_functions.get_round()

if (
settings.FORFEIT
Expand Down
8 changes: 4 additions & 4 deletions game_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,21 @@
import mk_functions


def get_round() -> tuple[str, int]:
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, 3
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, 2
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, 1
return game_round


def pickup_items() -> None: # Refacor this function to make it more clear whats happening
Expand Down

0 comments on commit 36547aa

Please sign in to comment.