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