AzurLaneAutoScript
AzurLaneAutoScript copied to clipboard
日服大世界开荒,似乎在出现“机关(两个舰队分别踩的那个)”时会报错
在提问之前...
- [X] 我已经搜索了现有的 issues
- [X] 我在提问题之前至少花费了 5 分钟来思考和准备
- [X] 我已经阅读了 Wiki 中的 常见问题(FAQ)
- [X] 我正在使用最新版的 Alas
描述你的问题
机关
这是我的配置
如何复现
使用脚本进行大世界开荒,清完图后,脚本扫描全图,然后卡住。
预期行为
有时不会卡住,不确定[不会卡住的时候]是否没有“机关”,但卡住的时候一定有“机关”。附上今天的log。 2024-01-02_alas.txt 2024-01-02_gui.txt
相关 Logs
MAP RESCAN FULL ─────────────────────────────
INFO 19:58:38.029 │ MAP RESCAN FULL
INFO 19:58:38.030 │ <<< MAP INIT >>>
INFO 19:58:38.032 │ Load map_data, has_loop=False, use_loop=False
INFO 19:58:38.033 │ Load spawn_data, has_loop=False, use_loop=False
INFO 19:58:38.034 │ grid_connection: wall=False, portal=False
INFO 19:58:38.039 │ Load mechanism, land_base=False, maze=False,
fortress=False, bouncing_enemy=False
INFO 19:58:38.384 │ tile_center: 0.925 (good match)
INFO 19:58:38.394 │ 0.084s edge_lines: 0 hori, 0 vert
INFO 19:58:38.395 │ Edges: homo_loca: ( 54, 58)
INFO 19:58:38.404 │ center_loca: (5, 4)
INFO 19:58:38.405 │ Camera: A1
INFO 19:58:38.494 │ 0.088s predict: 84
INFO 19:58:38.495 │ -- -- -- -- -- -- -- -- -- -- -- --
INFO 19:58:38.496 │ -- -- -- -- -- -- -- -- -- -- -- --
INFO 19:58:38.497 │ .. -- -- -- -- -- -- -- -- -- -- --
INFO 19:58:38.498 │ .. -- -- -- -- -- -- -- -- -- -- ..
INFO 19:58:38.499 │ .. -- -- -- -- FL -- -- -- -- -- ..
INFO 19:58:38.500 │ .. -- -- -- -- -- -- -- -- -- -- ..
INFO 19:58:38.501 │ .. -- -- -- -- -- -- -- -- -- -- ..
INFO 19:58:38.503 │ .. .. -- -- -- -- -- -- -- -- -- ..
INFO 19:58:38.506 │ [HP] 98% 98% 98% 95% 92% 98%
INFO 19:58:38.510 │ [Repair icon] [False, False, False, False, False,
False]
INFO 19:58:38.511 │ Ensure edge in sight.
INFO 19:58:38.511 │ Map swipe: (6, 5)
INFO 19:58:38.513 │ Swipe ( 946, 571) -> ( 258, 165)
WARNING 19:58:39.511 │ Image to detect is not in_map
WARNING 19:58:39.808 │ Image to detect is not in_map
INFO 19:58:40.358 │ tile_center: 0.929 (good match)
INFO 19:58:40.370 │ 0.083s edge_lines: 2 hori, 0 vert
INFO 19:58:40.371 │ Edges: _ homo_loca: ( 58, 62)
INFO 19:58:40.378 │ center_loca: (5, 4)
INFO 19:58:40.380 │ Camera: G6
INFO 19:58:40.381 │ camera_corrected: G6 -> G12
INFO 19:58:40.382 │ Camera: G12
INFO 19:58:40.449 │ 0.065s predict: 65
INFO 19:58:40.451 │ -- -- -- -- -- -- -- -- -- -- -- --
INFO 19:58:40.452 │ -- -- -- -- -- -- -- -- -- -- -- --
INFO 19:58:40.453 │ .. -- -- -- -- -- -- -- -- -- -- --
INFO 19:58:40.454 │ .. -- -- -- -- -- -- -- -- -- -- ..
INFO 19:58:40.456 │ .. -- -- -- -- -- -- -- -- -- -- ..
INFO 19:58:40.456 │ .. -- -- FM -- -- -- -- -- -- -- ..
INFO 19:58:40.458 │ Map swipe: (6, 0)
INFO 19:58:40.460 │ Swipe ( 963, 484) -> ( 271, 482)
WARNING 19:58:41.396 │ Image to detect is not in_map
WARNING 19:58:41.746 │ Image to detect is not in_map
WARNING 19:58:42.001 │ Image to detect is not in_map
WARNING 19:58:42.301 │ Image to detect is not in_map
WARNING 19:58:42.617 │ Image to detect is not in_map
WARNING 19:58:42.917 │ Image to detect is not in_map
WARNING 19:58:43.200 │ Image to detect is not in_map
WARNING 19:58:43.505 │ Image to detect is not in_map
WARNING 19:58:43.800 │ Image to detect is not in_map
WARNING 19:58:44.104 │ Image to detect is not in_map
WARNING 19:58:44.404 │ Image to detect is not in_map
WARNING 19:58:44.707 │ Image to detect is not in_map
WARNING 19:58:45.004 │ Image to detect is not in_map
WARNING 19:58:45.328 │ Image to detect is not in_map
WARNING 19:58:45.624 │ Image to detect is not in_map
WARNING 19:58:45.907 │ Image to detect is not in_map
WARNING 19:58:46.212 │ Image to detect is not in_map
WARNING 19:58:46.510 │ Image to detect is not in_map
ERROR 19:58:46.526 │ MapDetectionError: Image to detect is not in_map
╭────────────── Traceback (most recent call last) ───────────────╮
│ │
│ D:\Program Files │
│ (x86)\AlasApp_0.4.4_fullcn\AzurLaneAutoScript\alas.py:68 in │
│ run │
│ │
│ 66 │ │ try: │
│ 67 │ │ │ self.device.screenshot() │
│ ❱ 68 │ │ │ self.__getattribute__(command)() │
│ 69 │ │ │ return True │
│ 70 │ │ except TaskEnd: │
│ │
│ ╭────────────────────────── locals ──────────────────────────╮ │
│ │ command = 'opsi_explore' │ │
│ │ e = MapDetectionError('Image to detect is not │ │
│ │ in_map') │ │
│ │ self = <alas.AzurLaneAutoScript object at │ │
│ │ 0x000001EC53013BC8> │ │
│ ╰────────────────────────────────────────────────────────────╯ │
│ D:\Program Files │
│ (x86)\AlasApp_0.4.4_fullcn\AzurLaneAutoScript\alas.py:294 in │
│ opsi_explore │
│ │
│ 292 │ def opsi_explore(self): │
│ 293 │ │ from module.campaign.os_run import OSCampaignRun │
│ ❱ 294 │ │ OSCampaignRun(config=self.config, device=self.de │
│ 295 │ │
│ 296 │ def opsi_shop(self): │
│ │
│ ╭────────────────────────── locals ──────────────────────────╮ │
│ │ OSCampaignRun = <class │ │
│ │ 'module.campaign.os_run.OSCampaignRun'> │ │
│ │ self = <alas.AzurLaneAutoScript object at │ │
│ │ 0x000001EC53013BC8> │ │
│ ╰────────────────────────────────────────────────────────────╯ │
│ │
│ D:\Program Files (x86)\AlasApp_0.4.4_fullcn\AzurLaneAutoScript │
│ \module\campaign\os_run.py:27 in opsi_explore │
│ │
│ 25 │ │ try: │
│ 26 │ │ │ self.load_campaign() │
│ ❱ 27 │ │ │ self.campaign.os_explore() │
│ 28 │ │ except ActionPointLimit: │
│ 29 │ │ │ self.config.opsi_task_delay(ap_limit=True) │
│ │
│ ╭────────────────────────── locals ──────────────────────────╮ │
│ │ self = <module.campaign.os_run.OSCampaignRun object at │ │
│ │ 0x000001EC1A7860C8> │ │
│ ╰────────────────────────────────────────────────────────────╯ │
│ │
│ D:\Program Files (x86)\AlasApp_0.4.4_fullcn\AzurLaneAutoScript │
│ \module\os\operation_siren.py:525 in os_explore │
│ │
│ 523 │ │ for _ in range(2): │
│ 524 │ │ │ try: │
│ ❱ 525 │ │ │ │ self._os_explore() │
│ 526 │ │ │ except OSExploreError: │
│ 527 │ │ │ │ logger.info('Go back to NY, explore agai │
│ │
│ ╭────────────────────────── locals ──────────────────────────╮ │
│ │ _ = 0 │ │
│ │ self = <module.os.operation_siren.OperationSiren object at │ │
│ │ 0x000001EC19F1FE08> │ │
│ ╰────────────────────────────────────────────────────────────╯ │
│ │
│ D:\Program Files (x86)\AlasApp_0.4.4_fullcn\AzurLaneAutoScript │
│ \module\os\operation_siren.py:514 in _os_explore │
│ │
│ 512 │ │ │ │ submarine_call=self.config.OpsiFleet_Sub │
│ 513 │ │ │ self._os_explore_task_delay() │
│ ❱ 514 │ │ │ self.run_auto_search() │
│ 515 │ │ │ self.config.OpsiExplore_LastZone = zone │
│ 516 │ │ │ logger.info(f'Zone cleared: {self.name_to_zo │
│ │
│ ╭────────────────────────── locals ──────────────────────────╮ │
│ │ end = <function │ │
│ │ OperationSiren._os_explore.<locals>.end at │ │
│ │ 0x000001EC1AF4A798> │ │
│ │ last_zone = 63 │ │
│ │ order = [ │ │
│ │ │ 64, │ │
│ │ │ 13, │ │
│ │ │ 12, │ │
│ │ │ 101, │ │
│ │ │ 102, │ │
│ │ │ 144, │ │
│ │ │ 124, │ │
│ │ │ 71, │ │
│ │ │ 73, │ │
│ │ │ 11, │ │
│ │ │ ... +11 │ │
│ │ ] │ │
│ │ self = <module.os.operation_siren.OperationSiren │ │
│ │ object at 0x000001EC19F1FE08> │ │
│ │ zone = 13 │ │
│ ╰────────────────────────────────────────────────────────────╯ │
│ │
│ D:\Program Files (x86)\AlasApp_0.4.4_fullcn\AzurLaneAutoScript │
│ \module\os\map.py:708 in run_auto_search │
│ │
│ 706 │ │ │ │ self.clear_question(drop=drop) │
│ 707 │ │ │ if rescan: │
│ ❱ 708 │ │ │ │ self.map_rescan(rescan_mode=rescan, drop │
│ 709 │ │ │ │
│ 710 │ │ │ if drop.count == 1: │
│ │
│ ╭────────────────────────── locals ──────────────────────────╮ │
│ │ after_auto_search = True │ │
│ │ drop = <module.statistics.azurstats.DropImage │ │
│ │ object at 0x000001EC1AC6A7C8> │ │
│ │ prev = [13|Caribbean Sea C] │ │
│ │ question = True │ │
│ │ rescan = 'full' │ │
│ │ self = <module.os.operation_siren.OperationS… │ │
│ │ object at 0x000001EC19F1FE08> │ │
│ ╰────────────────────────────────────────────────────────────╯ │
│ │
│ D:\Program Files (x86)\AlasApp_0.4.4_fullcn\AzurLaneAutoScript │
│ \module\os\map.py:880 in map_rescan │
│ │
│ 878 │ │ │ │ self.fleet_set(self.config.OpsiFleet_Fle │
│ 879 │ │ │ │ return False │
│ ❱ 880 │ │ │ result = self.map_rescan_once(rescan_mode=re │
│ 881 │ │ │ if not result: │
│ 882 │ │ │ │ logger.attr('Solved_map_event', self._so │
│ │
│ ╭────────────────────────── locals ──────────────────────────╮ │
│ │ _ = 0 │ │
│ │ drop = <module.statistics.azurstats.DropImage │ │
│ │ object at 0x000001EC1AC6A7C8> │ │
│ │ rescan_mode = 'full' │ │
│ │ self = <module.os.operation_siren.OperationSiren │ │
│ │ object at 0x000001EC19F1FE08> │ │
│ ╰────────────────────────────────────────────────────────────╯ │
│ │
│ D:\Program Files (x86)\AlasApp_0.4.4_fullcn\AzurLaneAutoScript │
│ \module\os\map.py:849 in map_rescan_once │
│ │
│ 847 │ │ if rescan_mode == 'full': │
│ 848 │ │ │ logger.hr('Map rescan full', level=2) │
│ ❱ 849 │ │ │ self.map_init(map_=None) │
│ 850 │ │ │ queue = self.map.camera_data │
│ 851 │ │ │ while len(queue) > 0: │
│ │
│ ╭────────────────────────── locals ──────────────────────────╮ │
│ │ drop = <module.statistics.azurstats.DropImage │ │
│ │ object at 0x000001EC1AC6A7C8> │ │
│ │ rescan_mode = 'full' │ │
│ │ result = False │ │
│ │ self = <module.os.operation_siren.OperationSiren │ │
│ │ object at 0x000001EC19F1FE08> │ │
│ ╰────────────────────────────────────────────────────────────╯ │
│ │
│ D:\Program Files (x86)\AlasApp_0.4.4_fullcn\AzurLaneAutoScript │
│ \module\map\fleet.py:836 in map_init │
│ │
│ 834 │ │ logger.hr('Map init') │
│ 835 │ │ self.map_data_init(map_) │
│ ❱ 836 │ │ self.map_control_init() │
│ 837 │ │
│ 838 │ def map_data_init(self, map_): │
│ │
│ ╭────────────────────────── locals ──────────────────────────╮ │
│ │ map_ = None │ │
│ │ self = <module.os.operation_siren.OperationSiren object at │ │
│ │ 0x000001EC19F1FE08> │ │
│ ╰────────────────────────────────────────────────────────────╯ │
│ │
│ D:\Program Files (x86)\AlasApp_0.4.4_fullcn\AzurLaneAutoScript │
│ \module\os\fleet.py:97 in map_control_init │
│ │
│ 95 │ │ self.lv_reset() │
│ 96 │ │ self.lv_get() │
│ ❱ 97 │ │ self.ensure_edge_insight(preset=self.map.in_map_ │
│ swipe_limit=(6, 5)) │
│ 98 │ │ # self.full_scan(must_scan=self.map.camera_data_ │
│ 99 │ │ # self.find_current_fleet() │
│ │
│ ╭────────────────────────── locals ──────────────────────────╮ │
│ │ self = <module.os.operation_siren.OperationSiren object at │ │
│ │ 0x000001EC19F1FE08> │ │
│ ╰────────────────────────────────────────────────────────────╯ │
│ │
│ D:\Program Files (x86)\AlasApp_0.4.4_fullcn\AzurLaneAutoScript │
│ \module\map\camera.py:313 in ensure_edge_insight │
│ │
│ 311 │ │ │ if len(record) > 0: │
│ 312 │ │ │ │ # Swipe even if two edges insight, this │
│ camera position. │
│ ❱ 313 │ │ │ │ self.map_swipe((x, y)) │
│ 314 │ │ │ │
│ 315 │ │ │ record.append((x, y)) │
│ │
│ ╭────────────────────────── locals ──────────────────────────╮ │
│ │ preset = None │ │
│ │ record = [(6, 5), (6, 5)] │ │
│ │ reverse = False │ │
│ │ self = <module.os.operation_siren.OperationS… │ │
│ │ object at 0x000001EC19F1FE08> │ │
│ │ skip_first_update = True │ │
│ │ swipe_limit = (6, 5) │ │
│ │ x = 6 │ │
│ │ x_swipe = 6 │ │
│ │ y = 0 │ │
│ │ y_swipe = 5 │ │
│ ╰────────────────────────────────────────────────────────────╯ │
│ │
│ D:\Program Files (x86)\AlasApp_0.4.4_fullcn\AzurLaneAutoScript │
│ \module\map\camera.py:84 in map_swipe │
│ │
│ 82 │ │ vector = np.array(vector) │
│ 83 │ │ vector = np.array([0.5, 0.5]) - self.view.center │
│ ❱ 84 │ │ return self._map_swipe(vector) │
│ 85 │ │
│ 86 │ def focus_to_grid_center(self, tolerance=None): │
│ │
│ ╭────────────────────────── locals ──────────────────────────╮ │
│ │ self = <module.os.operation_siren.OperationSiren object │ │
│ │ at 0x000001EC19F1FE08> │ │
│ │ vector = array([6.02681405, 0.02216506]) │ │
│ ╰────────────────────────────────────────────────────────────╯ │
│ │
│ D:\Program Files (x86)\AlasApp_0.4.4_fullcn\AzurLaneAutoScript │
│ \module\os\camera.py:20 in _map_swipe │
│ │
│ 18 │ │
│ 19 │ def _map_swipe(self, vector, box=(239, 128, 993, 628 │
│ ❱ 20 │ │ return super()._map_swipe(vector, box=box) │
│ 21 │ │
│ 22 │ def _view_init(self): │
│ │
│ ╭────────────────────────── locals ──────────────────────────╮ │
│ │ __class__ = <class 'module.os.camera.OSCamera'> │ │
│ │ box = (239, 128, 993, 628) │ │
│ │ self = <module.os.operation_siren.OperationSiren │ │
│ │ object at 0x000001EC19F1FE08> │ │
│ │ vector = array([6.02681405, 0.02216506]) │ │
│ ╰────────────────────────────────────────────────────────────╯ │
│ │
│ D:\Program Files (x86)\AlasApp_0.4.4_fullcn\AzurLaneAutoScript │
│ \module\map\camera.py:61 in _map_swipe │
│ │
│ 59 │ │ │ self.device.swipe_vector(vector, name=name, │
│ whitelist_area=whitelist, blacklist_area=blacklist) │
│ 60 │ │ │ self.device.sleep(0.3) │
│ ❱ 61 │ │ │ self.update() │
│ 62 │ │ │ return True │
│ 63 │ │ else: │
│ │
│ ╭────────────────────────── locals ──────────────────────────╮ │
│ │ blacklist = [] │ │
│ │ box = (239, 128, 993, 628) │ │
│ │ distance = array([114.76394165, 81.48932461]) │ │
│ │ name = 'MAP_SWIPE_6_0' │ │
│ │ self = <module.os.operation_siren.OperationSiren │ │
│ │ object at 0x000001EC19F1FE08> │ │
│ │ vector = array([-691.66093646, -1.80621575]) │ │
│ │ whitelist = [] │ │
│ ╰────────────────────────────────────────────────────────────╯ │
│ │
│ D:\Program Files (x86)\AlasApp_0.4.4_fullcn\AzurLaneAutoScript │
│ \module\map\camera.py:261 in update │
│ │
│ 259 │ │ while 1: │
│ 260 │ │ │ try: │
│ ❱ 261 │ │ │ │ success = self._update(camera=camera) │
│ 262 │ │ │ │ if success: │
│ 263 │ │ │ │ │ break │
│ │
│ ╭────────────────────────── locals ──────────────────────────╮ │
│ │ allow_error = False │ │
│ │ camera = True │ │
│ │ confirm_timer = Timer(limit=5.215/5, count=18/10) │ │
│ │ self = <module.os.operation_siren.OperationSiren │ │
│ │ object at 0x000001EC19F1FE08> │ │
│ ╰────────────────────────────────────────────────────────────╯ │
│ │
│ D:\Program Files (x86)\AlasApp_0.4.4_fullcn\AzurLaneAutoScript │
│ \module\map\camera.py:199 in _update │
│ │
│ 197 │ │ │ │ │ return False │
│ 198 │ │ │ │ else: │
│ ❱ 199 │ │ │ │ │ raise e │
│ 200 │ │ │ elif 'Camera outside map' in str(e): │
│ 201 │ │ │ │ string = str(e) │
│ │
│ ╭────────────────────────── locals ──────────────────────────╮ │
│ │ camera = True │ │
│ │ self = <module.os.operation_siren.OperationSiren object │ │
│ │ at 0x000001EC19F1FE08> │ │
│ ╰────────────────────────────────────────────────────────────╯ │
│ │
│ D:\Program Files (x86)\AlasApp_0.4.4_fullcn\AzurLaneAutoScript │
│ \module\map\camera.py:124 in _update │
│ │
│ 122 │ │ │ │ │ and not self.is_in_strategy_submarin │
│ 123 │ │ │ │ logger.warning('Image to detect is not i │
│ ❱ 124 │ │ │ │ raise MapDetectionError('Image to detect │
│ 125 │ │ │ self.view.load(self.device.image) │
│ 126 │ │ except MapDetectionError as e: │
│ │
│ ╭────────────────────────── locals ──────────────────────────╮ │
│ │ camera = True │ │
│ │ self = <module.os.operation_siren.OperationSiren object │ │
│ │ at 0x000001EC19F1FE08> │ │
│ ╰────────────────────────────────────────────────────────────╯ │
╰────────────────────────────────────────────────────────────────╯
MapDetectionError: Image to detect is not in_map
WARNING 19:58:47.467 │ Saving error: ./log/error/1704196727467
INFO 19:58:47.572 │ No provider specified, skip sending
截图
No response
还有别的吗?
No response
Image to detect is not in_map,跳黄鸡了?