Skip to content

Commit 3388e3b

Browse files
committed
5合1添加选择4c攻击力步骤
1 parent 3ea69e7 commit 3388e3b

File tree

1 file changed

+40
-24
lines changed

1 file changed

+40
-24
lines changed

src/task/FiveToOneTask.py

Lines changed: 40 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -54,18 +54,29 @@ def run(self):
5454
def loop_merge(self):
5555
name_box = self.box_of_screen(0.11, 0.19, 0.87, 0.75)
5656
for set_name in self.sets:
57-
self.click_relative(0.03, 0.91, after_sleep=0.3)
57+
self.merge_set(name_box, set_name, 1)
58+
self.merge_set(name_box, set_name, 2)
59+
60+
def merge_set(self, name_box, set_name, step):
61+
keeps = self.config.get(set_name, [])
62+
if step == 2 and "攻击力百分比" not in keeps: # 4C攻击力
63+
self.log_info("没有选择攻击力百分比, 跳过第二步")
64+
return
65+
self.click_relative(0.03, 0.91, after_sleep=0.3)
66+
if step == 1:
5867
self.click_relative(0.62, 0.82, after_sleep=0.01) # 重置
59-
self.click_relative(0.20, 0.71, after_sleep=0.01) # 1c
60-
self.click_relative(0.47, 0.71, after_sleep=0.01) # 3c
61-
self.click_relative(0.71, 0.71, after_sleep=0.01) # 4c
6268

69+
self.click_relative(0.20, 0.71, after_sleep=0.01) # 1c
70+
self.click_relative(0.47, 0.71, after_sleep=0.01) # 3c
71+
if step == 1:
72+
self.click_relative(0.71, 0.71, after_sleep=0.01) # 4c
73+
if step == 1:
6374
self.click_relative(0.895, 0.57, after_sleep=0.2) # 滚动
64-
self.wait_click_ocr(box=name_box, match=re.compile(set_name), raise_if_not_found=True)
75+
self.wait_click_ocr(box=name_box, match=re.compile(set_name), raise_if_not_found=True, after_sleep=0.2)
6576

66-
self.click_relative(0.895, 0.74, after_sleep=0.2) # 滚动
67-
choices = self.ocr(box=name_box)
68-
keeps = self.config.get(set_name, [])
77+
self.click_relative(0.895, 0.74, after_sleep=0.2) # 滚动
78+
choices = self.ocr(box=name_box)
79+
if step == 1:
6980
for choice in choices:
7081
in_keep = False
7182
if choice.name in self.black_list:
@@ -77,19 +88,24 @@ def loop_merge(self):
7788
if not in_keep:
7889
self.click_box(choice, after_sleep=0.01)
7990
self.log_info(f"不在配置 {set_name} {choice.name} 选择合成!")
80-
self.click_relative(0.81, 0.84, after_sleep=0.5)
81-
while True:
82-
self.click_relative(0.26, 0.91, after_sleep=0.5) # 全选
83-
self.click_relative(0.78, 0.9, after_sleep=1)
84-
if not self.claim_handled:
85-
if confirm := self.ocr(match="确认", box="bottom_right"):
86-
self.click_relative(0.49, 0.55, after_sleep=0.1)
87-
self.click_box(confirm, after_sleep=0.5)
88-
self.claim_handled = True
89-
if self.ocr(match="批量融合", box="bottom_right"):
90-
self.click_relative(0.26, 0.91, after_sleep=0.5)
91-
self.log_info(f"{set_name} 不够5个")
92-
break # 没有更多
93-
self.wait_ocr(match="获得声骸", box="top", raise_if_not_found=True, settle_time=1)
94-
self.click_relative(0.53, 0.05, after_sleep=0.5)
95-
self.click_relative(0.68, 0.91, after_sleep=0.5) # 批量融合
91+
else:
92+
for choice in choices:
93+
if "攻击力百分比" in choice.name:
94+
self.click_box(choice, after_sleep=0.01)
95+
break
96+
self.click_relative(0.81, 0.84, after_sleep=0.5)
97+
while True:
98+
self.click_relative(0.26, 0.91, after_sleep=0.5) # 全选
99+
self.click_relative(0.78, 0.9, after_sleep=1)
100+
if not self.claim_handled:
101+
if confirm := self.ocr(match="确认", box="bottom_right"):
102+
self.click_relative(0.49, 0.55, after_sleep=0.1)
103+
self.click_box(confirm, after_sleep=0.5)
104+
self.claim_handled = True
105+
if self.ocr(match="批量融合", box="bottom_right"):
106+
self.click_relative(0.26, 0.91, after_sleep=0.5)
107+
self.log_info(f"{set_name} 不够5个")
108+
break # 没有更多
109+
self.wait_ocr(match="获得声骸", box="top", raise_if_not_found=True, settle_time=1)
110+
self.click_relative(0.53, 0.05, after_sleep=0.5)
111+
self.click_relative(0.68, 0.91, after_sleep=0.5) # 批量融合

0 commit comments

Comments
 (0)