mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-11 19:48:21 +08:00
Fix: Avoid TooManyClickError when receiving lots of missions
This commit is contained in:
@@ -85,6 +85,8 @@ class Reward(UI):
|
||||
timeout = Timer(10)
|
||||
exit_timer.start()
|
||||
timeout.start()
|
||||
# Record received missions to clear click record
|
||||
clicked_mission = False
|
||||
|
||||
reward = False
|
||||
while 1:
|
||||
@@ -98,6 +100,11 @@ class Reward(UI):
|
||||
exit_timer.reset()
|
||||
timeout.reset()
|
||||
reward = True
|
||||
# MISSION_SINGLE -> GET_ITEMS_* means one mission reward received
|
||||
if clicked_mission:
|
||||
logger.info('Got items from mission')
|
||||
self.device.click_record_clear()
|
||||
clicked_mission = False
|
||||
continue
|
||||
|
||||
for button in [MISSION_MULTI, MISSION_SINGLE]:
|
||||
@@ -105,6 +112,7 @@ class Reward(UI):
|
||||
continue
|
||||
if self.match_template_color(button, offset=(20, 200), interval=interval):
|
||||
self.device.click(button)
|
||||
clicked_mission = True
|
||||
exit_timer.reset()
|
||||
click_timer.reset()
|
||||
timeout.reset()
|
||||
|
||||
Reference in New Issue
Block a user