@@ -13,7 +13,7 @@ class FiveToOneTask(BaseCombatTask):
13
13
14
14
def __init__ (self , * args , ** kwargs ):
15
15
super ().__init__ (* args , ** kwargs )
16
- self .description = "游戏语言必须为简体中文,必须16:9分辨率,勾选需要的, 没勾的都会自动合成"
16
+ self .description = "游戏语言必须为简体中文,必须16:9分辨率,使用1600x900以上分辨率, 勾选需要的, 没勾的都会自动合成"
17
17
self .name = "数据坞五合一"
18
18
self .default_config = {
19
19
}
@@ -31,8 +31,9 @@ def __init__(self, *args, **kwargs):
31
31
self .all_stats = []
32
32
self .black_list = ["主属性生命值" , "主属性攻击力" , "主属性防御力" ]
33
33
for main_stat in self .main_stats :
34
- self .all_stats .append ("主属性" + main_stat )
35
- self .all_stats += self .black_list
34
+ self .all_stats .append (re .compile ("主属性" + main_stat ))
35
+ for black in self .black_list :
36
+ self .all_stats .append (re .compile (black ))
36
37
37
38
self .add_text_fix (
38
39
{'凝夜自霜' : '凝夜白霜' , '主属性灭伤害加成' : '主属性湮灭伤害加成' , "灭伤害加成" : "主属性湮灭伤害加成" ,
@@ -82,15 +83,20 @@ def merge_set(self, name_box, set_name, step):
82
83
self .wait_click_ocr (box = name_box , match = re .compile (set_name ), raise_if_not_found = True ,
83
84
after_sleep = 0.2 )
84
85
self .wait_feature ("merge_echo_check" , box = name_box , raise_if_not_found = True )
85
-
86
86
self .click_relative (0.895 , 0.74 , after_sleep = 0.5 ) # 滚动
87
- choices = self .ocr (box = name_box , match = chinese_regex )
87
+ choices = self .ocr (box = name_box , match = self . all_stats )
88
88
if step == 1 :
89
+ if len (choices ) != 16 :
90
+ raise Exception (f"属性列表识别失败! { choices } " )
89
91
for choice in choices :
90
- if choice .name not in self .all_stats :
91
- raise Exception (f"无法识别的属性: { choice .name } " )
92
92
in_keep = False
93
- if choice .name in self .black_list :
93
+ in_black_list = False
94
+ for black in self .black_list :
95
+ if black in choice .name and "百分比" not in choice .name :
96
+ in_black_list = True
97
+ break
98
+ if in_black_list :
99
+ self .log_debug (f'跳过黑名单 { choice .name } ' )
94
100
continue
95
101
for keep in keeps :
96
102
if keep in choice .name :
0 commit comments