LmeSzinc / AzurLaneAutoScript

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

Target Zone ID of Meowfficer Farming is sometimes ignored #998

Closed Lysozyme closed 2 years ago

Lysozyme commented 2 years ago

Before you asking

Describe the bug

Target Zone ID of OpSi Meowfficer Farm Settings is sometimes ignored, and ALAS selects the zone based on Target Zone Hazard Level.

Target Zone Hazard Level Target Zone ID Expected zone selection Actual zone selection
5 11 11 124
5 卡利比安海A 11 124
5 Caribbean Sea A 11 124
5 カリブ海A 11 124
5 106 106 106
5 西北航道F 106 106
5 Northwest Passage F 106 106
5 北西航路F 106 106
5 Northwest Passage X none none (warning loop)

11 (Caribbean Sea A) and 106 (Northwest Passage F) are both lv6 zones. Target Zone ID 106 works as expected, but ALAS ignores Target Zone ID 11 and selects lv5 zone 124 based on the Target Zone Hazard Level.

To Reproduce

  1. Enable Meowfficer Farming task
  2. Set Target Zone Hazard Level to 5
  3. Set Target Zone ID to 11
  4. Run ALAS
  5. Meowfficer Farming takes place at zone 124

Expected behavior

Meowfficer Farming takes place at the zone specified by Target Zone ID

Relevant log output

═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════
                                                         START                                                         
═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════
2022-04-09 16:19:12.032 | INFO | Start scheduler loop: alas                                                            
2022-04-09 16:19:12.035 | INFO | [Server] jp                                                                           
2022-04-09 16:19:12.049 | INFO | Bind task {'Alas', 'General'}                                                         
2022-04-09 16:19:12.052 | INFO | Pending tasks: ['OpsiMeowfficerFarming']                                              
2022-04-09 16:19:12.054 | INFO | [Task] OpsiMeowfficerFarming (Enable, 2020-01-01 00:00:00)                            
2022-04-09 16:19:12.056 | INFO | Bind task {'OpsiMeowfficerFarming', 'OpsiGeneral', 'Alas', 'General'}                 
2022-04-09 16:19:13.245 | INFO | Scheduler: Start task `OpsiMeowfficerFarming`                                         
2022-04-09 16:19:13.411 | INFO | <<< DEVICE >>>                                                                        
2022-04-09 16:19:13.415 | INFO | [Adb_binary] C:\AzurLaneAutoScript\toolkit\Lib\site-packages\adbutils\binaries\adb.exe
2022-04-09 16:19:13.420 | INFO | already connected to 127.0.0.1:5555                                                   
2022-04-09 16:19:13.422 | INFO | [Adb_device] AdbDevice(serial=127.0.0.1:5555)                                         
2022-04-09 16:19:13.424 | INFO | Screenshot interval set to 0.3s                                                       
═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════
                                                 OPSIMEOWFFICERFARMING                                                 
═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════
2022-04-09 16:19:13.757 | INFO | [Screen_size] 1280x720                                                                
═══════════════════════════════════════════════════════ OS INIT ═══════════════════════════════════════════════════════
2022-04-09 16:19:13.851 | INFO | OS INIT                                                                               
2022-04-09 16:19:13.879 | INFO | <<< UI ENSURE >>>                                                                     
2022-04-09 16:19:13.882 | INFO | UI get current page                                                                   
2022-04-09 16:19:13.892 | INFO | [UI] page_main                                                                        
2022-04-09 16:19:13.894 | INFO | Goto page_os                                                                          
2022-04-09 16:19:13.896 | INFO | <<< UI GOTO PAGE_OS >>>                                                               
2022-04-09 16:19:13.981 | INFO | Click (1072,  393) @ MAIN_GOTO_CAMPAIGN                                               
2022-04-09 16:19:13.983 | INFO | <<< MINITOUCH INIT >>>                                                                
2022-04-09 16:19:13.993 | INFO | [Device Orientation] 0 (Normal)                                                       
2022-04-09 16:19:15.997 | INFO | Create forward: ForwardItem(serial='127.0.0.1:5555', local='tcp:20460',               
remote='localabstract:minitouch')                                                                                      
2022-04-09 16:19:16.011 | INFO | v 1                                                                                   
2022-04-09 16:19:16.013 | INFO | ^ 2 32767 32767 0                                                                     
2022-04-09 16:19:16.015 | INFO | $ 4224                                                                                
2022-04-09 16:19:16.017 | INFO | minitouch running on port: 20460, pid: 4224                                           
2022-04-09 16:19:16.018 | INFO | max_contact: 2; max_x: 32767; max_y: 32767; max_pressure: 0                           
2022-04-09 16:19:16.935 | INFO | Click ( 757,  446) @ CAMPAIGN_MENU_GOTO_OS                                            
2022-04-09 16:19:18.479 | INFO | Loading OCR model: ./bin/cnocr_models/jp                                              
2022-04-09 16:19:18.593 | INFO | [MAP_NAME 0.126s] ペテルブルク                                                        
2022-04-09 16:19:18.597 | INFO | Map name processed: ペテルブルク                                                      
2022-04-09 16:19:18.600 | INFO | [Zone] [3|St. Petersburg]                                                             
────────────────────────────────────────────────── AFTER AUTO SEARCH ──────────────────────────────────────────────────
2022-04-09 16:19:18.607 | INFO | AFTER AUTO SEARCH                                                                     
2022-04-09 16:19:18.626 | INFO | [HP]  98%  98%  98%  98%  98%  98%                                                    
2022-04-09 16:19:18.636 | INFO | [Repair icon] [False, False, False, False, False, False]                              
2022-04-09 16:19:18.640 | INFO | No ship found to be below threshold 40%, continue OS exploration                      
2022-04-09 16:19:18.656 | INFO | No EMP debuff on current fleet                                                        
2022-04-09 16:19:18.661 | INFO | Handle after auto search finished, solved=False                                       
2022-04-09 16:19:18.667 | INFO | In port, skip running first auto search                                               
2022-04-09 16:19:18.672 | INFO | Ash beacon fully collected today                                                      
════════════════════════════════════════ OS MEOWFFICER FARMING, HAZARD_LEVEL=5 ════════════════════════════════════════
2022-04-09 16:19:18.678 | INFO | OS MEOWFFICER FARMING, HAZARD_LEVEL=5                                                 
2022-04-09 16:19:18.681 | INFO | [OpsiNextReset] 2022-05-01 00:00:00                                                   
2022-04-09 16:19:18.685 | INFO | [ResetRemain] 21                                                                      
2022-04-09 16:19:18.689 | INFO | Not close to OpSi reset                                                               
2022-04-09 16:19:18.693 | INFO | [OS_ACTION_POINT_PRESERVE] 500                                                        
═════════════════════════════════════════ OS MEOWFFICER FARMING, ZONE_ID=124 ══════════════════════════════════════════
2022-04-09 16:19:18.698 | INFO | OS MEOWFFICER FARMING, ZONE_ID=124                                                    
2022-04-09 16:19:18.700 | INFO | <<< GLOBE GOTO: [124|EAST CONTINENTAL SHELF D] >>>                                    
2022-04-09 16:19:18.713 | INFO | Click (1027,  664) @ MAP_GOTO_GLOBE

Screenshots

No response

Anything else?

I forked and played around with the code a bit.

When Target Zone ID is 11, self.config.OpsiMeowfficerFarming_TargetZone in operation_siren.py seems to have a value of 0, so the condition if self.config.OpsiMeowfficerFarming_TargetZone != 0 at line 139 is not met. Therefore the code proceeds to the else-clause at line 156 and zone selection happens based on Target Hazard Level.

When Target Zone ID is 106, self.config.OpsiMeowfficerFarming_TargetZone is 106 as expected, and the if-clause runs.

I was not able to figure out why this behavior happens since I do not have good understanding of the overall ALAS code.

LmeSzinc commented 2 years ago

Fixed, thanks for the detailed tests.