Skip to content

Commit

Permalink
making SAVE_FIGHT_IMAGES a toggle, disabling saving fight images
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewmiglio committed Apr 18, 2024
1 parent 0f5a571 commit 3a78f16
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/pyclashbot/bot/do_fight_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@
get_first_location,
)



SAVE_FIGHT_IMAGES = False
yolo_images_save_path = r"C:\My Files\my Programs\clash_fight_images"

CLOSE_BATTLE_LOG_BUTTON: tuple[Literal[365], Literal[72]] = (365, 72)
Expand Down Expand Up @@ -954,7 +957,8 @@ def _2v2_fight_loop(vm_index: int, logger: Logger):
random_elixer_wait_count = random.randint(3, 7)

wait_output = wait_for_elixer(vm_index, logger, random_elixer_wait_count)
save_fight_image(vm_index)
if SAVE_FIGHT_IMAGES:
save_fight_image(vm_index)

if wait_output == "restart":
logger.change_status("Failure while waiting for elixer")
Expand Down Expand Up @@ -1035,8 +1039,8 @@ def _1v1_fight_loop(vm_index, logger: Logger) -> Literal["restart", "good"]:
# wait for 6 elixer
random_elixer_wait = random.randint(3, 7)
elixer_wait_return = wait_for_elixer(vm_index, logger, random_elixer_wait)
save_fight_image(vm_index)

if SAVE_FIGHT_IMAGES:
save_fight_image(vm_index)
#if a failure during elixer wait
if elixer_wait_return == "restart":
logger.change_status(
Expand Down

0 comments on commit 3a78f16

Please sign in to comment.