LmeSzinc / AzurLaneAutoScript

Azur Lane bot (CN/EN/JP/TW) 碧蓝航线脚本 | 无缝委托科研,全自动大世界
https://alas.azurlane.cloud
GNU General Public License v3.0
6.96k stars 833 forks source link

心情识别错误导致自动换船失败 #2065

Open ec7529a2 opened 1 year ago

ec7529a2 commented 1 year ago

在提问之前...

描述你的问题

我发现刷委托任务被推迟,查看日志发现alas尝试更换前排时没能正确识别心情值,并因此认为无船可用

如何复现

  1. 运行刷委托任务
  2. 心情不足,触发自动换船
  3. 识别心情错误
  4. alas认为无船可用,推迟任务

预期行为

应该正确识别心情并换船

相关 Logs

INFO     19:35:12.047 │ <<< CHANGING VANGUARD. >>>                                                                              
INFO     19:35:12.049 │ <<< UI ENSURE >>>                                                                                       
INFO     19:35:12.050 │ UI get current page                                                                                     
INFO     19:35:12.055 │ [UI] page_fleet                                                                                         
INFO     19:35:12.057 │ Already at page_fleet                                                                                   
INFO     19:35:12.059 │ <<< UI ENSURE INDEX >>>                                                                                 
INFO     19:35:12.134 │ [OCR_FLEET_INDEX 0.074s] 5                                                                              
INFO     19:35:12.137 │ [Index] 5                                                                                               
INFO     19:35:12.749 │ <<< UI CLICK >>>                                                                                        
INFO     19:35:12.753 │ Click ( 510,  485) @ FLEET_ENTER                                                                        
INFO     19:35:13.409 │ <<< UI CLICK >>>                                                                                        
INFO     19:35:13.414 │ Click (1147,   25) @ DOCK_FILTER                                                                        
INFO     19:35:14.051 │ Setting DOCK options,                                                                                   
INFO     19:35:14.059 │ [DOCK] sort/level, index/all, faction/all, rarity/all, extra/no_limit                                   
INFO     19:35:14.069 │ Setting DOCK options, sort='level', index='dd', faction='eagle', rarity='common',                       
         extra='can_limit_break'                                                                                                
INFO     19:35:14.078 │ [DOCK] sort/level, index/all, faction/all, rarity/all, extra/no_limit                                   
INFO     19:35:14.087 │ Click ( 849,  144) @ FILTER_INDEX_3_0                                                                   
INFO     19:35:14.195 │ Click ( 546,  280) @ FILTER_FACTION_1_0                                                                 
INFO     19:35:14.343 │ Click ( 518,  411) @ FILTER_RARITY_1_0                                                                  
INFO     19:35:14.490 │ Click ( 941,  482) @ FILTER_EXTRA_4_0                                                                   
INFO     19:35:14.781 │ [DOCK] sort/level, index/dd, faction/eagle, rarity/common, extra/can_limit_break                        
INFO     19:35:14.790 │ <<< UI CLICK >>>                                                                                        
INFO     19:35:14.793 │ Click ( 754,  627) @ DOCK_FILTER_CONFIRM                                                                
INFO     19:35:16.588 │ [Favourite_filter] off                                                                                  
INFO     19:35:16.591 │ <<< FINDING VANGUARD >>>                                                                                
INFO     19:35:16.593 │ Limitaions set to {'level': (100, 100), 'emotion': (10, 150), 'rarity': 'any', 'fleet': 5, 'status':    
         'free'}                                                                                                                
INFO     19:35:22.929 │ [DOCK_LEVEL_OCR 6.334s] [0, 100, 100, 75, 83, 100, 100, 0, 0, 0, 0, 0, 0, 0]                            
WARNING  19:35:26.040 │ OCR DOCK_EMOTION_OCR: Result "" is revised to "0"                                                       
WARNING  19:35:26.044 │ OCR DOCK_EMOTION_OCR: Result "" is revised to "0"                                                       
WARNING  19:35:26.047 │ OCR DOCK_EMOTION_OCR: Result "" is revised to "0"                                                       
WARNING  19:35:26.051 │ OCR DOCK_EMOTION_OCR: Result "" is revised to "0"                                                       
WARNING  19:35:26.054 │ OCR DOCK_EMOTION_OCR: Result "" is revised to "0"                                                       
WARNING  19:35:26.056 │ OCR DOCK_EMOTION_OCR: Result "" is revised to "0"                                                       
WARNING  19:35:26.060 │ OCR DOCK_EMOTION_OCR: Result "" is revised to "0"                                                       
WARNING  19:35:26.065 │ OCR DOCK_EMOTION_OCR: Result "" is revised to "0"                                                       
INFO     19:35:26.068 │ [DOCK_EMOTION_OCR 3.128s] [0, 128, 0, 150, 119, 641, 521, 0, 0, 0, 0, 0, 0, 0]                          
INFO     19:35:26.161 │ Ship(rarity=None, level=0, emotion=0, fleet=0, status='free', button=CARD_0_0)                          
INFO     19:35:26.163 │ Ship(rarity=None, level=100, emotion=128, fleet=4, status='free', button=CARD_1_0)                      
INFO     19:35:26.166 │ Ship(rarity=None, level=100, emotion=0, fleet=5, status='free', button=CARD_2_0)                        
INFO     19:35:26.168 │ Ship(rarity=None, level=75, emotion=150, fleet=0, status='free', button=CARD_3_0)                       
INFO     19:35:26.171 │ Ship(rarity=None, level=83, emotion=119, fleet=0, status='free', button=CARD_4_0)                       
INFO     19:35:26.172 │ Ship(rarity=None, level=100, emotion=641, fleet=0, status='free', button=CARD_5_0)                      
INFO     19:35:26.176 │ Ship(rarity=None, level=100, emotion=521, fleet=0, status='free', button=CARD_6_0)                      
INFO     19:35:26.177 │ Ship(rarity=None, level=0, emotion=0, fleet=0, status='free', button=CARD_0_1)                          
INFO     19:35:26.180 │ Ship(rarity=None, level=0, emotion=0, fleet=0, status='free', button=CARD_1_1)                          
INFO     19:35:26.182 │ Ship(rarity=None, level=0, emotion=0, fleet=0, status='free', button=CARD_2_1)                          
INFO     19:35:26.184 │ Ship(rarity=None, level=0, emotion=0, fleet=0, status='free', button=CARD_3_1)                          
INFO     19:35:26.187 │ Ship(rarity=None, level=0, emotion=0, fleet=0, status='free', button=CARD_4_1)                          
INFO     19:35:26.188 │ Ship(rarity=None, level=0, emotion=0, fleet=0, status='free', button=CARD_5_1)                          
INFO     19:35:26.190 │ Ship(rarity=None, level=0, emotion=0, fleet=0, status='free', button=CARD_6_1)                          
INFO     19:35:26.193 │ Limitaions set to {'level': (100, 100), 'emotion': (10, 150), 'rarity': 'any', 'fleet': 0, 'status':    
         'free'}                                                                                                                
INFO     19:35:32.757 │ [DOCK_LEVEL_OCR 6.562s] [0, 100, 100, 75, 83, 100, 100, 0, 0, 0, 0, 0, 0, 0]                            
WARNING  19:35:36.265 │ OCR DOCK_EMOTION_OCR: Result "" is revised to "0"                                                       
WARNING  19:35:36.272 │ OCR DOCK_EMOTION_OCR: Result "" is revised to "0"                                                       
WARNING  19:35:36.275 │ OCR DOCK_EMOTION_OCR: Result "" is revised to "0"                                                       
WARNING  19:35:36.278 │ OCR DOCK_EMOTION_OCR: Result "" is revised to "0"                                                       
WARNING  19:35:36.281 │ OCR DOCK_EMOTION_OCR: Result "" is revised to "0"                                                       
WARNING  19:35:36.284 │ OCR DOCK_EMOTION_OCR: Result "" is revised to "0"                                                       
WARNING  19:35:36.288 │ OCR DOCK_EMOTION_OCR: Result "" is revised to "0"                                                       
WARNING  19:35:36.291 │ OCR DOCK_EMOTION_OCR: Result "" is revised to "0"                                                       
INFO     19:35:36.294 │ [DOCK_EMOTION_OCR 3.527s] [0, 128, 0, 150, 119, 641, 521, 0, 0, 0, 0, 0, 0, 0]                          
INFO     19:35:36.369 │ Change vanguard ship failed, no DD in common rarity.                                                    
INFO     19:35:36.371 │ <<< UI CLICK >>>                                                                                        
INFO     19:35:36.375 │ Click (1142,   30) @ DOCK_FILTER                                                                        
INFO     19:35:36.993 │ Setting DOCK options,                                                                                   
INFO     19:35:37.001 │ [DOCK] sort/level, index/dd, faction/eagle, rarity/common, extra/can_limit_break                        
INFO     19:35:37.010 │ Click ( 317,  146) @ FILTER_INDEX_0_0                                                                   
INFO     19:35:37.125 │ Click ( 383,  275) @ FILTER_FACTION_0_0                                                                 
INFO     19:35:37.270 │ Click ( 362,  420) @ FILTER_RARITY_0_0                                                                  
INFO     19:35:37.419 │ Click ( 381,  489) @ FILTER_EXTRA_0_0                                                                   
INFO     19:35:37.665 │ [DOCK] sort/level, index/all, faction/all, rarity/all, extra/no_limit                                   
INFO     19:35:37.674 │ Setting DOCK options, sort='level', index='all', faction='all', rarity='all', extra='no_limit'          
INFO     19:35:37.683 │ [DOCK] sort/level, index/all, faction/all, rarity/all, extra/no_limit                                   
INFO     19:35:37.691 │ <<< UI CLICK >>>                                                                                        
INFO     19:35:37.696 │ Click ( 779,  635) @ DOCK_FILTER_CONFIRM                                                                
INFO     19:35:39.539 │ <<< UI CLICK >>>                                                                                        
INFO     19:35:39.743 │ Click (  66,   58) @ BACK_ARROW                                                                         
INFO     19:35:40.810 │ Pending tasks: ['GemsFarming']                                                                          
INFO     19:35:40.812 │ [Task] GemsFarming (Enable, 2020-01-01 00:00:00)                                                        
INFO     19:35:40.815 │ Continue task `GemsFarming (Enable, 2020-01-01 00:00:00)`                                               
INFO     19:35:40.819 │ Delay task `GemsFarming` to 2023-01-03 20:05:40 (minute=30)                                             
INFO     19:35:40.831 │ Bind task {'Alas', 'General', 'EventGeneral', 'TaskBalancer', 'GemsFarming'}                            
INFO     19:35:40.834 │ Save config ./config\alas.json, GemsFarming.Scheduler.NextRun=datetime.datetime(2023, 1, 3, 20, 5, 40)  
INFO     19:35:40.846 │ Scheduler: End task `GemsFarming`

截图

Screenshot_20230103-193804

还有别的吗?

可能需要挂hard to reproduce标签

ec7529a2 commented 1 year ago

以下情况会导致心情计算错误:

  1. 手动玩过游戏,Alas 无法追踪
  2. 出击沉船扣 10 心情
  3. Alas 内设置与游戏内不符,例如设置了后宅二楼但是有一艘忘记放进二楼
  4. 多个任务之间共享同一个角色

出现心情计算错误时需要: 在游戏内后宅查看心情最低的角色的心情值,手动填入 Alas 内的心情设置中

Originally posted by @LmeSzinc in #2288 (comment)

但是这是刷委托,alas不计算心情,而是看见红脸弹窗就去换船,问题出在alas没有正确识别心情数值,而不是实际心情与alas计算的不符,你说的这些根本没用

guoh064 commented 1 year ago

你是想说心情里面的64被识别成了641,52被识别成521了对吗(看起来ocr又要特殊判断了,唐斯的白头发被识别成了1) @ec7529a2

ec7529a2 commented 1 year ago

我想到了一个办法来绕过这个问题 识别心情值最左边的那个数位以及左边的脸图标,如果脸是绿的且心情值是1打头说明心情值有三位数,否则说明心情值不到三位数,根据这个信息限制识别范围就可以避开右边的角色立绘 另外如果脸是黄的且心情值是3及以上的数字打头,说明心情值只有一位数,这可以在部分情况下避免一位数心情识别成两位数