15-1 刷图报错
在提问之前...
- [x] 我已经搜索了现有的 issues
- [x] 我在提问题之前至少花费了 5 分钟来思考和准备
- [x] 我已经阅读了 Wiki 中的 常见问题(FAQ)
- [x] 我正在使用最新版的 Alas
描述你的问题
15-1有概率刷图时报错。设置为优先大型敌人,会在1队打第三队敌人(打前3/5,打后2/5),并且第三队敌人在图中红圈位置时,会报错。多次出现这个问题。
如何复现
预期行为
No response
相关 Logs
截图
报错时截图以及log
log.txt 主线设置如下:
还有别的吗?
No response
我也是卡在这好几次
补充错误日志
INFO 13:44:58.756 │ Arrive F5 (MAP_WALK_USE_CURRENT_FLEET, is_current_fleet)
WARNING 13:45:00.712 │ Arrive with unexpected result
INFO 13:45:00.713 │ Arrive F5 confirm. Result: nothing. Expected: combat
INFO 13:45:00.715 │ Full scan start, mode=normal
INFO 13:45:00.716 │ [enemy_missing] EN: 1, MY: 0, SI: 0, BO: 0, CA: 0
INFO 13:45:00.717 │ [enemy_may____] EN: 0, MY: 0, SI: 0, BO: 0, CA: 2
INFO 13:45:00.718 │ Focus to: C5
INFO 13:45:00.719 │ Map swipe: (0, 0)
INFO 13:45:00.720 │ [enemy_missing] EN: 1, MY: 0, SI: 0, BO: 0, CA: 0
INFO 13:45:00.721 │ [enemy_may____] EN: 0, MY: 0, SI: 0, BO: 0, CA: 2
INFO 13:45:00.722 │ Focus to: E5
INFO 13:45:00.723 │ Map swipe: (2, 0)
INFO 13:45:00.724 │ Swipe ( 867, 459) -> ( 623, 459)
INFO 13:45:01.027 │ [prev.center_offset] [0.49207799 0.49811614]
WARNING 13:45:01.255 │ Image to detect is not in_map
INFO 13:45:01.323 │ [Package_name] com.bilibili.azurlane
WARNING 13:45:01.770 │ Image to detect is not in_map
INFO 13:45:01.795 │ [Package_name] com.bilibili.azurlane
WARNING 13:45:01.853 │ Image to detect is not in_map
INFO 13:45:01.878 │ [Package_name] com.bilibili.azurlane
WARNING 13:45:01.953 │ Image to detect is not in_map
INFO 13:45:01.976 │ [Package_name] com.bilibili.azurlane
WARNING 13:45:02.050 │ Image to detect is not in_map
INFO 13:45:02.084 │ [Package_name] com.bilibili.azurlane
WARNING 13:45:02.154 │ Image to detect is not in_map
INFO 13:45:02.179 │ [Package_name] com.bilibili.azurlane
WARNING 13:45:02.256 │ Image to detect is not in_map
INFO 13:45:02.279 │ [Package_name] com.bilibili.azurlane
WARNING 13:45:02.858 │ Image to detect is not in_map
INFO 13:45:02.891 │ [Package_name] com.bilibili.azurlane
WARNING 13:45:03.304 │ Image to detect is not in_map
INFO 13:45:03.328 │ [Package_name] com.bilibili.azurlane
WARNING 13:45:03.382 │ Image to detect is not in_map
INFO 13:45:03.408 │ [Package_name] com.bilibili.azurlane
WARNING 13:45:03.484 │ Image to detect is not in_map
INFO 13:45:03.506 │ [Package_name] com.bilibili.azurlane
WARNING 13:45:03.585 │ Image to detect is not in_map
INFO 13:45:03.606 │ [Package_name] com.bilibili.azurlane
WARNING 13:45:03.688 │ Image to detect is not in_map
INFO 13:45:03.711 │ [Package_name] com.bilibili.azurlane
WARNING 13:45:03.794 │ Image to detect is not in_map
INFO 13:45:03.818 │ [Package_name] com.bilibili.azurlane
WARNING 13:45:03.891 │ Image to detect is not in_map
INFO 13:45:03.915 │ [Package_name] com.bilibili.azurlane
WARNING 13:45:03.986 │ Image to detect is not in_map
INFO 13:45:04.011 │ [Package_name] com.bilibili.azurlane
WARNING 13:45:04.088 │ Image to detect is not in_map
INFO 13:45:04.116 │ [Package_name] com.bilibili.azurlane
WARNING 13:45:04.191 │ Image to detect is not in_map
INFO 13:45:04.221 │ [Package_name] com.bilibili.azurlane
WARNING 13:45:04.735 │ Image to detect is not in_map
INFO 13:45:04.757 │ [Package_name] com.bilibili.azurlane
WARNING 13:45:05.238 │ Image to detect is not in_map
INFO 13:45:05.262 │ [Package_name] com.bilibili.azurlane
WARNING 13:45:05.325 │ Image to detect is not in_map
INFO 13:45:05.352 │ [Package_name] com.bilibili.azurlane
WARNING 13:45:05.421 │ Image to detect is not in_map
INFO 13:45:05.447 │ [Package_name] com.bilibili.azurlane
WARNING 13:45:05.516 │ Image to detect is not in_map
INFO 13:45:05.539 │ [Package_name] com.bilibili.azurlane
WARNING 13:45:05.618 │ Image to detect is not in_map
INFO 13:45:05.642 │ [Package_name] com.bilibili.azurlane
WARNING 13:45:05.719 │ Image to detect is not in_map
INFO 13:45:05.741 │ [Package_name] com.bilibili.azurlane
WARNING 13:45:05.821 │ Image to detect is not in_map
INFO 13:45:05.849 │ [Package_name] com.bilibili.azurlane
WARNING 13:45:06.355 │ Image to detect is not in_map
INFO 13:45:06.384 │ [Package_name] com.bilibili.azurlane
ERROR 13:45:06.385 │ MapDetectionError: Image to detect is not in_map
╭────────────────── Traceback (most recent call last) ───────────────────╮
│ │
│ E:\pythonProject\AzurLaneAutoScript\alas.py:69 in run │
│ │
│ 67 │ │ │ if not skip_first_screenshot: │
│ 68 │ │ │ │ self.device.screenshot() │
│ ❱ 69 │ │ │ self.getattribute(command)() │
│ 70 │ │ │ return True │
│ 71 │ │ except TaskEnd: │
│ │
│ ╭────────────────────────────── locals ──────────────────────────────╮ │
│ │ command = 'main' │ │
│ │ e = MapDetectionError('Image to detect is not │ │
│ │ in_map') │ │
│ │ self = <alas.AzurLaneAutoScript object at │ │
│ │ 0x0000025FFF843948> │ │
│ │ skip_first_screenshot = False │ │
│ ╰────────────────────────────────────────────────────────────────────╯ │
│ E:\pythonProject\AzurLaneAutoScript\alas.py:352 in main │
│ │
│ 350 │ │ from module.campaign.run import CampaignRun │
│ 351 │ │ CampaignRun(config=self.config, device=self.device).run( │
│ ❱ 352 │ │ │ name=self.config.Campaign_Name, folder=self.config.C │
│ mode=self.config.Campaign_Mode) │
│ 353 │ │
│ 354 │ def main2(self): │
│ │
│ ╭────────────────────────────── locals ──────────────────────────────╮ │
│ │ CampaignRun = <class 'module.campaign.run.CampaignRun'> │ │
│ │ self = <alas.AzurLaneAutoScript object at │ │
│ │ 0x0000025FFF843948> │ │
│ ╰────────────────────────────────────────────────────────────────────╯ │
│ │
│ E:\pythonProject\AzurLaneAutoScript\module\campaign\run.py:422 in run │
│ │
│ 420 │ │ │ self.device.click_record_clear() │
│ 421 │ │ │ try: │
│ ❱ 422 │ │ │ │ self.campaign.run() │
│ 423 │ │ │ except ScriptEnd as e: │
│ 424 │ │ │ │ logger.hr('Script end') │
│ │
│ ╭────────────────────────────── locals ──────────────────────────────╮ │
│ │ folder = 'campaign_main' │ │
│ │ mode = 'normal' │ │
│ │ name = 'campaign_15_1' │ │
│ │ self = <module.campaign.run.CampaignRun object at │ │
│ │ 0x0000025FF858BB08> │ │
│ │ total = 0 │ │
│ ╰────────────────────────────────────────────────────────────────────╯ │
│ │
│ E:\pythonProject\AzurLaneAutoScript\module\campaign\campaign_base.py:1 │
│ 41 in run │
│ │
│ 139 │ │ │ try: │
│ 140 │ │ │ │ if not self.map_is_auto_search: │
│ ❱ 141 │ │ │ │ │ self.execute_a_battle() │
│ 142 │ │ │ │ else: │
│ 143 │ │ │ │ │ self.auto_search_execute_a_battle() │
│ │
│ ╭────────────────────────────── locals ──────────────────────────────╮ │
│ │ _ = 2 │ │
│ │ self = <campaign.campaign_main.campaign_15_1.Campaign object at │ │
│ │ 0x0000025FF8565448> │ │
│ ╰────────────────────────────────────────────────────────────────────╯ │
│ │
│ E:\pythonProject\AzurLaneAutoScript\module\campaign\campaign_base.py:1 │
│ 00 in execute_a_battle │
│ │
│ 98 │ │ for _ in range(10): │
│ 99 │ │ │ try: │
│ ❱ 100 │ │ │ │ result = self.battle_function() │
│ 101 │ │ │ │ break │
│ 102 │ │ │ except MapEnemyMoved: │
│ │
│ ╭────────────────────────────── locals ──────────────────────────────╮ │
│ │ _ = 0 │ │
│ │ prev = 2 │ │
│ │ result = False │ │
│ │ self = <campaign.campaign_main.campaign_15_1.Campaign object at │ │
│ │ 0x0000025FF8565448> │ │
│ ╰────────────────────────────────────────────────────────────────────╯ │
│ │
│ E:\pythonProject\AzurLaneAutoScript\campaign\campaign_main\campaign_15 │
│ _1.py:77 in battle_function │
│ │
│ 75 │ │ │ return result │
│ 76 │ │ │
│ ❱ 77 │ │ return super().battle_function() │
│ 78 │ │
│ 79 │ def battle_0(self): │
│ │
│ ╭────────────────────────────── locals ──────────────────────────────╮ │
│ │ class = <class │ │
│ │ 'campaign.campaign_main.campaign_15_1.Campaign'> │ │
│ │ self = <campaign.campaign_main.campaign_15_1.Campaign object │ │
│ │ at 0x0000025FF8565448> │ │
│ ╰────────────────────────────────────────────────────────────────────╯ │
│ │
│ E:\pythonProject\AzurLaneAutoScript\module\base\decorator.py:70 in │
│ wrapper │
│ │
│ 68 │ │ │ │ │ │ continue │
│ 69 │ │ │ │ │ │
│ ❱ 70 │ │ │ │ │ return record['func'](self, *args, **kwargs) │
│ 71 │ │ │ │ │
│ 72 │ │ │ │ logger.warning(f'No option fits for {name}, usin │
│ func.') │
│ │
│ ╭────────────────────────────── locals ──────────────────────────────╮ │
│ │ args = () │ │
│ │ cls = <class 'module.base.decorator.Config'> │ │
│ │ flag = [True, True] │ │
│ │ func = <function CampaignBase.battle_function at │ │
│ │ 0x0000025FF836E288> │ │
│ │ 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 │ │
│ │ 0x0000025FF836E288> │ │
│ │ } │ │
│ │ self = <campaign.campaign_main.campaign_15_1.Campaign object at │ │
│ │ 0x0000025FF8565448> │ │
│ ╰────────────────────────────────────────────────────────────────────╯ │
│ │
│ E:\pythonProject\AzurLaneAutoScript\module\campaign\campaign_base.py:9 │
│ 0 in battle_function │
│ │
│ 88 │ │ func = self.getattribute(func) │
│ 89 │ │ │
│ ❱ 90 │ │ result = func() │
│ 91 │ │ │
│ 92 │ │ return result │
│ │
│ ╭────────────────────────────── locals ──────────────────────────────╮ │
│ │ extra_battle = 1 │ │
│ │ func = <bound method Campaign.battle_1 of │ │
│ │ <campaign.campaign_main.campaign_15_1.Campaign │ │
│ │ object at 0x0000025FF8565448>> │ │
│ │ self = <campaign.campaign_main.campaign_15_1.Campaign │ │
│ │ object at 0x0000025FF8565448> │ │
│ ╰────────────────────────────────────────────────────────────────────╯ │
│ │
│ E:\pythonProject\AzurLaneAutoScript\campaign\campaign_main\campaign_15 │
│ _1.py:92 in battle_1 │
│ │
│ 90 │ │
│ 91 │ def battle_1(self): │
│ ❱ 92 │ │ if self.clear_filter_enemy(self.ENEMY_FILTER, preserve=1 │
│ 93 │ │ │ return True │
│ 94 │
│ │
│ ╭────────────────────────────── locals ──────────────────────────────╮ │
│ │ self = <campaign.campaign_main.campaign_15_1.Campaign object at │ │
│ │ 0x0000025FF8565448> │ │
│ ╰────────────────────────────────────────────────────────────────────╯ │
│ │
│ E:\pythonProject\AzurLaneAutoScript\module\map\map.py:694 in │
│ clear_filter_enemy │
│ │
│ 692 │ │ if grids: │
│ 693 │ │ │ logger.hr('Clear filter enemy') │
│ ❱ 694 │ │ │ self.clear_chosen_enemy(grids[0]) │
│ 695 │ │ │ return True │
│ 696 │
│ │
│ ╭────────────────────────────── locals ──────────────────────────────╮ │
│ │ grids = [F5, C2, B3, B5] │ │
│ │ preserve = 1 │ │
│ │ self = <campaign.campaign_main.campaign_15_1.Campaign object │ │
│ │ at 0x0000025FF8565448> │ │
│ │ string = '1L > 1M > 1E > 1C > 2L > 2M > 2E > 2C > 3L > 3M > 3E > │ │
│ │ 3C' │ │
│ ╰────────────────────────────────────────────────────────────────────╯ │
│ │
│ E:\pythonProject\AzurLaneAutoScript\module\map\map.py:33 in │
│ clear_chosen_enemy │
│ │
│ 31 │ │ self.goto(grid, expected=expected) │
│ 32 │ │ │
│ ❱ 33 │ │ self.full_scan() │
│ 34 │ │ self.find_path_initial() │
│ 35 │ │ self.map.show_cost() │
│ │
│ ╭────────────────────────────── locals ──────────────────────────────╮ │
│ │ battle_count = 2 │ │
│ │ expected = 'combat' │ │
│ │ grid = F5 │ │
│ │ self = <campaign.campaign_main.campaign_15_1.Campaign │ │
│ │ object at 0x0000025FF8565448> │ │
│ ╰────────────────────────────────────────────────────────────────────╯ │
│ │
│ E:\pythonProject\AzurLaneAutoScript\module\map\fleet.py:550 in │
│ full_scan │
│ │
│ 548 │ │ super().full_scan( │
│ 549 │ │ │ queue=queue, must_scan=must_scan, battle_count=self │
│ mystery_count=self.mystery_count, │
│ ❱ 550 │ │ │ siren_count=self.siren_count, carrier_count=self.ca │
│ 551 │ │ │
│ 552 │ │ if self.config.FLEET_2 and not self.fleet_2_location: │
│ │
│ ╭────────────────────────────── locals ──────────────────────────────╮ │
│ │ class = <class 'module.map.fleet.Fleet'> │ │
│ │ mode = 'normal' │ │
│ │ must_scan = None │ │
│ │ queue = None │ │
│ │ self = <campaign.campaign_main.campaign_15_1.Campaign object │ │
│ │ at 0x0000025FF8565448> │ │
│ ╰────────────────────────────────────────────────────────────────────╯ │
│ │
│ E:\pythonProject\AzurLaneAutoScript\module\map\camera.py:434 in │
│ full_scan │
│ │
│ 432 │ │ │ │
│ 433 │ │ │ queue = queue.sort_by_camera_distance(self.camera) │
│ ❱ 434 │ │ │ self.focus_to(queue[0]) │
│ 435 │ │ │ self.focus_to_grid_center(0.25) │
│ 436 │ │ │ success = self.map.update(grids=self.view, camera=se │
│ │
│ ╭────────────────────────────── locals ──────────────────────────────╮ │
│ │ battle_count = 2 │ │
│ │ carrier_count = 0 │ │
│ │ mode = 'normal' │ │
│ │ must_scan = None │ │
│ │ mystery_count = 0 │ │
│ │ queue = <module.map.map_grids.SelectedGrids object at │ │
│ │ 0x0000025FF83DB508> │ │
│ │ self = <campaign.campaign_main.campaign_15_1.Campaign │ │
│ │ object at 0x0000025FF8565448> │ │
│ │ siren_count = 0 │ │
│ │ success = True │ │
│ ╰────────────────────────────────────────────────────────────────────╯ │
│ │
│ E:\pythonProject\AzurLaneAutoScript\module\map\camera.py:398 in │
│ focus_to │
│ │
│ 396 │ │ │ vector = np.array(location) - self.camera │
│ 397 │ │ │ swipe = tuple(np.min([np.abs(vector), swipe_limit], │
│ np.sign(vector)) │
│ ❱ 398 │ │ │ has_swiped = self.map_swipe(swipe) │
│ 399 │ │ │ │
│ 400 │ │ │ if not has_swiped: │
│ │
│ ╭────────────────────────────── locals ──────────────────────────────╮ │
│ │ location = (4, 4) │ │
│ │ self = <campaign.campaign_main.campaign_15_1.Campaign │ │
│ │ object at 0x0000025FF8565448> │ │
│ │ swipe = (2, 0) │ │
│ │ swipe_limit = (4, 3) │ │
│ │ vector = array([2, 0]) │ │
│ ╰────────────────────────────────────────────────────────────────────╯ │
│ │
│ E:\pythonProject\AzurLaneAutoScript\module\map\camera.py:85 in │
│ map_swipe │
│ │
│ 83 │ │ vector = np.array(vector) │
│ 84 │ │ vector = np.array([0.5, 0.5]) - self.view.center_offset │
│ ❱ 85 │ │ return self._map_swipe(vector) │
│ 86 │ │
│ 87 │ def focus_to_grid_center(self, tolerance=None): │
│ │
│ ╭────────────────────────────── locals ──────────────────────────────╮ │
│ │ self = <campaign.campaign_main.campaign_15_1.Campaign object at │ │
│ │ 0x0000025FF8565448> │ │
│ │ vector = array([2.00792201e+00, 1.88386272e-03]) │ │
│ ╰────────────────────────────────────────────────────────────────────╯ │
│ │
│ E:\pythonProject\AzurLaneAutoScript\campaign\campaign_main\campaign_15 │
│ _base.py:66 in _map_swipe │
│ │
│ 64 │ def _map_swipe(self, vector, box=(239, 159, 1175, 628)): │
│ 65 │ │ # Left border to 239, avoid swiping on support fleet │
│ ❱ 66 │ │ return super()._map_swipe(vector, box=box) │
│ 67 │ │
│ 68 │ def mob_movable(self, location, target): │
│ │
│ ╭────────────────────────────── locals ──────────────────────────────╮ │
│ │ class = <class │ │
│ │ 'campaign.campaign_main.campaign_15_base.CampaignBase… │ │
│ │ box = (239, 159, 1175, 628) │ │
│ │ self = <campaign.campaign_main.campaign_15_1.Campaign object │ │
│ │ at 0x0000025FF8565448> │ │
│ │ vector = array([2.00792201e+00, 1.88386272e-03]) │ │
│ ╰────────────────────────────────────────────────────────────────────╯ │
│ │
│ E:\pythonProject\AzurLaneAutoScript\module\map\camera.py:62 in │
│ _map_swipe │
│ │
│ 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: │
│ │
│ ╭────────────────────────────── locals ──────────────────────────────╮ │
│ │ blacklist = [] │ │
│ │ box = (239, 159, 1175, 628) │ │
│ │ distance = array([121.28647284, 85.8007154 ]) │ │
│ │ name = 'MAP_SWIPE_2_0' │ │
│ │ self = <campaign.campaign_main.campaign_15_1.Campaign object │ │
│ │ at 0x0000025FF8565448> │ │
│ │ vector = array([-2.43533778e+02, -1.61636769e-01]) │ │
│ │ whitelist = [ │ │
│ │ │ (599, 432, 681, 482), │ │
│ │ │ (120, 256, 173, 290), │ │
│ │ │ (142, 179, 191, 206), │ │
│ │ │ (956, 107, 1007, 129) │ │
│ │ ] │ │
│ ╰────────────────────────────────────────────────────────────────────╯ │
│ │
│ E:\pythonProject\AzurLaneAutoScript\module\map\camera.py:296 in update │
│ │
│ 294 │ │ │ # _update_view() │
│ 295 │ │ │ try: │
│ ❱ 296 │ │ │ │ success = self._update_view() │
│ 297 │ │ │ │ if not success: │
│ 298 │ │ │ │ │ continue │
│ │
│ ╭────────────────────────────── locals ──────────────────────────────╮ │
│ │ allow_error = False │ │
│ │ camera = True │ │
│ │ error_confirm = Timer(limit=5.361/5, count=27/10) │ │
│ │ is_grid_center = <function │ │
│ │ Camera.update.