@@ -27,7 +27,7 @@ def setup_commission_config(self):
2727 self .default_config .update ({
2828 "委托手册" : "不使用" ,
2929 "使用技能" : "不使用" ,
30- "技能释放频率" : 5 ,
30+ "技能释放频率" : 5.0 ,
3131 "启用自动穿引共鸣" : True ,
3232 "发出声音提醒" : True ,
3333 "自动选择首个密函和密函奖励" : True ,
@@ -75,7 +75,7 @@ def find_drop_rate_btn(self, threshold=0):
7575 def find_esc_menu (self , threshold = 0 ):
7676 return self .find_one ("quit_big_icon" , threshold = threshold )
7777
78- def open_in_mission_menu (self , time_out = 10 , raise_if_not_found = True ):
78+ def open_in_mission_menu (self , time_out = 20 , raise_if_not_found = True ):
7979 if self .find_esc_menu ():
8080 return True
8181 found = False
@@ -114,7 +114,7 @@ def quit_mission(self, timeout=10):
114114 )
115115 self .sleep (0.5 )
116116 self .click_until (
117- click_func = lambda : self .click_box (quit_btn ),
117+ click_func = lambda : self .click_box (quit_btn , after_sleep = 0.25 ),
118118 check_func = lambda : not self .find_quit_btn (),
119119 time_out = action_timeout ,
120120 )
@@ -150,7 +150,7 @@ def continue_mission(self, timeout=10):
150150 self .find_continue_btn , time_out = action_timeout , raise_if_not_found = True
151151 )
152152 self .click_until (
153- click_func = lambda : self .click_box (continue_btn ),
153+ click_func = lambda : self .click_box (continue_btn , after_sleep = 0.25 ),
154154 check_func = lambda : not self .find_continue_btn (),
155155 time_out = action_timeout ,
156156 )
@@ -159,13 +159,12 @@ def continue_mission(self, timeout=10):
159159
160160 def choose_drop_rate (self , timeout = 10 ):
161161 action_timeout = self .safe_get ("action_timeout" , timeout )
162+ self .sleep (0.5 )
162163 self .choose_drop_rate_item ()
163164 box = self .box_of_screen_scaled (2560 , 1440 , 1067 , 940 , 1415 , 992 , name = "drop_rate_btn" , hcenter = True )
164165 self .click_until (
165- click_func = lambda : self .wait_click_box (
166- lambda : self .find_start_btn (box = box ), time_out = 0.25
167- ),
168- check_func = lambda : not self .find_start_btn (box = box ),
166+ click_func = lambda : self .wait_click_box (lambda : self .find_start_btn (box = box ), time_out = 0.25 ),
167+ check_func = lambda : not self .find_drop_item (),
169168 time_out = action_timeout ,
170169 )
171170
@@ -244,19 +243,26 @@ def use_skill(self, skill_time):
244243 return skill_time
245244
246245 def get_round_info (self ):
246+ """获取并更新当前轮次信息。"""
247247 if self .in_team ():
248248 return
249- self .sleep (0.5 )
249+
250+ self .sleep (1 )
250251 round_info_box = self .box_of_screen_scaled (2560 , 1440 , 531 , 517 , 618 , 602 , name = "round_info" , hcenter = True )
251252 texts = self .ocr (box = round_info_box )
252- if texts :
253- prev_round = self .current_round
254- try :
255- self .current_round = int (texts [0 ].name )
256- except :
257- return
258- if prev_round != self .current_round :
259- self .info_set ("当前轮次" , self .current_round )
253+
254+ prev_round = self .current_round
255+ new_round_from_ocr = None
256+ if texts and texts [0 ].name .isdigit ():
257+ new_round_from_ocr = int (texts [0 ].name )
258+
259+ if new_round_from_ocr is not None :
260+ self .current_round = new_round_from_ocr
261+ elif self .current_round != - 1 : # OCR失败,但之前已有轮次记录,则递增
262+ self .current_round += 1
263+
264+ if prev_round != self .current_round :
265+ self .info_set ("当前轮次" , self .current_round )
260266
261267 def get_wave_info (self ):
262268 if not self .in_team ():
0 commit comments