From 8e04b0da5211f0c5cab1d8d5e2c11654395c4ef8 Mon Sep 17 00:00:00 2001 From: Zebartin <16185081+Zebartin@users.noreply.github.com> Date: Mon, 20 May 2024 09:50:01 +0800 Subject: [PATCH] Fix: Color count for CHARACTER_x_SELECTED --- tasks/assignment/dispatch.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tasks/assignment/dispatch.py b/tasks/assignment/dispatch.py index 37acd7e12..fb818c569 100644 --- a/tasks/assignment/dispatch.py +++ b/tasks/assignment/dispatch.py @@ -105,11 +105,11 @@ class AssignmentDispatch(AssignmentUI): continue # Select if self.interval_is_reached(CHARACTER_1_SELECTED, interval=2): - if not self.image_color_count(CHARACTER_1_SELECTED, (240, 240, 240)): + if not self.image_color_count(CHARACTER_1_SELECTED, (240, 240, 240), threshold=221, count=160): self.device.click(CHARACTER_1) self.interval_reset(CHARACTER_1_SELECTED, interval=2) if self.interval_is_reached(CHARACTER_2_SELECTED, interval=2): - if not self.image_color_count(CHARACTER_2_SELECTED, (240, 240, 240)): + if not self.image_color_count(CHARACTER_2_SELECTED, (240, 240, 240), threshold=221, count=160): self.device.click(CHARACTER_2) self.interval_reset(CHARACTER_2_SELECTED, interval=2) @@ -126,7 +126,8 @@ class AssignmentDispatch(AssignmentUI): # End if self.appear(CONFIRM_ASSIGNMENT): if self.image_color_count(CONFIRM_ASSIGNMENT.button, color=(227, 227, 227), count=1000): - logger.info('Characters are all selected (light button)') + logger.info( + 'Characters are all selected (light button)') break if self.appear(CHARACTER_LIST, interval=2): # EMPTY_SLOT appeared above