1
0
mirror of https://github.com/sui-feng-cb/AzurLaneAutoScript1.git synced 2026-08-14 03:20:49 +08:00
This commit is contained in:
2026-08-09 06:37:01 +08:00
35 changed files with 80 additions and 106 deletions

View File

@@ -26,6 +26,7 @@ SELECT_SAFE = Button(area={'cn': (89, 251, 167, 269), 'en': (92, 253, 164, 268),
SELECT_STRONGHOLD = Button(area={'cn': (89, 251, 166, 269), 'en': (81, 252, 175, 272), 'jp': (89, 251, 167, 269), 'tw': (88, 250, 167, 270)}, color={'cn': (113, 114, 118), 'en': (81, 83, 87), 'jp': (115, 116, 119), 'tw': (103, 105, 108)}, button={'cn': (89, 251, 166, 269), 'en': (81, 252, 175, 272), 'jp': (89, 251, 167, 269), 'tw': (88, 250, 167, 270)}, file={'cn': './assets/cn/os/SELECT_STRONGHOLD.png', 'en': './assets/en/os/SELECT_STRONGHOLD.png', 'jp': './assets/jp/os/SELECT_STRONGHOLD.png', 'tw': './assets/tw/os/SELECT_STRONGHOLD.png'})
STRONGHOLD_PERCENTAGE = Button(area={'cn': (293, 125, 340, 143), 'en': (293, 125, 340, 143), 'jp': (293, 125, 340, 143), 'tw': (293, 125, 340, 143)}, color={'cn': (132, 135, 146), 'en': (132, 135, 146), 'jp': (132, 135, 146), 'tw': (132, 135, 146)}, button={'cn': (293, 125, 340, 143), 'en': (293, 125, 340, 143), 'jp': (293, 125, 340, 143), 'tw': (293, 125, 340, 143)}, file={'cn': './assets/cn/os/STRONGHOLD_PERCENTAGE.png', 'en': './assets/en/os/STRONGHOLD_PERCENTAGE.png', 'jp': './assets/jp/os/STRONGHOLD_PERCENTAGE.png', 'tw': './assets/tw/os/STRONGHOLD_PERCENTAGE.png'})
TEMPLATE_EMPTY_HP = Template(file={'cn': './assets/cn/os/TEMPLATE_EMPTY_HP.png', 'en': './assets/en/os/TEMPLATE_EMPTY_HP.png', 'jp': './assets/jp/os/TEMPLATE_EMPTY_HP.png', 'tw': './assets/tw/os/TEMPLATE_EMPTY_HP.png'})
TEMPLATE_ExplorationContainer = Template(file={'cn': './assets/cn/os/TEMPLATE_ExplorationContainer.png', 'en': './assets/en/os/TEMPLATE_ExplorationContainer.png', 'jp': './assets/jp/os/TEMPLATE_ExplorationContainer.png', 'tw': './assets/tw/os/TEMPLATE_ExplorationContainer.png'})
TEMPLATE_ExplorationReward = Template(file={'cn': './assets/cn/os/TEMPLATE_ExplorationReward.png', 'en': './assets/en/os/TEMPLATE_ExplorationReward.png', 'jp': './assets/jp/os/TEMPLATE_ExplorationReward.png', 'tw': './assets/tw/os/TEMPLATE_ExplorationReward.png'})
TEMPLATE_FleetMechanism = Template(file={'cn': './assets/cn/os/TEMPLATE_FleetMechanism.png', 'en': './assets/en/os/TEMPLATE_FleetMechanism.png', 'jp': './assets/jp/os/TEMPLATE_FleetMechanism.png', 'tw': './assets/tw/os/TEMPLATE_FleetMechanism.png'})
TEMPLATE_LoggingTower = Template(file={'cn': './assets/cn/os/TEMPLATE_LoggingTower.png', 'en': './assets/en/os/TEMPLATE_LoggingTower.png', 'jp': './assets/jp/os/TEMPLATE_LoggingTower.png', 'tw': './assets/tw/os/TEMPLATE_LoggingTower.png'})

View File

@@ -1022,10 +1022,26 @@ class OSMap(OSFleet, Map, GlobeCamera, StorageHandler, StrategicSearchHandler):
Returns:
bool: If solved a map random event
"""
grids = self.view.select(is_exploration_container=True)
if 'is_exploration_container' not in self._solved_map_event \
and grids and grids[0].is_exploration_container:
grid = grids[0]
logger.info(f'Found exploration container on {grid}')
self.device.click(grid)
with self.config.temporary(STORY_ALLOW_SKIP=False, STORY_OPTION=1):
result = self.wait_until_walk_stable(
drop=drop, walk_out_of_step=False, confirm_timer=Timer(1.5, count=4))
if 'event' in result:
self._solved_map_event.add('is_exploration_container')
return True
else:
return False
grids = self.view.select(is_exploration_reward=True)
if 'is_exploration_reward' not in self._solved_map_event and grids and grids[0].is_exploration_reward:
grid = grids[0]
logger.info(f'Found exploration reward on {grid}')
self.device.click(grid)
result = self.wait_until_walk_stable(drop=drop, walk_out_of_step=False, confirm_timer=Timer(1.5, count=4))
if 'event' in result:
self._solved_map_event.add('is_exploration_reward')

View File

@@ -88,8 +88,11 @@ class OpsiExplore(OSMap):
self.config.OpsiExplore_LastZone = zone
logger.info(f'Zone cleared: {self.name_to_zone(zone)}')
if finished_combat == 0:
logger.warning('Zone cleared but did not finish any combat')
self._os_explore_failed_zone.append(zone)
if 'is_exploration_container' in self._solved_map_event:
logger.info('Zone cleared by exploration container')
else:
logger.warning('Zone cleared but did not finish any combat')
self._os_explore_failed_zone.append(zone)
self.handle_after_auto_search()
self.config.check_task_switch()