From 45355e7f5922ecb3fd25d8ed30dbc66a9a7c9864 Mon Sep 17 00:00:00 2001 From: Enterly <36875936+anthony5301@users.noreply.github.com> Date: Tue, 26 Mar 2024 22:08:11 +0800 Subject: [PATCH] encounter round shop delay and choose items popup --- arena.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/arena.py b/arena.py index 5b7ccaa..1aeb387 100644 --- a/arena.py +++ b/arena.py @@ -62,6 +62,9 @@ def fix_bench_state(self) -> None: ) self.champs_to_buy[champ_name] -= 1 else: + print( + f" The unknown champion {champ_name} not exists in comps, seeling it." + ) self.bench[index] = "?" continue if isinstance(slot, str) and not bench_occupied[index]: @@ -360,6 +363,25 @@ def spend_gold(self, speedy=False) -> None: print(" Rerolling shop") shop: list = arena_functions.get_shop() print(f" Shop: {shop}") + + # For set 11 encounter round shop delay and choose items popup + if shop == [(1,""), (2,""), (3,""), (4,""), (5,"")]: + if speedy: + return + sleep(10) + anvil_msg: str = ocr.get_text( + screenxy=screen_coords.ANVIL_MSG_POS.get_coords(), + scale=3, + psm=7, + whitelist=ocr.ALPHABET_WHITELIST, + ) + if anvil_msg == "ChooseOne": + print(" Choosing item") + mk_functions.left_click(screen_coords.BUY_LOC[2].get_coords()) + sleep(1) + self.spend_gold(True) + return + for champion in shop: if ( self.champs_to_buy.get(champion[1], -1) >= 0