mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-17 23:51:30 +08:00
Fix: Failed to find night commissions and convert to running if commission not found
This commit is contained in:
@@ -254,15 +254,18 @@ class RewardCommission(UI, InfoHandler):
|
|||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def _commission_find_and_start(self, comm):
|
def _commission_find_and_start(self, comm, is_urgent=False):
|
||||||
"""
|
"""
|
||||||
Args:
|
Args:
|
||||||
comm (Commission):
|
comm (Commission):
|
||||||
|
is_urgent (bool):
|
||||||
"""
|
"""
|
||||||
logger.hr('Commission find and start')
|
logger.hr('Commission find and start')
|
||||||
logger.info(f'Finding commission {comm}')
|
logger.info(f'Finding commission {comm}')
|
||||||
for _ in range(15):
|
for _ in range(15):
|
||||||
new = self._commission_detect(self.device.image)
|
new = self._commission_detect(self.device.image)
|
||||||
|
if is_urgent:
|
||||||
|
new.call('convert_to_night') # Convert extra commission to night
|
||||||
if comm in new:
|
if comm in new:
|
||||||
# Update commission position.
|
# Update commission position.
|
||||||
# In different scans, they have the same information, but have different locations.
|
# In different scans, they have the same information, but have different locations.
|
||||||
@@ -295,16 +298,16 @@ class RewardCommission(UI, InfoHandler):
|
|||||||
self._commission_ensure_mode('daily')
|
self._commission_ensure_mode('daily')
|
||||||
self._commission_swipe_to_top()
|
self._commission_swipe_to_top()
|
||||||
self.handle_info_bar()
|
self.handle_info_bar()
|
||||||
self._commission_find_and_start(comm)
|
if self._commission_find_and_start(comm, is_urgent=False):
|
||||||
comm.convert_to_running()
|
comm.convert_to_running()
|
||||||
self._commission_mode_reset()
|
self._commission_mode_reset()
|
||||||
if self.urgent_choose:
|
if self.urgent_choose:
|
||||||
for comm in self.urgent_choose:
|
for comm in self.urgent_choose:
|
||||||
self._commission_ensure_mode('urgent')
|
self._commission_ensure_mode('urgent')
|
||||||
self._commission_swipe_to_top()
|
self._commission_swipe_to_top()
|
||||||
self.handle_info_bar()
|
self.handle_info_bar()
|
||||||
self._commission_find_and_start(comm)
|
if self._commission_find_and_start(comm, is_urgent=True):
|
||||||
comm.convert_to_running()
|
comm.convert_to_running()
|
||||||
self._commission_mode_reset()
|
self._commission_mode_reset()
|
||||||
if not self.daily_choose and not self.urgent_choose:
|
if not self.daily_choose and not self.urgent_choose:
|
||||||
logger.info('No commission chose')
|
logger.info('No commission chose')
|
||||||
|
|||||||
Reference in New Issue
Block a user