AzurLaneAutoScript icon indicating copy to clipboard operation
AzurLaneAutoScript copied to clipboard

今天更新后日服运行隐秘海域报错

Open akyra0721 opened this issue 10 months ago • 7 comments

在提问之前...

  • [x] 我已经搜索了现有的 issues
  • [x] 我在提问题之前至少花费了 5 分钟来思考和准备
  • [x] 我已经阅读了 Wiki 中的 常见问题(FAQ)
  • [x] 我正在使用最新版的 Alas

描述你的问题

今天更新之后再运行隐秘海域一直会报一个NameError: name 'skip_first_screenshot' is not defined的错误

如何复现

  1. 前往 '大世界作战'
  2. 点击 '仓库'
  3. 滑动到 '最底部'
  4. 出现问题

预期行为

正常运行隐秘海域

相关 Logs

═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════
                                                      OPSIOBSCURE                                                      
═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════
2026-01-23 09:01:16.772 | INFO | NemuIpcImpl init, nemu_folder=D:\MuMuPlayer,                                          
ipc_dll=D:\MuMuPlayer\nx_device\12.0\shell\sdk\external_renderer_ipc.dll, instance_id=0, display_id=0                  
2026-01-23 09:01:16.778 | INFO | [Device Orientation] 1 (HOME key on the right)                                        
2026-01-23 09:01:16.795 | INFO | [Screen_size] 1280x720                                                                
2026-01-23 09:01:16.962 | INFO | ^ 10 1280 720 255                                                                     
2026-01-23 09:01:16.963 | INFO | $ 255                                                                                 
2026-01-23 09:01:16.964 | INFO | MaaTouch stream connected                                                             
2026-01-23 09:01:16.965 | INFO | max_contact: 10; max_x: 1280; max_y: 720; max_pressure: 255                           
2026-01-23 09:01:17.134 | INFO | early_ocr_import call                                                                 
═══════════════════════════════════════════════════════ OS INIT ═══════════════════════════════════════════════════════
2026-01-23 09:01:17.136 | INFO | early_ocr_import start                                                                
2026-01-23 09:01:17.137 | INFO | OS INIT                                                                               
2026-01-23 09:01:17.140 | INFO | Loading OCR dependencies                                                              
2026-01-23 09:01:17.212 | INFO | <<< UI ENSURE >>>                                                                     
2026-01-23 09:01:17.214 | INFO | UI get current page                                                                   
2026-01-23 09:01:17.236 | INFO | [UI] page_main                                                                        
2026-01-23 09:01:17.237 | INFO | Goto page_os                                                                          
2026-01-23 09:01:17.239 | INFO | <<< UI GOTO PAGE_OS >>>                                                               
2026-01-23 09:01:17.327 | INFO | Page switch: page_main_white -> page_campaign_menu                                    
2026-01-23 09:01:17.337 | INFO | Click (1174,  547) @ MAIN_GOTO_CAMPAIGN_WHITE                                         
2026-01-23 09:01:17.990 | INFO | early_ocr_import finish                                                               
2026-01-23 09:01:18.205 | INFO | Page switch: page_campaign_menu -> page_os                                            
2026-01-23 09:01:18.206 | INFO | Click ( 716,  405) @ CAMPAIGN_MENU_GOTO_OS                                            
2026-01-23 09:01:19.005 | INFO | Page arrive: page_os                                                                  
2026-01-23 09:01:19.006 | INFO | <<< ZONE INIT >>>                                                                     
2026-01-23 09:01:19.012 | INFO | Get zone name                                                                         
2026-01-23 09:01:19.051 | INFO | Loading OCR model: ./bin/cnocr_models/jp                                              
2026-01-23 09:01:19.151 | INFO | [MAP_NAME 0.114s] NA海域南西B安全海域                                                 
2026-01-23 09:01:19.153 | INFO | Map name processed: NA海域南西B                                                       
2026-01-23 09:01:19.155 | INFO | [Zone] [22|NA Ocean SW Sector B]                                                      
────────────────────────────────────────────────── AFTER AUTO SEARCH ──────────────────────────────────────────────────
2026-01-23 09:01:19.157 | INFO | AFTER AUTO SEARCH                                                                     
2026-01-23 09:01:19.171 | INFO | No EMP debuff on current fleet                                                        
2026-01-23 09:01:19.175 | INFO | [HP]  98%  98%  98%  98%  98%  98%                                                    
2026-01-23 09:01:19.179 | INFO | [Repair icon] [False, False, False, False, False, False]                              
2026-01-23 09:01:19.181 | INFO | No ship found to be below threshold 40%, continue OS exploration                      
2026-01-23 09:01:19.182 | INFO | Handle after auto search finished, solved=False                                       
2026-01-23 09:01:19.184 | INFO | Current fleet is not afflicted with the low resolve debuff                            
2026-01-23 09:01:19.186 | INFO | In zone 22, 44, 154, skip running first auto search                                   
2026-01-23 09:01:19.187 | INFO | Ash beacon status: light                                                              
2026-01-23 09:01:19.201 | INFO | Loading OCR model: ./bin/cnocr_models/azur_lane_jp                                    
2026-01-23 09:01:19.259 | INFO | [ASH_COLLECT_STATUS 0.071s] 200/200                                                   
2026-01-23 09:01:19.280 | INFO | [ASH_DAILY_STATUS 0.019s] 0/200                                                       
2026-01-23 09:01:19.282 | INFO | Ash beacon data reached the holding limit                                             
══════════════════════════════════════════════════ OS CLEAR OBSCURE ═══════════════════════════════════════════════════
2026-01-23 09:01:19.283 | INFO | OS CLEAR OBSCURE                                                                      
2026-01-23 09:01:19.284 | INFO | [OpsiNextReset] 2026-01-31 23:00:00                                                   
2026-01-23 09:01:19.286 | INFO | [ResetRemain] 8                                                                       
2026-01-23 09:01:19.314 | INFO | [SHOP_YELLOW_COINS 0.028s] 103895                                                     
2026-01-23 09:01:19.315 | INFO | Keep 1000 AP when CL1 available                                                       
2026-01-23 09:01:19.324 | INFO | Click ( 893,   38) @ ACTION_POINT_REMAIN_OS                                           
2026-01-23 09:01:19.683 | INFO | [Amount_ocr 0.072s] [22380, 41, 9, 4]                                                 
2026-01-23 09:01:19.707 | INFO | [ACTION_POINT_REMAIN 0.023s] 129                                                      
2026-01-23 09:01:19.708 | INFO | Action points: 129(1799), oil: 22380                                                  
2026-01-23 09:01:19.709 | INFO | Having 1000 action points                                                             
2026-01-23 09:01:19.719 | INFO | Click ( 440,  548) @ ACTION_POINT_CANCEL                                              
2026-01-23 09:01:20.011 | INFO | <<< OS GET NEXT OBSCURE >>>                                                           
2026-01-23 09:01:20.014 | INFO | Storage enter                                                                         
2026-01-23 09:01:20.039 | INFO | Click ( 831,  669) @ STORAGE_ENTER                                                    
2026-01-23 09:01:20.600 | INFO | <<< STORAGE LOGGER USE ALL >>>                                                        
2026-01-23 09:01:20.602 | INFO | STORATE_SCROLL set to 1.0                                                             
2026-01-23 09:01:20.604 | INFO | [STORATE_SCROLL] 0.00 (111.0-111.5)/(487-223)                                         
2026-01-23 09:01:20.606 | INFO | Swipe (1264,  225) -> (1258,  562)                                                    
2026-01-23 09:01:20.997 | INFO | [STORATE_SCROLL] 1.00 (375.0-111.5)/(487-223)                                         
2026-01-23 09:01:21.155 | INFO | [Storage_logger] 0                                                                    
2026-01-23 09:01:21.156 | INFO | All loggers in storage have been used                                                 
2026-01-23 09:01:21.157 | INFO | <<< STORAGE CHECKOUT ITEM OBSCURE >>>                                                 
2026-01-23 09:01:21.159 | ERROR | NameError: name 'skip_first_screenshot' is not defined                               
┌───────────────────────────────────────── Traceback (most recent call last) ─────────────────────────────────────────┐
│                                                                                                                     │
│ D:\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 = 'opsi_obscure'                                           │                                │
│ │                     e = NameError("name 'skip_first_screenshot' is not defined") │                                │
│ │                  self = <alas.AzurLaneAutoScript object at 0x000001308D363F88>   │                                │
│ │ skip_first_screenshot = False                                                    │                                │
│ └──────────────────────────────────────────────────────────────────────────────────┘                                │
│ D:\AzurLaneAutoScript\alas.py:319 in opsi_obscure                                                                   │
│                                                                                                                     │
│   316 │                                                                                                             │
│   317 │   def opsi_obscure(self):                                                                                   │
│   318 │   │   from module.campaign.os_run import OSCampaignRun                                                      │
│ > 319 │   │   OSCampaignRun(config=self.config, device=self.device).opsi_obscure()                                  │
│   320 │                                                                                                             │
│   321 │   def opsi_month_boss(self):                                                                                │
│   322 │   │   from module.campaign.os_run import OSCampaignRun                                                      │
│                                                                                                                     │
│ ┌──────────────────────────────── locals ────────────────────────────────┐                                          │
│ │ OSCampaignRun = <class 'module.campaign.os_run.OSCampaignRun'>         │                                          │
│ │          self = <alas.AzurLaneAutoScript object at 0x000001308D363F88> │                                          │
│ └────────────────────────────────────────────────────────────────────────┘                                          │
│                                                                                                                     │
│ D:\AzurLaneAutoScript\module\campaign\os_run.py:69 in opsi_obscure                                                  │
│                                                                                                                     │
│    66 │   def opsi_obscure(self):                                                                                   │
│    67 │   │   try:                                                                                                  │
│    68 │   │   │   campaign = self.load_campaign()                                                                   │
│ >  69 │   │   │   campaign.os_obscure()                                                                             │
│    70 │   │   except ActionPointLimit:                                                                              │
│    71 │   │   │   self.config.opsi_task_delay(ap_limit=True)                                                        │
│    72                                                                                                               │
│                                                                                                                     │
│ ┌────────────────────────────────────── locals ──────────────────────────────────────┐                              │
│ │ campaign = <module.os.operation_siren.OperationSiren object at 0x00000130A6184508> │                              │
│ │     self = <module.campaign.os_run.OSCampaignRun object at 0x00000130A4F3DF48>     │                              │
│ └────────────────────────────────────────────────────────────────────────────────────┘                              │
│                                                                                                                     │
│ D:\AzurLaneAutoScript\module\os\tasks\obscure.py:44 in os_obscure                                                   │
│                                                                                                                     │
│   41 │                                                                                                              │
│   42 │   def os_obscure(self):                                                                                      │
│   43 │   │   while True:                                                                                            │
│ > 44 │   │   │   self.clear_obscure()                                                                               │
│   45 │   │   │   if self.config.OpsiObscure_ForceRun:                                                               │
│   46 │   │   │   │   self.config.check_task_switch()                                                                │
│   47 │   │   │   │   continue                                                                                       │
│                                                                                                                     │
│ ┌──────────────────────────────────── locals ────────────────────────────────────┐                                  │
│ │ self = <module.os.operation_siren.OperationSiren object at 0x00000130A6184508> │                                  │
│ └────────────────────────────────────────────────────────────────────────────────┘                                  │
│                                                                                                                     │
│ D:\AzurLaneAutoScript\module\os\tasks\obscure.py:17 in clear_obscure                                                │
│                                                                                                                     │
│   14 │   │   if self.config.OpsiObscure_ForceRun:                                                                   │
│   15 │   │   │   logger.info('OS obscure finish is under force run')                                                │
│   16 │   │                                                                                                          │
│ > 17 │   │   result = self.storage_get_next_item('OBSCURE',                                                         │
│      use_logger=self.config.OpsiGeneral_UseLogger)                                                                  │
│   18 │   │   if not result:                                                                                         │
│   19 │   │   │   # No obscure coordinates, delay next run to tomorrow.                                              │
│   20 │   │   │   if get_os_reset_remain() > 0:                                                                      │
│                                                                                                                     │
│ ┌──────────────────────────────────── locals ────────────────────────────────────┐                                  │
│ │ self = <module.os.operation_siren.OperationSiren object at 0x00000130A6184508> │                                  │
│ └────────────────────────────────────────────────────────────────────────────────┘                                  │
│                                                                                                                     │
│ D:\AzurLaneAutoScript\module\os_handler\storage.py:253 in storage_get_next_item                                     │
│                                                                                                                     │
│   250 │   │   if use_logger:                                                                                        │
│   251 │   │   │   self.storage_logger_use_all()                                                                     │
│   252 │   │                                                                                                         │
│ > 253 │   │   result = self.storage_checkout_item(item)                                                             │
│   254 │   │   return result                                                                                         │
│   255                                                                                                               │
│                                                                                                                     │
│ ┌─────────────────────────────────────── locals ───────────────────────────────────────┐                            │
│ │       item = 'OBSCURE'                                                               │                            │
│ │       self = <module.os.operation_siren.OperationSiren object at 0x00000130A6184508> │                            │
│ │ use_logger = True                                                                    │                            │
│ └──────────────────────────────────────────────────────────────────────────────────────┘                            │
│                                                                                                                     │
│ D:\AzurLaneAutoScript\module\os_handler\storage.py:218 in storage_checkout_item                                     │
│                                                                                                                     │
│   215 │   │   """                                                                                                   │
│   216 │   │   logger.hr(f'Storage checkout item {item}')                                                            │
│   217 │   │   if SCROLL_STORAGE.appear(main=self):                                                                  │
│ > 218 │   │   │   SCROLL_STORAGE.set_top(main=self,                                                                 │
│       skip_first_screenshot=skip_first_screenshot)                                                                  │
│   219 │   │                                                                                                         │
│   220 │   │   confirm_timer = Timer(0.6, count=2).start()                                                           │
│   221 │   │   for _ in self.loop():                                                                                 │
│                                                                                                                     │
│ ┌──────────────────────────────────── locals ────────────────────────────────────┐                                  │
│ │ item = 'OBSCURE'                                                               │                                  │
│ │ self = <module.os.operation_siren.OperationSiren object at 0x00000130A6184508> │                                  │
│ └────────────────────────────────────────────────────────────────────────────────┘                                  │
└─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
NameError: name 'skip_first_screenshot' is not defined                                                                 
2026-01-23 09:01:21.365 | WARNING | Saving error: ./log/error/1769130081365

截图

Image

还有别的吗?

No response

akyra0721 avatar Jan 23 '26 01:01 akyra0721

Image我也遇到了

wx-dev avatar Jan 23 '26 02:01 wx-dev

运行深渊海域也会报一样的错误

akyra0721 avatar Jan 23 '26 03:01 akyra0721

+1

chimainguyenthanh-lab avatar Jan 23 '26 05:01 chimainguyenthanh-lab

+1

TsangAsuna avatar Jan 23 '26 08:01 TsangAsuna

+1

wei-jun7 avatar Jan 23 '26 09:01 wei-jun7

#5475

LmeSzinc avatar Jan 23 '26 09:01 LmeSzinc

#5475

emmm...没用啊,还是报错,问题出自AzurLaneAutoScript\module\os\operation_siren.py。大概是更新后这个文件代码改动太多导致的(从几百行直接优化到了40多行)

Image 豆包解释如下 <<<<<<< Updated upstream 是 Git 在代码合并时产生的冲突标记,不属于合法的 Python 代码,因此解释器无法识别。当 os_run.py 尝试导入 operation_siren 模块时,Python 解释器读取到这个非法标记,就会直接抛出语法错误,导致后续代码无法执行。

但是因为自动更新的缘故,每次选择采用当前更改,再次打开alas后又会被还原到图中的样子

239126487 avatar Jan 23 '26 10:01 239126487