AzurLaneAutoScript
AzurLaneAutoScript copied to clipboard
《复刻紫绛槿岚》D3 BOSS结算页面识别错误
在提问之前...
- [X] 我已经搜索了现有的 issues
- [X] 我在提问题之前至少花费了 5 分钟来思考和准备
- [X] 我已经阅读了 Wiki 中的 常见问题(FAQ)
- [X] 我正在使用最新版的 Alas
描述你的问题
推图结束后卡在BOSS结算页面,alas停止运行,提示发生错误
如何复现
- 前往 '...'
- 点击 '....'
- 滑动到 '....'
- 出现问题
预期行为
No response
相关 Logs
2024-11-18 00:52:27.393 | INFO | BATTLE_2
2024-11-18 00:52:27.394 | INFO | Using function: battle_0
2024-11-18 00:52:27.397 | INFO | <<< CLEAR SIREN >>>
2024-11-18 00:52:27.399 | INFO | Grids: [E7]
2024-11-18 00:52:27.401 | INFO | targetEnemyScale:S3_enemy_first
2024-11-18 00:52:27.402 | INFO | Clear enemy: E7
2024-11-18 00:52:27.404 | INFO | [Fleet_1: G5] Fleet_2: F9
2024-11-18 00:52:27.424 | INFO | Bind task ['General', 'Alas', 'TaskBalancer', 'EventGeneral', 'Event']
2024-11-18 00:52:27.427 | INFO | Save config ./config\alas2.json, Event.Emotion.Fleet1Value=146,
Event.Emotion.Fleet1Record=datetime.datetime(2024, 11, 18, 0, 52, 27), Event.Emotion.Fleet2Value=150,
Event.Emotion.Fleet2Record=datetime.datetime(2024, 11, 18, 0, 52, 27)
2024-11-18 00:52:27.441 | INFO | [Emotion fleet_1] 146
2024-11-18 00:52:27.442 | INFO | [Emotion fleet_2] 150
2024-11-18 00:52:27.445 | INFO | Fleet set to 1
2024-11-18 00:52:27.454 | INFO | Fleet: 1, fleet_current_index: 1
2024-11-18 00:52:27.457 | INFO | In sight: E7
2024-11-18 00:52:27.459 | INFO | Focus to: D5
2024-11-18 00:52:27.460 | INFO | Map swipe: (0, 0)
2024-11-18 00:52:27.462 | INFO | Global E7 (camera=D5) -> Local E6 (center=D4)
2024-11-18 00:52:27.463 | INFO | Click ( 792, 549) @ E6
2024-11-18 00:52:28.101 | INFO | Arrive E7 (MAP_WALK_USE_CURRENT_FLEET, is_current_fleet)
2024-11-18 00:52:29.640 | WARNING | Arrive with unexpected result
2024-11-18 00:52:29.642 | INFO | Arrive E7 confirm. Result: nothing. Expected: combat_siren
2024-11-18 00:52:29.654 | INFO | Full scan start, mode=normal
2024-11-18 00:52:29.659 | INFO | [enemy_missing] EN: 0, MY: 0, SI: 1, BO: 0, CA: 0
2024-11-18 00:52:29.661 | INFO | [enemy_may____] EN: 0, MY: 0, SI: 1, BO: 1, CA: 3
2024-11-18 00:52:29.663 | INFO | Focus to: D5
2024-11-18 00:52:29.664 | INFO | Map swipe: (0, 0)
2024-11-18 00:52:29.666 | INFO | [enemy_missing] EN: 0, MY: 0, SI: 1, BO: 0, CA: 0
2024-11-18 00:52:29.668 | INFO | [enemy_may____] EN: 0, MY: 0, SI: 1, BO: 1, CA: 3
2024-11-18 00:52:29.669 | INFO | Focus to: E5
2024-11-18 00:52:29.671 | INFO | Map swipe: (1, 0)
2024-11-18 00:52:29.674 | INFO | Swipe ( 763, 358) -> ( 651, 359)
2024-11-18 00:52:29.900 | INFO | [prev.center_offset] [0.56878984 0.50798822]
2024-11-18 00:52:30.080 | WARNING | Image to detect is not in_map
2024-11-18 00:52:30.332 | WARNING | Image to detect is not in_map
2024-11-18 00:52:30.494 | WARNING | Image to detect is not in_map
2024-11-18 00:52:30.635 | WARNING | Image to detect is not in_map
2024-11-18 00:52:30.794 | WARNING | Image to detect is not in_map
2024-11-18 00:52:30.950 | WARNING | Image to detect is not in_map
2024-11-18 00:52:31.125 | WARNING | Image to detect is not in_map
2024-11-18 00:52:31.261 | WARNING | Image to detect is not in_map
2024-11-18 00:52:31.456 | WARNING | Image to detect is not in_map
2024-11-18 00:52:31.641 | WARNING | Image to detect is not in_map
2024-11-18 00:52:31.802 | WARNING | Image to detect is not in_map
2024-11-18 00:52:31.960 | WARNING | Image to detect is not in_map
2024-11-18 00:52:32.133 | WARNING | Image to detect is not in_map
2024-11-18 00:52:32.307 | WARNING | Image to detect is not in_map
2024-11-18 00:52:32.450 | WARNING | Image to detect is not in_map
2024-11-18 00:52:32.598 | WARNING | Image to detect is not in_map
2024-11-18 00:52:32.760 | WARNING | Image to detect is not in_map
2024-11-18 00:52:32.942 | WARNING | Image to detect is not in_map
2024-11-18 00:52:33.109 | WARNING | Image to detect is not in_map
2024-11-18 00:52:33.278 | WARNING | Image to detect is not in_map
2024-11-18 00:52:33.461 | WARNING | Image to detect is not in_map
2024-11-18 00:52:33.620 | WARNING | Image to detect is not in_map
2024-11-18 00:52:33.787 | WARNING | Image to detect is not in_map
2024-11-18 00:52:34.006 | WARNING | Image to detect is not in_map
2024-11-18 00:52:34.182 | WARNING | Image to detect is not in_map
2024-11-18 00:52:34.377 | WARNING | Image to detect is not in_map
2024-11-18 00:52:34.577 | WARNING | Image to detect is not in_map
2024-11-18 00:52:34.745 | WARNING | Image to detect is not in_map
2024-11-18 00:52:34.912 | WARNING | Image to detect is not in_map
2024-11-18 00:52:34.931 | ERROR | MapDetectionError: Image to detect is not in_map
┌───────────────────────────────────────── Traceback (most recent call last) ─────────────────────────────────────────┐
│ │
│ D:\APP\Alas\AzurLaneAutoScript\alas.py:69 in run │
│ │
│ 66 │ │ try: │
│ 67 │ │ │ if not skip_first_screenshot: │
│ 68 │ │ │ │ self.device.screenshot() │
│ > 69 │ │ │ self.__getattribute__(command)() │
│ 70 │ │ │ return True │
│ 71 │ │ except TaskEnd: │
│ 72 │ │ │ return True │
│ │
│ ┌──────────────────────────────────── locals ────────────────────────────────────┐ │
│ │ command = 'event' │ │
│ │ e = MapDetectionError('Image to detect is not in_map') │ │
│ │ self = <alas.AzurLaneAutoScript object at 0x0000022E62CB2248> │ │
│ │ skip_first_screenshot = False │ │
│ └────────────────────────────────────────────────────────────────────────────────┘ │
│ D:\APP\Alas\AzurLaneAutoScript\alas.py:359 in event │
│ │
│ 356 │ def event(self): │
│ 357 │ │ from module.campaign.run import CampaignRun │
│ 358 │ │ CampaignRun(config=self.config, device=self.device).run( │
│ > 359 │ │ │ name=self.config.Campaign_Name, folder=self.config.Campaign_Event, │
│ mode=self.config.Campaign_Mode) │
│ 360 │ │
│ 361 │ def event2(self): │
│ 362 │ │ from module.campaign.run import CampaignRun │
│ │
│ ┌─────────────────────────────── locals ───────────────────────────────┐ │
│ │ CampaignRun = <class 'module.campaign.run.CampaignRun'> │ │
│ │ self = <alas.AzurLaneAutoScript object at 0x0000022E62CB2248> │ │
│ └──────────────────────────────────────────────────────────────────────┘ │
│ │
│ D:\APP\Alas\AzurLaneAutoScript\module\campaign\run.py:395 in run │
│ │
│ 392 │ │ │ self.device.stuck_record_clear() │
│ 393 │ │ │ self.device.click_record_clear() │
│ 394 │ │ │ try: │
│ > 395 │ │ │ │ self.campaign.run() │
│ 396 │ │ │ except ScriptEnd as e: │
│ 397 │ │ │ │ logger.hr('Script end') │
│ 398 │ │ │ │ logger.info(str(e)) │
│ │
│ ┌──────────────────────────────── locals ─────────────────────────────────┐ │
│ │ folder = 'event_20220915_cn' │ │
│ │ mode = 'normal' │ │
│ │ name = 'd3' │ │
│ │ self = <module.campaign.run.CampaignRun object at 0x0000022E63933B48> │ │
│ │ total = 0 │ │
│ └─────────────────────────────────────────────────────────────────────────┘ │
│ │
│ D:\APP\Alas\AzurLaneAutoScript\module\campaign\campaign_base.py:141 in run │
│ │
│ 138 │ │ for _ in range(20): │
│ 139 │ │ │ try: │
│ 140 │ │ │ │ if not self.map_is_auto_search: │
│ > 141 │ │ │ │ │ self.execute_a_battle() │
│ 142 │ │ │ │ else: │
│ 143 │ │ │ │ │ self.auto_search_execute_a_battle() │
│ 144 │ │ │ except CampaignEnd: │
│ │
│ ┌─────────────────────────────────── locals ───────────────────────────────────┐ │
│ │ _ = 2 │ │
│ │ self = <campaign.event_20220915_cn.d3.Campaign object at 0x0000022E7F978088> │ │
│ └──────────────────────────────────────────────────────────────────────────────┘ │
│ │
│ D:\APP\Alas\AzurLaneAutoScript\module\campaign\campaign_base.py:100 in execute_a_battle │
│ │
│ 97 │ │ result = False │
│ 98 │ │ for _ in range(10): │
│ 99 │ │ │ try: │
│ > 100 │ │ │ │ result = self.battle_function() │
│ 101 │ │ │ │ break │
│ 102 │ │ │ except MapEnemyMoved: │
│ 103 │ │ │ │ if self.battle_count > prev: │
│ │
│ ┌──────────────────────────────────── locals ────────────────────────────────────┐ │
│ │ _ = 0 │ │
│ │ prev = 2 │ │
│ │ result = False │ │
│ │ self = <campaign.event_20220915_cn.d3.Campaign object at 0x0000022E7F978088> │ │
│ └────────────────────────────────────────────────────────────────────────────────┘ │
│ │
│ D:\APP\Alas\AzurLaneAutoScript\module\base\decorator.py:70 in wrapper │
│ │
│ 67 │ │ │ │ │ if not all(flag): │
│ 68 │ │ │ │ │ │ continue │
│ 69 │ │ │ │ │ │
│ > 70 │ │ │ │ │ return record['func'](self, *args, **kwargs) │
│ 71 │ │ │ │ │
│ 72 │ │ │ │ logger.warning(f'No option fits for {name}, using the last define │
│ func.') │
│ 73 │ │ │ │ return func(self, *args, **kwargs) │
│ │
│ ┌────────────────────────────────────── locals ───────────────────────────────────────┐ │
│ │ args = () │ │
│ │ cls = <class 'module.base.decorator.Config'> │ │
│ │ flag = [True, True] │ │
│ │ func = <function CampaignBase.battle_function at 0x0000022E23C6E048> │ │
│ │ kwargs = {} │ │
│ │ logger = <Logger alas (INFO)> │ │
│ │ name = 'battle_function' │ │
│ │ record = { │ │
│ │ │ 'options': { │ │
│ │ │ │ 'MAP_CLEAR_ALL_THIS_TIME': False, │ │
│ │ │ │ 'POOR_MAP_DATA': False │ │
│ │ │ }, │ │
│ │ │ 'func': <function CampaignBase.battle_function at 0x0000022E23C6E048> │ │
│ │ } │ │
│ │ self = <campaign.event_20220915_cn.d3.Campaign object at 0x0000022E7F978088> │ │
│ └─────────────────────────────────────────────────────────────────────────────────────┘ │
│ │
│ D:\APP\Alas\AzurLaneAutoScript\module\campaign\campaign_base.py:90 in battle_function │
│ │
│ 87 │ │ logger.info(f'Using function: {func}') │
│ 88 │ │ func = self.__getattribute__(func) │
│ 89 │ │ │
│ > 90 │ │ result = func() │
│ 91 │ │ │
│ 92 │ │ return result │
│ 93 │
│ │
│ ┌──────────────────────────────────────────────────── locals ─────────────────────────────────────────────────────┐ │
│ │ extra_battle = 2 │ │
│ │ func = <bound method Campaign.battle_0 of <campaign.event_20220915_cn.d3.Campaign object at │ │
│ │ 0x0000022E7F978088>> │ │
│ │ self = <campaign.event_20220915_cn.d3.Campaign object at 0x0000022E7F978088> │ │
│ └─────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ │
│ │
│ D:\APP\Alas\AzurLaneAutoScript\campaign\event_20220915_cn\d3.py:77 in battle_0 │
│ │
│ 74 │ ENEMY_FILTER = '1L > 1M > 1E > 1C > 2L > 2M > 2E > 2C > 3L > 3M > 3E > 3C' │
│ 75 │ │
│ 76 │ def battle_0(self): │
│ > 77 │ │ if self.clear_siren(): │
│ 78 │ │ │ return True │
│ 79 │ │ if self.clear_filter_enemy(self.ENEMY_FILTER, preserve=1): │
│ 80 │ │ │ return True │
│ │
│ ┌─────────────────────────────────── locals ───────────────────────────────────┐ │
│ │ self = <campaign.event_20220915_cn.d3.Campaign object at 0x0000022E7F978088> │ │
│ └──────────────────────────────────────────────────────────────────────────────┘ │
│ │
│ D:\APP\Alas\AzurLaneAutoScript\module\map\map.py:470 in clear_siren │
│ │
│ 467 │ │ │ │ expected = 'fortress' │
│ 468 │ │ │ else: │
│ 469 │ │ │ │ expected = 'siren' │
│ > 470 │ │ │ self.clear_chosen_enemy(grids[0], expected=expected) │
│ 471 │ │ │ return True │
│ 472 │ │ │
│ 473 │ │ return False │
│ │
│ ┌───────────────────────────────────── locals ─────────────────────────────────────┐ │
│ │ expected = 'siren' │ │
│ │ grids = <module.map.map_grids.SelectedGrids object at 0x0000022E4361F788> │ │
│ │ kwargs = {} │ │
│ │ self = <campaign.event_20220915_cn.d3.Campaign object at 0x0000022E7F978088> │ │
│ └──────────────────────────────────────────────────────────────────────────────────┘ │
│ │
│ D:\APP\Alas\AzurLaneAutoScript\module\map\map.py:33 in clear_chosen_enemy │
│ │
│ 30 │ │ │ self.emotion.wait(fleet_index=self.fleet_current_index) │
│ 31 │ │ self.goto(grid, expected=expected) │
│ 32 │ │ │
│ > 33 │ │ self.full_scan() │
│ 34 │ │ self.find_path_initial() │
│ 35 │ │ self.map.show_cost() │
│ 36 │ │ return self.battle_count >= battle_count │
│ │
│ ┌─────────────────────────────────────── locals ───────────────────────────────────────┐ │
│ │ battle_count = 2 │ │
│ │ expected = 'combat_siren' │ │
│ │ grid = E7 │ │
│ │ self = <campaign.event_20220915_cn.d3.Campaign object at 0x0000022E7F978088> │ │
│ └──────────────────────────────────────────────────────────────────────────────────────┘ │
│ │
│ D:\APP\Alas\AzurLaneAutoScript\module\map\fleet.py:550 in full_scan │
│ │
│ 547 │ │ │ mode = 'decoy' │
│ 548 │ │ super().full_scan( │
│ 549 │ │ │ queue=queue, must_scan=must_scan, battle_count=self.battle_count, │
│ mystery_count=self.mystery_count, │
│ > 550 │ │ │ siren_count=self.siren_count, carrier_count=self.carrier_count, mode=mode) │
│ 551 │ │ │
│ 552 │ │ if self.config.FLEET_2 and not self.fleet_2_location: │
│ 553 │ │ │ fleets = self.map.select(is_fleet=True, is_current_fleet=False) │
│ │
│ ┌───────────────────────────────────── locals ──────────────────────────────────────┐ │
│ │ __class__ = <class 'module.map.fleet.Fleet'> │ │
│ │ mode = 'normal' │ │
│ │ must_scan = None │ │
│ │ queue = None │ │
│ │ self = <campaign.event_20220915_cn.d3.Campaign object at 0x0000022E7F978088> │ │
│ └───────────────────────────────────────────────────────────────────────────────────┘ │
│ │
│ D:\APP\Alas\AzurLaneAutoScript\module\map\camera.py:439 in full_scan │
│ │
│ 436 │ │ │ │ │ break │
│ 437 │ │ │ │
│ 438 │ │ │ queue = queue.sort_by_camera_distance(self.camera) │
│ > 439 │ │ │ self.focus_to(queue[0]) │
│ 440 │ │ │ self.focus_to_grid_center(0.25) │
│ 441 │ │ │ success = self.map.update(grids=self.view, camera=self.camera, mode=mode) │
│ 442 │ │ │ if not success: │
│ │
│ ┌─────────────────────────────────────── locals ────────────────────────────────────────┐ │
│ │ battle_count = 2 │ │
│ │ carrier_count = 0 │ │
│ │ mode = 'normal' │ │
│ │ must_scan = None │ │
│ │ mystery_count = 0 │ │
│ │ queue = <module.map.map_grids.SelectedGrids object at 0x0000022E43612508> │ │
│ │ self = <campaign.event_20220915_cn.d3.Campaign object at 0x0000022E7F978088> │ │
│ │ siren_count = 2 │ │
│ │ success = True │ │
│ └───────────────────────────────────────────────────────────────────────────────────────┘ │
│ │
│ D:\APP\Alas\AzurLaneAutoScript\module\map\camera.py:403 in focus_to │
│ │
│ 400 │ │ while 1: │
│ 401 │ │ │ vector = np.array(location) - self.camera │
│ 402 │ │ │ swipe = tuple(np.min([np.abs(vector), swipe_limit], axis=0) * │
│ np.sign(vector)) │
│ > 403 │ │ │ has_swiped = self.map_swipe(swipe) │
│ 404 │ │ │ │
│ 405 │ │ │ if not has_swiped: │
│ 406 │ │ │ │ break │
│ │
│ ┌────────────────────────────────────── locals ───────────────────────────────────────┐ │
│ │ location = (4, 4) │ │
│ │ self = <campaign.event_20220915_cn.d3.Campaign object at 0x0000022E7F978088> │ │
│ │ swipe = (1, 0) │ │
│ │ swipe_limit = (4, 3) │ │
│ │ vector = array([1, 0]) │ │
│ └─────────────────────────────────────────────────────────────────────────────────────┘ │
│ │
│ D:\APP\Alas\AzurLaneAutoScript\module\map\camera.py:85 in map_swipe │
│ │
│ 82 │ │ self._prev_swipe = vector │
│ 83 │ │ vector = np.array(vector) │
│ 84 │ │ vector = np.array([0.5, 0.5]) - self.view.center_offset + vector │
│ > 85 │ │ return self._map_swipe(vector) │
│ 86 │ │
│ 87 │ def focus_to_grid_center(self, tolerance=None): │
│ 88 │ │ """ │
│ │
│ ┌──────────────────────────────────── locals ────────────────────────────────────┐ │
│ │ self = <campaign.event_20220915_cn.d3.Campaign object at 0x0000022E7F978088> │ │
│ │ vector = array([ 0.93121016, -0.00798822]) │ │
│ └────────────────────────────────────────────────────────────────────────────────┘ │
│ │
│ D:\APP\Alas\AzurLaneAutoScript\module\map\camera.py:62 in _map_swipe │
│ │
│ 59 │ │ │ self.device.swipe_vector(vector, name=name, box=box, │
│ whitelist_area=whitelist, blacklist_area=blacklist) │
│ 60 │ │ │ # Donno why initial commit have a sleep here │
│ 61 │ │ │ # self.device.sleep(0.3) │
│ > 62 │ │ │ self.update(wait_swipe=True) │
│ 63 │ │ │ return True │
│ 64 │ │ else: │
│ 65 │ │ │ # Drop swipe │
│ │
│ ┌───────────────────────────────────── locals ──────────────────────────────────────┐ │
│ │ blacklist = [] │ │
│ │ box = (123, 159, 1175, 628) │ │
│ │ distance = array([120.12933603, 84.80872558]) │ │
│ │ name = 'MAP_SWIPE_1_0' │ │
│ │ self = <campaign.event_20220915_cn.d3.Campaign object at 0x0000022E7F978088> │ │
│ │ vector = array([-111.86565815, 0.67747105]) │ │
│ │ whitelist = [ │ │
│ │ │ (602, 340, 678, 382), │ │
│ │ │ (320, 532, 398, 591), │ │
│ │ │ (374, 179, 433, 207), │ │
│ │ │ (883, 532, 961, 591), │ │
│ │ │ (846, 179, 905, 207) │ │
│ │ ] │ │
│ └───────────────────────────────────────────────────────────────────────────────────┘ │
│ │
│ D:\APP\Alas\AzurLaneAutoScript\module\map\camera.py:301 in update │
│ │
│ 298 │ │ │ │
│ 299 │ │ │ # _update_view() │
│ 300 │ │ │ try: │
│ > 301 │ │ │ │ success = self._update_view() │
│ 302 │ │ │ │ if not success: │
│ 303 │ │ │ │ │ continue │
│ 304 │ │ │ │ logger.attr('view.center_offset', self.view.center_offset) │
│ │
│ ┌────────────────────────────────────────── locals ───────────────────────────────────────────┐ │
│ │ allow_error = False │ │
│ │ camera = True │ │
│ │ error_confirm = Timer(limit=5.055/5, count=29/10) │ │
│ │ is_grid_center = <function Camera.update.<locals>.is_grid_center at 0x0000022E43576EE8> │ │
│ │ is_still_prev = <function Camera.update.<locals>.is_still_prev at 0x0000022E43813168> │ │
│ │ prev_center_offset = array([0.56878984, 0.50798822]) │ │
│ │ self = <campaign.event_20220915_cn.d3.Campaign object at 0x0000022E7F978088> │ │
│ │ swipe_wait_timeout = Timer(limit=5.055/0.35, count=29/1) │ │
│ │ swiped = True │ │
│ │ wait_swipe = True │ │
│ └─────────────────────────────────────────────────────────────────────────────────────────────┘ │
│ │
│ D:\APP\Alas\AzurLaneAutoScript\module\map\camera.py:199 in _update_view │
│ │
│ 196 │ │ │ │ │ self.device.click(GAME_TIPS) │
│ 197 │ │ │ │ │ return False │
│ 198 │ │ │ │ else: │
│ > 199 │ │ │ │ │ raise e │
│ 200 │ │ │ elif 'Camera outside map' in str(e): │
│ 201 │ │ │ │ string = str(e) │
│ 202 │ │ │ │ logger.warning(string) │
│ │
│ ┌─────────────────────────────────── locals ───────────────────────────────────┐ │
│ │ self = <campaign.event_20220915_cn.d3.Campaign object at 0x0000022E7F978088> │ │
│ └──────────────────────────────────────────────────────────────────────────────┘ │
│ │
│ D:\APP\Alas\AzurLaneAutoScript\module\map\camera.py:119 in _update_view │
│ │
│ 116 │ │ │ │ │ and not self.is_in_strategy_submarine_move() \ │
│ 117 │ │ │ │ │ and not self.is_in_strategy_mob_move(): │
│ 118 │ │ │ │ logger.warning('Image to detect is not in_map') │
│ > 119 │ │ │ │ raise MapDetectionError('Image to detect is not in_map') │
│ 120 │ │ │ self.view.load(self.device.image) │
│ 121 │ │ except MapDetectionError as e: │
│ 122 │ │ │ if self.info_bar_count(): │
│ │
│ ┌─────────────────────────────────── locals ───────────────────────────────────┐ │
│ │ self = <campaign.event_20220915_cn.d3.Campaign object at 0x0000022E7F978088> │ │
│ └──────────────────────────────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
MapDetectionError: Image to detect is not in_map
2024-11-18 00:52:36.052 | WARNING | Saving error: ./log/error/1731862356052
截图
还有别的吗?
No response