OnmyojiAutoScript icon indicating copy to clipboard operation
OnmyojiAutoScript copied to clipboard

契灵队员报错

Open 1966258344 opened this issue 2 months ago • 1 comments

在提问之前...

  • [x] 我已经搜索了现有的 issues
  • [x] 我在提问题之前至少花费了 5 分钟来思考和准备
  • [x] 我已经阅读了文档中的 常见问题(FAQ)
  • [x] 这个问题出现了至少三次,不是偶发的
  • [ ] 我使用 OAS 的 dev 分支

描述你的问题

契灵组队任务刷着刷着就刷着会报错,重启之后还会发生

如何复现

  1. 前往 '...'
  2. 点击 '....'
  3. 滑动到 '....'
  4. 出现问题

预期行为

No response

相关 Logs

───────────────────────────── GENERAL BATTLE START ─────────────────────────────
2025-10-30 09:00:28.367 |            logger.py:0310 |     INFO | GENERAL BATTLE START                                                                           
2025-10-30 09:00:28.373 |            battle.py:0026 |     INFO | Current tasks: 契灵之境                                                                        
2025-10-30 09:00:28.374 |            battle.py:0027 |     INFO | Current count: 9 / 30                                                                          
2025-10-30 09:00:28.375 |            battle.py:0032 |     INFO | Current times: 0:05:33 / 0:30:00                                                               
2025-10-30 09:00:28.665 |            device.py:0135 |     INFO | Add stuck record: BATTLE_STATUS_S                                                              
2025-10-30 09:00:28.668 |            battle.py:0065 |     INFO | Start battle process                                                                           
2025-10-30 09:00:47.116 |           control.py:0074 |     INFO | Click ( 675,  166) @ GB_WIN                                                                    
2025-10-30 09:00:48.307 |            battle.py:0095 |     INFO | Catch failure                                                                                  
2025-10-30 09:00:48.683 |           control.py:0074 |     INFO | Click (1209,  574) @ GB_REWARD                                                                 
2025-10-30 09:00:50.212 |           control.py:0074 |     INFO | Click ( 133,  469) @ GB_REWARD                                                                 
2025-10-30 09:00:50.603 |            battle.py:0112 |     INFO | Get reward                                                                                     
2025-10-30 09:00:50.605 |            device.py:0135 |     INFO | Add stuck record: BATTLE_STATUS_S                                                              
2025-10-30 09:01:07.355 |       script_task.py:0754 |     INFO | Click accept                                                                                   
2025-10-30 09:01:07.364 |       script_task.py:0758 |     INFO | 识别到队长邀请,准备点击接受....                                                               
2025-10-30 09:01:07.956 |           control.py:0074 |     INFO | Click ( 138,  257) @ GI_I_ACCEPT                                                               
2025-10-30 09:01:08.617 |       script_task.py:0767 |     INFO | 契灵:已经在组队房间中                                                                         
2025-10-30 09:01:08.889 |       script_task.py:0754 |     INFO | Click accept                                                                                   
2025-10-30 09:01:08.890 |       script_task.py:0758 |     INFO | 识别到队长邀请,准备点击接受....                                                               
2025-10-30 09:01:11.326 |       script_task.py:0772 |     INFO | 已经在战斗场景中                                                                               
───────────────────────────── GENERAL BATTLE START ─────────────────────────────
2025-10-30 09:01:11.934 |            logger.py:0310 |     INFO | GENERAL BATTLE START                                                                           
2025-10-30 09:01:11.938 |    general_battle.py:0038 |     INFO | Current count: 10                                                                              
2025-10-30 09:01:12.234 |    general_battle.py:0058 |     INFO | Wait to enter the preparation page                                                             
2025-10-30 09:01:12.748 |    general_battle.py:0058 |     INFO | Wait to enter the preparation page                                                             
2025-10-30 09:01:13.266 |    general_battle.py:0058 |     INFO | Wait to enter the preparation page                                                             
2025-10-30 09:01:13.780 |    general_battle.py:0058 |     INFO | Wait to enter the preparation page                                                             
2025-10-30 09:01:14.593 |            device.py:0135 |     INFO | Add stuck record: BATTLE_STATUS_S                                                              
2025-10-30 09:01:14.596 |    general_battle.py:0178 |     INFO | Start battle process                                                                           
2025-10-30 09:01:29.877 |    general_battle.py:0184 |     INFO | Battle result is win                                                                           
2025-10-30 09:01:29.893 |    general_battle.py:0210 |     INFO | Reconfirm the results of the battle                                                            
2025-10-30 09:01:30.183 |           control.py:0074 |     INFO | Click ( 197,  131) @ GB_WIN                                                                    
2025-10-30 09:01:31.374 |    general_battle.py:0231 |     INFO | Get reward                                                                                     
2025-10-30 09:01:31.677 |           control.py:0074 |     INFO | Click ( 798,  651) @ GB_REWARD                                                                 
2025-10-30 09:01:33.187 |           control.py:0074 |     INFO | Click ( 129,  243) @ GB_REWARD                                                                 
2025-10-30 09:01:33.562 |            device.py:0135 |     INFO | Add stuck record: BATTLE_STATUS_S                                                              
2025-10-30 09:01:53.040 |       script_task.py:0754 |     INFO | Click accept                                                                                   
2025-10-30 09:01:53.045 |       script_task.py:0758 |     INFO | 识别到队长邀请,准备点击接受....                                                               
2025-10-30 09:01:53.640 |           control.py:0074 |     INFO | Click ( 162,  233) @ GI_I_ACCEPT                                                               
2025-10-30 09:01:54.240 |       script_task.py:0767 |     INFO | 契灵:已经在组队房间中                                                                         
2025-10-30 09:01:54.648 |       script_task.py:0754 |     INFO | Click accept                                                                                   
2025-10-30 09:01:54.651 |       script_task.py:0758 |     INFO | 识别到队长邀请,准备点击接受....                                                               
2025-10-30 09:01:56.951 |       script_task.py:0772 |     INFO | 已经在战斗场景中                                                                               
───────────────────────────── GENERAL BATTLE START ─────────────────────────────
2025-10-30 09:01:57.554 |            logger.py:0310 |     INFO | GENERAL BATTLE START                                                                           
2025-10-30 09:01:57.556 |    general_battle.py:0038 |     INFO | Current count: 11                                                                              
2025-10-30 09:01:57.858 |    general_battle.py:0058 |     INFO | Wait to enter the preparation page                                                             
2025-10-30 09:01:58.373 |    general_battle.py:0058 |     INFO | Wait to enter the preparation page                                                             
2025-10-30 09:01:58.887 |    general_battle.py:0058 |     INFO | Wait to enter the preparation page                                                             
2025-10-30 09:01:59.411 |    general_battle.py:0058 |     INFO | Wait to enter the preparation page                                                             
2025-10-30 09:02:00.236 |            device.py:0135 |     INFO | Add stuck record: BATTLE_STATUS_S                                                              
2025-10-30 09:02:00.239 |    general_battle.py:0178 |     INFO | Start battle process                                                                           
2025-10-30 09:02:18.906 |    general_battle.py:0210 |     INFO | Reconfirm the results of the battle                                                            
2025-10-30 09:02:19.488 |    general_battle.py:0231 |     INFO | Get reward                                                                                     
2025-10-30 09:02:19.791 |           control.py:0074 |     INFO | Click (  67,  150) @ GB_REWARD                                                                 
2025-10-30 09:02:20.140 |            device.py:0135 |     INFO | Add stuck record: BATTLE_STATUS_S                                                              
2025-10-30 09:02:24.913 |       script_task.py:0754 |     INFO | Click accept                                                                                   
2025-10-30 09:02:24.916 |       script_task.py:0758 |     INFO | 识别到队长邀请,准备点击接受....                                                               
2025-10-30 09:02:25.516 |           control.py:0074 |     INFO | Click ( 235,  285) @ GI_I_ACCEPT_DEFAULT                                                       
2025-10-30 09:02:26.195 |       script_task.py:0767 |     INFO | 契灵:已经在组队房间中                                                                         
2025-10-30 09:02:26.428 |       script_task.py:0754 |     INFO | Click accept                                                                                   
2025-10-30 09:02:26.433 |       script_task.py:0758 |     INFO | 识别到队长邀请,准备点击接受....                                                               
2025-10-30 09:02:27.023 |       script_task.py:0767 |     INFO | 契灵:已经在组队房间中                                                                         
───────────────────────────── GENERAL BATTLE START ─────────────────────────────
2025-10-30 09:02:28.830 |            logger.py:0310 |     INFO | GENERAL BATTLE START                                                                           
2025-10-30 09:02:28.832 |    general_battle.py:0038 |     INFO | Current count: 12                                                                              
2025-10-30 09:02:29.452 |            logger.py:0354 |    ERROR | AttributeError: 'BattleConfig' object has no attribute 'lock_team_enable'                      
┌───────────────────────────────────────────────────────────── Traceback (most recent call last) ──────────────────────────────────────────────────────────────┐
│ E:\oas\OnmyojiAutoScript-easy-install\script.py:369 in run                                                                                                   │
│                                                                                                                                                              │
│   366 │   │   │   module_path = str(Path.cwd() / 'tasks' / command / (module_name+'.py'))                                                                    │
│   367 │   │   │   logger.info(f'module_path: {module_path}, module_name: {module_name}')                                                                     │
│   368 │   │   │   task_module = load_module(module_name, module_path)                                                                                        │
│ > 369 │   │   │   task_module.ScriptTask(config=self.config, device=self.device).run()                                                                       │
│   370 │   │   except TaskEnd:                                                                                                                                │
│   371 │   │   │   return True                                                                                                                                │
│   372 │   │   except GameNotRunningError as e:                                                                                                               │
│                                                                                                                                                              │
│ ┌─────────────────────────────────────────────────────────── locals ────────────────────────────────────────────────────────────┐                            │
│ │     command = 'BondlingFairyland'                                                                                             │                            │
│ │           e = AttributeError("'BattleConfig' object has no attribute 'lock_team_enable'")                                     │                            │
│ │ module_name = 'script_task'                                                                                                   │                            │
│ │ module_path = 'E:\\oas\\OnmyojiAutoScript-easy-install\\tasks\\BondlingFairyland\\script_task.py'                             │                            │
│ │        self = <script.Script object at 0x000002B3C98EBF10>                                                                    │                            │
│ │ task_module = <module 'script_task' from 'E:\\oas\\OnmyojiAutoScript-easy-install\\tasks\\BondlingFairyland\\script_task.py'> │                            │
│ └───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘                            │
│                                                                                                                                                              │
│ E:\oas\OnmyojiAutoScript-easy-install\tasks\BondlingFairyland\script_task.py:104 in run                                                                      │
│                                                                                                                                                              │
│   101 │   │   │   case UserStatus.LEADER | UserStatus.ALONE:                                                                                                 │
│   102 │   │   │   │   self.switch_ball()                                                                                                                     │
│   103 │   │   │   case UserStatus.MEMBER:                                                                                                                    │
│ > 104 │   │   │   │   self.run_member()                                                                                                                      │
│   105 │   │   │   case _:                                                                                                                                    │
│   106 │   │   │   │   logger.error(f'Unknown user status: {cong.bondling_config.user_status}')                                                               │
│   107                                                                                                                                                        │
│                                                                                                                                                              │
│ ┌──────────────────────────────────────────────────────────────────────── locals ─────────────────────────────────────────────────────────────────────────┐  │
│ │      cong = BondlingFairyland(                                                                                                                          │  │
│ │             │   scheduler=Scheduler(                                                                                                                    │  │
│ │             │   │   enable=True,                                                                                                                        │  │
│ │             │   │   next_run=datetime.datetime(2023, 1, 1, 0, 0),                                                                                       │  │
│ │             │   │   priority=5,                                                                                                                         │  │
│ │             │   │   success_interval=datetime.timedelta(days=1),                                                                                        │  │
│ │             │   │   failure_interval=datetime.timedelta(days=1),                                                                                        │  │
│ │             │   │   server_update=datetime.time(6, 0),                                                                                                  │  │
│ │             │   │   delay_date=1,                                                                                                                       │  │
│ │             │   │   float_time=datetime.time(0, 0)                                                                                                      │  │
│ │             │   ),                                                                                                                                      │  │
│ │             │   bondling_check=BondlingCheck(check_enable=True, limit_num=2000),                                                                        │  │
│ │             │   bondling_config=BondlingConfig(                                                                                                         │  │
│ │             │   │   user_status=<UserStatus.MEMBER: 'member'>,                                                                                          │  │
│ │             │   │   bondling_mode=<BondlingMode.MODE2: 'mode_2'>,                                                                                       │  │
│ │             │   │   limit_time=datetime.time(0, 30),                                                                                                    │  │
│ │             │   │   limit_count=30,                                                                                                                     │  │
│ │             │   │   bondling_stone_enable=True,                                                                                                         │  │
│ │             │   │   bondling_stone_class=<BondlingClass.TOMB_GUARD: '镇墓兽'>                                                                           │  │
│ │             │   ),                                                                                                                                      │  │
│ │             │   bondling_switch_soul=BondlingSwitchSoul(                                                                                                │  │
│ │             │   │   auto_switch_soul=False,                                                                                                             │  │
│ │             │   │   tomb_guard_switch='5,1',                                                                                                            │  │
│ │             │   │   snowball_switch='-1,-1',                                                                                                            │  │
│ │             │   │   little_kuro_switch='-1,-1',                                                                                                         │  │
│ │             │   │   azure_basan_switch='-1,-1'                                                                                                          │  │
│ │             │   ),                                                                                                                                      │  │
│ │             │   invite_config=InviteConfig(                                                                                                             │  │
│ │             │   │   invite_number=<InviteNumber.ONE: 'one'>,                                                                                            │  │
│ │             │   │   friend_1='',                                                                                                                        │  │
│ │             │   │   friend_2='',                                                                                                                        │  │
│ │             │   │   find_mode=<FindMode.AUTO_FIND: 'auto_find'>,                                                                                        │  │
│ │             │   │   wait_time=datetime.time(0, 2),                                                                                                      │  │
│ │             │   │   default_invite=True                                                                                                                 │  │
│ │             │   ),                                                                                                                                      │  │
│ │             │   battle_config=BattleConfig(                                                                                                             │  │
│ │             │   │   green_enable=False,                                                                                                                 │  │
│ │             │   │   green_mark=<GreenMarkType.GREEN_LEFT1: 'green_left1'>,                                                                              │  │
│ │             │   │   random_click_swipt_enable=False                                                                                                     │  │
│ │             │   ),                                                                                                                                      │  │
│ │             │   switch_soul_config=SwitchSoulConfig(enable=True, switch_group_team='5,1', enable_switch_by_name=False, group_name='', team_name='')     │  │
│ │             )                                                                                                                                           │  │
│ │        cu = 432                                                                                                                                         │  │
│ │ MAX_COUNT = 2000                                                                                                                                        │  │
│ │        re = 3568                                                                                                                                        │  │
│ │      self = <script_task.ScriptTask object at 0x000002B3F4A640A0>                                                                                       │  │
│ │     total = 4000                                                                                                                                        │  │
│ └─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘  │
│                                                                                                                                                              │
│ E:\oas\OnmyojiAutoScript-easy-install\tasks\BondlingFairyland\script_task.py:251 in run_member                                                               │
│                                                                                                                                                              │
│   248 │   │   │   │   else:                                                                                                                                  │
│   249 │   │   │   │   │   break                                                                                                                              │
│   250 │   │   │   # 队长秒开的时候,检测是否进入到战斗中                                                                                                     │
│ > 251 │   │   │   elif self.check_take_over_battle(False,                                                                                                    │
│       config=self.config.bondling_fairyland.battle_config):                                                                                                  │
│   252 │   │   │   │   wait_timer.reset()                                                                                                                     │
│   253 │   │   │   │   # 进入战斗流程                                                                                                                         │
│   254 │   │   │   │   self.device.stuck_record_add('BATTLE_STATUS_S')                                                                                        │
│                                                                                                                                                              │
│ ┌────────────────────────────── locals ──────────────────────────────┐                                                                                       │
│ │       self = <script_task.ScriptTask object at 0x000002B3F4A640A0> │                                                                                       │
│ │    success = True                                                  │                                                                                       │
│ │  wait_time = datetime.time(0, 2)                                   │                                                                                       │
│ │ wait_timer = Timer(limit=10.143/120, count=9/0)                    │                                                                                       │
│ └────────────────────────────────────────────────────────────────────┘                                                                                       │
│                                                                                                                                                              │
│ E:\oas\OnmyojiAutoScript-easy-install\tasks\Component\GeneralBattle\general_battle.py:466 in check_take_over_battle                                          │
│                                                                                                                                                              │
│   463 │   │   if not self.is_in_battle():                                                                                                                    │
│   464 │   │   │   return None                                                                                                                                │
│   465 │   │                                                                                                                                                  │
│ > 466 │   │   return self.run_general_battle(config=config)                                                                                                  │
│   467 │                                                                                                                                                      │
│   468 │   def check_lock(self, enable: bool, lock_image, unlock_image):                                                                                      │
│   469 │   │   """                                                                                                                                            │
│                                                                                                                                                              │
│ ┌───────────────────────────────────────────────────────────────── locals ─────────────────────────────────────────────────────────────────┐                 │
│ │        config = BattleConfig(green_enable=False, green_mark=<GreenMarkType.GREEN_LEFT1: 'green_left1'>, random_click_swipt_enable=False) │                 │
│ │ is_screenshot = False                                                                                                                    │                 │
│ │          self = <script_task.ScriptTask object at 0x000002B3F4A640A0>                                                                    │                 │
│ └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘                 │
│                                                                                                                                                              │
│ E:\oas\OnmyojiAutoScript-easy-install\tasks\Component\GeneralBattle\general_battle.py:40 in run_general_battle                                               │
│                                                                                                                                                              │
│    37 │   │   self.current_count += 1                                                                                                                        │
│    38 │   │   logger.info(f"Current count: {self.current_count}")                                                                                            │
│    39 │   │   # 战前设置                                                                                                                                     │
│ >  40 │   │   self.battle_before(buff, config)                                                                                                               │
│    41 │   │   # 绿标                                                                                                                                         │
│    42 │   │   if self.is_in_battle(False):                                                                                                                   │
│    43 │   │   │   self.green_mark(config.green_enable, config.green_mark)                                                                                    │
│                                                                                                                                                              │
│ ┌───────────────────────────────────────────────────────────── locals ──────────────────────────────────────────────────────────────┐                        │
│ │   buff = None                                                                                                                     │                        │
│ │ config = BattleConfig(green_enable=False, green_mark=<GreenMarkType.GREEN_LEFT1: 'green_left1'>, random_click_swipt_enable=False) │                        │
│ │   self = <script_task.ScriptTask object at 0x000002B3F4A640A0>                                                                    │                        │
│ └───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘                        │
│                                                                                                                                                              │
│ E:\oas\OnmyojiAutoScript-easy-install\tasks\Component\GeneralBattle\general_battle.py:65 in battle_before                                                    │
│                                                                                                                                                              │
│    62 │   │   # 如果不在准备界面,想设置也设置不了,只能直接开始战斗                                                                                           │
│    63 │   │   while self.is_in_prepare():                                                                                                                    │
│    64 │   │   │   # 配置了锁定阵容则启动超时器                                                                                                               │
│ >  65 │   │   │   if config.lock_team_enable and not need_battle_timer.started():                                                                            │
│    66 │   │   │   │   need_battle_timer.start()                                                                                                              │
│    67 │   │   │   # 在准备界面,且没有锁定阵容,则进行相关配置                                                                                                 │
│    68 │   │   │   if not config.lock_team_enable and not confed:                                                                                             │
│                                                                                                                                                              │
│ ┌───────────────────────────────────────────────────────────────────── locals ─────────────────────────────────────────────────────────────────────┐         │
│ │                  buff = None                                                                                                                     │         │
│ │                confed = False                                                                                                                    │         │
│ │                config = BattleConfig(green_enable=False, green_mark=<GreenMarkType.GREEN_LEFT1: 'green_left1'>, random_click_swipt_enable=False) │         │
│ │     need_battle_timer = Timer(limit=0.0/2, count=0/0)                                                                                            │         │
│ │                  self = <script_task.ScriptTask object at 0x000002B3F4A640A0>                                                                    │         │
│ │ wait_in_prepare_timer = Timer(limit=1.447/2, count=0/0)                                                                                          │         │
│ └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘         │
│                                                                                                                                                              │
│ E:\oas\OnmyojiAutoScript-easy-install\toolkit\lib\site-packages\pydantic\main.py:891 in __getattr__                                                          │
│                                                                                                                                                              │
│    888 │   │   │   │   │   │   return super().__getattribute__(item)  # Raises AttributeError                                                                │
│        if appropriate                                                                                                                                        │
│    889 │   │   │   │   │   else:                                                                                                                             │
│    890 │   │   │   │   │   │   # this is the current error                                                                                                   │
│ >  891 │   │   │   │   │   │   raise AttributeError(f'{type(self).__name__!r} object has no                                                                  │
│        attribute {item!r}')                                                                                                                                  │
│    892 │   │                                                                                                                                                 │
│    893 │   │   def __setattr__(self, name: str, value: Any) -> None:                                                                                         │
│    894 │   │   │   if name in self.__class_vars__:                                                                                                           │
│                                                                                                                                                              │
│ ┌─────────────────────────────────────────────────────────────────── locals ────────────────────────────────────────────────────────────────────┐            │
│ │               item = 'lock_team_enable'                                                                                                       │            │
│ │ private_attributes = {}                                                                                                                       │            │
│ │     pydantic_extra = None                                                                                                                     │            │
│ │               self = BattleConfig(green_enable=False, green_mark=<GreenMarkType.GREEN_LEFT1: 'green_left1'>, random_click_swipt_enable=False) │            │
│ └───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘            │
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
AttributeError: 'BattleConfig' object has no attribute 'lock_team_enable'                                                                                       
2025-10-30 09:02:30.646 |            script.py:0104 |  WARNING | Saving error: ./log/error/1761786150646

截图

Image

还有别的吗?

No response

1966258344 avatar Oct 30 '25 01:10 1966258344

换到dev分支,master还没合

ohspecial avatar Oct 30 '25 02:10 ohspecial