0
0
mirror of https://github.com/ok-oldking/ok-wuthering-waves.git synced 2025-06-05 08:25:28 +00:00

refactor: use walk_until_f

This commit is contained in:
Small_Ku 2024-08-18 01:52:47 +08:00
parent 4c0786b38f
commit 3eb423fb35
No known key found for this signature in database
GPG Key ID: 7EFEA1416F80E3AC

View File

@ -192,12 +192,8 @@ class BaseWWTask(BaseTask, FindFeature, OCR):
highest_index = 0
threshold = 0.02
for i in range(4):
if self.find_f_with_text(target_text=self.absorb_echo_text):
self.send_key('f')
if not self.handle_claim_button():
logger.debug(f'farm echo found echo before turn and find')
self.sleep(0.5)
return True
if self.walk_until_f(target_text=self.absorb_echo_text(), raise_if_not_found=False):
return True
self.middle_click_relative(0.5, 0.5, down_time=0.2)
self.sleep(1)
color_percent = self.calculate_color_percentage(echo_color, box)