mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-09 18:39:04 +08:00
Fix: handle island level up in project
This commit is contained in:
parent
1a6cb6bc66
commit
cc1d411994
@ -324,6 +324,7 @@ class IslandProjectRun(IslandUI):
|
||||
GET_ITEMS_ISLAND, ROLE_SELECT_ENTER])
|
||||
success = False
|
||||
enter = True
|
||||
click_timer = Timer(5, count=10)
|
||||
timeout = Timer(3, count=6).start()
|
||||
while 1:
|
||||
if skip_first_screenshot:
|
||||
@ -355,6 +356,7 @@ class IslandProjectRun(IslandUI):
|
||||
enter = False
|
||||
self.interval_clear(GET_ITEMS_ISLAND)
|
||||
self.interval_reset(ROLE_SELECT_ENTER)
|
||||
click_timer.reset()
|
||||
timeout.reset()
|
||||
continue
|
||||
|
||||
@ -364,6 +366,13 @@ class IslandProjectRun(IslandUI):
|
||||
timeout.reset()
|
||||
continue
|
||||
|
||||
# handle island level up
|
||||
if click_timer.reached():
|
||||
self.device.click(GET_ITEMS_ISLAND)
|
||||
self.device.sleep(0.3)
|
||||
click_timer.reset()
|
||||
continue
|
||||
|
||||
if self.appear(ROLE_SELECT_CONFIRM, offset=(20, 20)):
|
||||
break
|
||||
if timeout.reached():
|
||||
|
||||
@ -288,7 +288,7 @@ class IslandTransportRun(IslandUI):
|
||||
self.device.click_record_clear()
|
||||
self.interval_clear([GET_ITEMS_ISLAND, TRANSPORT_RECEIVE, POPUP_CANCEL_WHITE])
|
||||
success = True
|
||||
click_timer = Timer(5)
|
||||
click_timer = Timer(5, count=10)
|
||||
confirm_timer = Timer(1, count=2).start()
|
||||
while 1:
|
||||
if skip_first_screenshot:
|
||||
@ -302,6 +302,7 @@ class IslandTransportRun(IslandUI):
|
||||
|
||||
if self.appear_then_click(TRANSPORT_RECEIVE, offset=(-20, -20, 20, 400), interval=2):
|
||||
success = False
|
||||
click_timer.reset()
|
||||
confirm_timer.reset()
|
||||
continue
|
||||
|
||||
@ -314,18 +315,19 @@ class IslandTransportRun(IslandUI):
|
||||
confirm_timer.reset()
|
||||
continue
|
||||
|
||||
if self.island_in_transport():
|
||||
if success and confirm_timer.reached():
|
||||
break
|
||||
else:
|
||||
confirm_timer.reset()
|
||||
|
||||
# handle island level up
|
||||
if click_timer.reached():
|
||||
success = True
|
||||
self.device.click(GET_ITEMS_ISLAND)
|
||||
self.device.sleep(0.3)
|
||||
click_timer.reset()
|
||||
continue
|
||||
|
||||
if self.island_in_transport():
|
||||
if success and confirm_timer.reached():
|
||||
break
|
||||
else:
|
||||
confirm_timer.reset()
|
||||
|
||||
return success
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user