1
0
mirror of https://gitee.com/sui-feng-cb/AzurLaneAutoScript1 synced 2026-03-12 10:58:21 +08:00

Fix: Avoid too_many_click exception caused by enhancement failure on in-battle ships (#4217)

This commit is contained in:
yulu901107
2024-09-29 12:13:50 +08:00
committed by GitHub
parent f45c21f250
commit 2bd90c8b4b

View File

@@ -220,9 +220,12 @@ class Enhancement(Dock):
if state == "state_enhance_check":
# Avoid too_many_click exception caused by multiple tries without material
if state_list[-2:] == ["state_enhance_recommend", "state_enhance_fail"]:
if len(self.device.click_record):
while self.device.click_record[-1] in ['ENHANCE_RECOMMEND', 'SHIP_SWIPE']:
self.device.click_record.pop()
while self.device.click_record and (self.device.click_record[-1] in ['ENHANCE_RECOMMEND', 'SHIP_SWIPE']):
self.device.click_record.pop()
# Avoid too_many_click exception caused by enhancement failure on in-battle ships
elif state_list[-3:] == ["state_enhance_attempt", "state_enhance_confirm", "state_enhance_fail"]:
while self.device.click_record and (self.device.click_record[-1] in ['ENHANCE_RECOMMEND', 'SHIP_SWIPE', 'ENHANCE_CONFIRM']):
self.device.click_record.pop()
state_list.clear()
state_list.append(state)
if len(state_list) > 30: