AzurLaneAutoScript icon indicating copy to clipboard operation
AzurLaneAutoScript copied to clipboard

AttributeError: 'Campaign' object has no attribute 'equip_enter'

Open foglantern opened this issue 2 years ago • 3 comments

在提问之前...

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

描述你的问题

强化过程中报错

分支: dev

如何复现

No response

预期行为

No response

相关 Logs

═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════
                                                         MAIN3                                                         
═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════
════════════════════════════════════════════════════ CAMPAIGN_12_4 ════════════════════════════════════════════════════
2024-04-19 13:44:34.599 | INFO | CAMPAIGN_12_4                                                                         
2024-04-19 13:44:34.601 | INFO | Count: 0                                                                              
2024-04-19 13:44:34.605 | INFO | Image save success, file: ./screenshots/research/1713505474368.png                    
2024-04-19 13:44:34.612 | INFO | <<< UI ENSURE >>>                                                                     
2024-04-19 13:44:34.614 | INFO | UI get current page                                                                   
2024-04-19 13:44:34.625 | INFO | [UI] page_research                                                                    
2024-04-19 13:44:34.627 | INFO | Goto page_campaign                                                                    
2024-04-19 13:44:34.629 | INFO | <<< UI GOTO PAGE_CAMPAIGN >>>                                                         
2024-04-19 13:44:34.641 | INFO | Page switch: page_research -> page_main                                               
2024-04-19 13:44:34.643 | INFO | Click (1238,   43) @ GOTO_MAIN                                                        
2024-04-19 13:44:37.351 | INFO | Page switch: page_main -> page_campaign_menu                                          
2024-04-19 13:44:37.353 | INFO | Click (1040,  349) @ MAIN_GOTO_CAMPAIGN                                               
2024-04-19 13:44:37.751 | INFO | Page switch: page_campaign_menu -> page_campaign                                      
2024-04-19 13:44:37.753 | INFO | Click ( 260,  346) @ CAMPAIGN_MENU_GOTO_CAMPAIGN                                      
2024-04-19 13:44:37.950 | INFO | Page arrive: page_campaign                                                            
2024-04-19 13:44:37.974 | INFO | [Mode_switch_1] hard                                                                  
2024-04-19 13:44:37.976 | INFO | <<< UI ENSURE INDEX >>>                                                               
2024-04-19 13:44:38.005 | INFO | No stage found.                                                                       
2024-04-19 13:44:38.177 | INFO | No stage found.                                                                       
2024-04-19 13:44:38.377 | INFO | No stage found.                                                                       
2024-04-19 13:44:38.584 | INFO | No stage found.                                                                       
2024-04-19 13:44:38.801 | INFO | [campaign 0.020s] ['12--1', '12--3', '12--2', '12--4']                                
2024-04-19 13:44:38.804 | INFO | [Chapter] 12                                                                          
2024-04-19 13:44:38.805 | INFO | [Stage] 12-1, 12-3, 12-2, 12-4                                                        
2024-04-19 13:44:38.807 | INFO | [Index] 12                                                                            
2024-04-19 13:44:38.838 | INFO | [OCR_OIL 0.016s] 8285                                                                 
──────────────────────────────────────────────────────── 12-4 ─────────────────────────────────────────────────────────
2024-04-19 13:44:38.842 | INFO | 12-4                                                                                  
2024-04-19 13:44:38.844 | INFO | Expect emotion reduce: (12, 2)                                                        
2024-04-19 13:44:38.855 | INFO | Bind task ['General', 'Alas', 'Main3']                                                
2024-04-19 13:44:38.856 | INFO | Save config ./config/alas.json, Main3.Emotion.Fleet1Value=150,                        
Main3.Emotion.Fleet1Record=datetime.datetime(2024, 4, 19, 13, 44, 38), Main3.Emotion.Fleet2Value=119,                  
Main3.Emotion.Fleet2Record=datetime.datetime(2024, 4, 19, 13, 44, 38)                                                  
2024-04-19 13:44:38.866 | INFO | [Emotion fleet_1] 150                                                                 
2024-04-19 13:44:38.867 | INFO | [Emotion fleet_2] 119                                                                 
2024-04-19 13:44:38.869 | INFO | <<< ENTER MAP >>>                                                                     
2024-04-19 13:44:38.897 | INFO | Click ( 909,  550) @ 12-4                                                             
2024-04-19 13:44:39.380 | INFO | [Map_clear_percentage] 0.36046511627906974                                            
2024-04-19 13:44:39.584 | INFO | [Map_clear_percentage] 0.7703488372093024                                             
2024-04-19 13:44:39.785 | INFO | [Map_clear_percentage] 0.997093023255814                                              
2024-04-19 13:44:39.787 | INFO | [MAP_CLEAR_ALL_THIS_TIME] False                                                       
2024-04-19 13:44:39.789 | INFO | [Map_info] 99%, star_1, star_2, star_3, 100_percent_clear, 3_stars, threat_safe,      
clear_mode                                                                                                             
2024-04-19 13:44:39.791 | INFO | [StopCondition_MapAchievement] non_stop                                               
2024-04-19 13:44:39.793 | INFO | [Fast_Forward] on                                                                     
2024-04-19 13:44:39.804 | INFO | [Auto_Search] off                                                                     
2024-04-19 13:44:39.807 | INFO | Click ( 961,  516) @ MAP_PREPARATION                                                  
2024-04-19 13:44:39.986 | INFO | Click ( 847,  508) @ RETIRE_APPEAR_3                                                  
2024-04-19 13:44:41.629 | INFO | <<< ENHANCEMENT BY TYPE >>>                                                           
2024-04-19 13:44:41.631 | INFO | [Enhance Order] [None]                                                                
2024-04-19 13:44:41.633 | INFO | Favourite=False, Ship Type=None                                                       
2024-04-19 13:44:41.635 | INFO | <<< UI CLICK >>>                                                                      
2024-04-19 13:44:41.643 | INFO | Click (1161,   22) @ DOCK_FILTER                                                      
2024-04-19 13:44:42.039 | INFO | Setting DOCK options,                                                                 
2024-04-19 13:44:42.048 | INFO | [DOCK] sort/level, index/all, faction/all, rarity/all, extra/enhanceable              
2024-04-19 13:44:42.056 | INFO | Click ( 314,  489) @ FILTER_EXTRA_0_0                                                 
2024-04-19 13:44:42.234 | INFO | [DOCK] sort/level, index/all, faction/all, rarity/all, extra/no_limit                 
2024-04-19 13:44:42.240 | INFO | Setting DOCK options, sort='level', index='all', faction='all', rarity='all',         
extra='enhanceable'                                                                                                    
2024-04-19 13:44:42.247 | INFO | [DOCK] sort/level, index/all, faction/all, rarity/all, extra/no_limit                 
2024-04-19 13:44:42.253 | INFO | Click ( 727,  491) @ FILTER_EXTRA_3_0                                                 
2024-04-19 13:44:42.440 | INFO | [DOCK] sort/level, index/all, faction/all, rarity/all, extra/enhanceable              
2024-04-19 13:44:42.447 | INFO | <<< UI CLICK >>>                                                                      
2024-04-19 13:44:42.451 | INFO | Click ( 774,  636) @ DOCK_FILTER_CONFIRM                                              
2024-04-19 13:44:43.928 | ERROR | AttributeError: 'Campaign' object has no attribute 'equip_enter'                     
╭───────────────────────────────────────── Traceback (most recent call last) ─────────────────────────────────────────╮
│                                                                                                                     │
│ /home/finch/workspace/python/AzurLaneAutoScript/alas.py:68 in run                                                   │
│                                                                                                                     │
│    65 │   def run(self, command):                                                                                   │
│    66 │   │   try:                                                                                                  │
│    67 │   │   │   self.device.screenshot()                                                                          │
│ ❱  68 │   │   │   self.__getattribute__(command)()                                                                  │
│    69 │   │   │   return True                                                                                       │
│    70 │   │   except TaskEnd:                                                                                       │
│    71 │   │   │   return True                                                                                       │
│                                                                                                                     │
│ ╭─────────────────────────────────── locals ───────────────────────────────────╮                                    │
│ │ command = 'main3'                                                            │                                    │
│ │       e = AttributeError("'Campaign' object has no attribute 'equip_enter'") │                                    │
│ │    self = <alas.AzurLaneAutoScript object at 0x7ea479b1f2d0>                 │                                    │
│ ╰──────────────────────────────────────────────────────────────────────────────╯                                    │
│ /home/finch/workspace/python/AzurLaneAutoScript/alas.py:353 in main3                                                │
│                                                                                                                     │
│   350 │   def main3(self):                                                                                          │
│   351 │   │   from module.campaign.run import CampaignRun                                                           │
│   352 │   │   CampaignRun(config=self.config, device=self.device).run(                                              │
│ ❱ 353 │   │   │   name=self.config.Campaign_Name, folder=self.config.Campaign_Event,                                │
│       mode=self.config.Campaign_Mode)                                                                               │
│   354 │                                                                                                             │
│   355 │   def event(self):                                                                                          │
│   356 │   │   from module.campaign.run import CampaignRun                                                           │
│                                                                                                                     │
│ ╭───────────────────────────── locals ─────────────────────────────╮                                                │
│ │ CampaignRun = <class 'module.campaign.run.CampaignRun'>          │                                                │
│ │        self = <alas.AzurLaneAutoScript object at 0x7ea479b1f2d0> │                                                │
│ ╰──────────────────────────────────────────────────────────────────╯                                                │
│                                                                                                                     │
│ /home/finch/workspace/python/AzurLaneAutoScript/module/campaign/run.py:381 in run                                   │
│                                                                                                                     │
│   378 │   │   │   self.device.stuck_record_clear()                                                                  │
│   379 │   │   │   self.device.click_record_clear()                                                                  │
│   380 │   │   │   try:                                                                                              │
│ ❱ 381 │   │   │   │   self.campaign.run()                                                                           │
│   382 │   │   │   except ScriptEnd as e:                                                                            │
│   383 │   │   │   │   logger.hr('Script end')                                                                       │
│   384 │   │   │   │   logger.info(str(e))                                                                           │
│                                                                                                                     │
│ ╭────────────────────────────── locals ───────────────────────────────╮                                             │
│ │ folder = 'campaign_main'                                            │                                             │
│ │   mode = 'normal'                                                   │                                             │
│ │   name = 'campaign_12_4'                                            │                                             │
│ │   self = <module.campaign.run.CampaignRun object at 0x7ea467ef5fd0> │                                             │
│ │  total = 0                                                          │                                             │
│ ╰─────────────────────────────────────────────────────────────────────╯                                             │
│                                                                                                                     │
│ /home/finch/workspace/python/AzurLaneAutoScript/module/campaign/campaign_base.py:125 in run                         │
│                                                                                                                     │
│   122 │   │   # Enter map                                                                                           │
│   123 │   │   self.emotion.check_reduce(self._map_battle)                                                           │
│   124 │   │   self.ENTRANCE.area = self.ENTRANCE.button                                                             │
│ ❱ 125 │   │   self.enter_map(self.ENTRANCE, mode=self.config.Campaign_Mode)                                         │
│   126 │   │                                                                                                         │
│   127 │   │   # Map init                                                                                            │
│   128 │   │   if not self.map_is_auto_search:                                                                       │
│                                                                                                                     │
│ ╭──────────────────────────────────── locals ─────────────────────────────────────╮                                 │
│ │ self = <campaign.campaign_main.campaign_12_4.Campaign object at 0x7ea467b8b050> │                                 │
│ ╰─────────────────────────────────────────────────────────────────────────────────╯                                 │
│                                                                                                                     │
│ /home/finch/workspace/python/AzurLaneAutoScript/module/map/map_operation.py:191 in enter_map                        │
│                                                                                                                     │
│   188 │   │   │   │   │   continue                                                                                  │
│   189 │   │   │   │                                                                                                 │
│   190 │   │   │   │   # Retire                                                                                      │
│ ❱ 191 │   │   │   │   if self.handle_retirement():                                                                  │
│   192 │   │   │   │   │   continue                                                                                  │
│   193 │   │   │   │                                                                                                 │
│   194 │   │   │   │   # Use Data Key                                                                                │
│                                                                                                                     │
│ ╭───────────────────────────────────────────── locals ─────────────────────────────────────────────╮                │
│ │                button = 12-4                                                                     │                │
│ │        campaign_click = 1                                                                        │                │
│ │        campaign_timer = Timer(limit=4.352/5, count=2/0)                                          │                │
│ │        checked_in_map = True                                                                     │                │
│ │                  drop = <module.statistics.azurstats.DropImage object at 0x7ea47528c410>         │                │
│ │           fleet_click = 0                                                                        │                │
│ │           fleet_timer = Timer(limit=0.0/5, count=8/0)                                            │                │
│ │             map_click = 1                                                                        │                │
│ │             map_timer = Timer(limit=4.352/5, count=3/0)                                          │                │
│ │                  mode = 'normal'                                                                 │                │
│ │                  self = <campaign.campaign_main.campaign_12_4.Campaign object at 0x7ea467b8b050> │                │
│ │ skip_first_screenshot = False                                                                    │                │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯                │
│                                                                                                                     │
│ /home/finch/workspace/python/AzurLaneAutoScript/module/retire/retirement.py:347 in handle_retirement                │
│                                                                                                                     │
│   344 │   │   │   │   return False                                                                                  │
│   345 │   │   │   if self.appear(DOCK_CHECK, offset=(20, 20), interval=10):                                         │
│   346 │   │   │   │   self.handle_dock_cards_loading()                                                              │
│ ❱ 347 │   │   │   │   total, remain = self._enhance_handler()                                                       │
│   348 │   │   │   │   if not total:                                                                                 │
│   349 │   │   │   │   │   logger.info(                                                                              │
│   350 │   │   │   │   │   │   'No ship to enhance, but dock full, will try retire')                                 │
│                                                                                                                     │
│ ╭──────────────────────────────────── locals ─────────────────────────────────────╮                                 │
│ │ self = <campaign.campaign_main.campaign_12_4.Campaign object at 0x7ea467b8b050> │                                 │
│ ╰─────────────────────────────────────────────────────────────────────────────────╯                                 │
│                                                                                                                     │
│ /home/finch/workspace/python/AzurLaneAutoScript/module/retire/enhancement.py:329 in _enhance_handler                │
│                                                                                                                     │
│   326 │   │   │   in: DOCK_CHECK                                                                                    │
│   327 │   │   │   out: the page before retirement popup                                                             │
│   328 │   │   """                                                                                                   │
│ ❱ 329 │   │   total = self.enhance_ships()                                                                          │
│   330 │   │   _, remain, _ = OCR_DOCK_AMOUNT.ocr(self.device.image)                                                 │
│   331 │   │                                                                                                         │
│   332 │   │   self.dock_quit()                                                                                      │
│                                                                                                                     │
│ ╭──────────────────────────────────── locals ─────────────────────────────────────╮                                 │
│ │ self = <campaign.campaign_main.campaign_12_4.Campaign object at 0x7ea467b8b050> │                                 │
│ ╰─────────────────────────────────────────────────────────────────────────────────╯                                 │
│                                                                                                                     │
│ /home/finch/workspace/python/AzurLaneAutoScript/module/retire/enhancement.py:298 in enhance_ships                   │
│                                                                                                                     │
│   295 │   │   │                                                                                                     │
│   296 │   │   │   # Continue if at least 1 CARD_GRID is selectable                                                  │
│   297 │   │   │   # otherwise skip to next ship type                                                                │
│ ❱ 298 │   │   │   if not self._enhance_enter(favourite=favourite, ship_type=ship_type):                             │
│   299 │   │   │   │   logger.hr(f'Dock Empty by ship type {ship_type}')                                             │
│   300 │   │   │   │   continue                                                                                      │
│   301                                                                                                               │
│                                                                                                                     │
│ ╭──────────────────────────────────────────── locals ─────────────────────────────────────────────╮                 │
│ │ available_ship_types = ['dd', 'ss', 'cl', 'ca', 'bb', 'cv', 'repair', 'others']                 │                 │
│ │            favourite = False                                                                    │                 │
│ │                 self = <campaign.campaign_main.campaign_12_4.Campaign object at 0x7ea467b8b050> │                 │
│ │            ship_type = None                                                                     │                 │
│ │           ship_types = [None]                                                                   │                 │
│ │                total = 0                                                                        │                 │
│ ╰─────────────────────────────────────────────────────────────────────────────────────────────────╯                 │
│                                                                                                                     │
│ /home/finch/workspace/python/AzurLaneAutoScript/module/retire/enhancement.py:52 in _enhance_enter                   │
│                                                                                                                     │
│    49 │   │   if self.appear(DOCK_EMPTY, offset=(30, 30)):                                                          │
│    50 │   │   │   return False                                                                                      │
│    51 │   │                                                                                                         │
│ ❱  52 │   │   self.equip_enter(                                                                                     │
│    53 │   │   │   CARD_GRIDS[(0, 0)], check_button=SHIP_DETAIL_CHECK, long_click=False)                             │
│    54 │   │   return True                                                                                           │
│    55                                                                                                               │
│                                                                                                                     │
│ ╭─────────────────────────────────────── locals ───────────────────────────────────────╮                            │
│ │ favourite = False                                                                    │                            │
│ │      self = <campaign.campaign_main.campaign_12_4.Campaign object at 0x7ea467b8b050> │                            │
│ │ ship_type = None                                                                     │                            │
│ ╰──────────────────────────────────────────────────────────────────────────────────────╯                            │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
AttributeError: 'Campaign' object has no attribute 'equip_enter'                                                       
2024-04-19 13:44:44.492 | WARNING | Saving error: ./log/error/1713505484492

截图

No response

还有别的吗?

No response

foglantern avatar Apr 19 '24 05:04 foglantern

感谢

Air111 avatar Apr 19 '24 06:04 Air111

@Air111 新BUG,还是强化的时候报错 AttributeError: 'OperationSiren' object has no attribute 'equip_side_navbar_ensure' log.txt

foglantern avatar Apr 22 '24 02:04 foglantern

@Air111 新BUG,还是强化的时候报错 AttributeError: 'OperationSiren' object has no attribute 'equip_side_navbar_ensure' log.txt

玉玉了,我再检查一下

Air111 avatar Apr 22 '24 03:04 Air111