@@ -313,8 +313,6 @@ def get_rewards():
313313 self .click_box_random (target_item ['reward_obj' ], left_extend = 0.015 , right_extend = 0.015 , up_extend = 0.03 , down_extend = 0.03 , down_time = 0.02 , after_sleep = 0.5 )
314314
315315 def choose_letter_reward (self , timeout = 0 ):
316- if not hasattr (self , "config" ):
317- return
318316 action_timeout = self .action_timeout if timeout == 0 else timeout
319317 if self .config .get ("自动选择首个密函和密函奖励" , False ):
320318 if self .config .get ("优先选择密函奖励" , "不使用" ) != "不使用" :
@@ -333,20 +331,7 @@ def choose_letter_reward(self, timeout=0):
333331 time_out = 300 ,
334332 raise_if_not_found = True ,
335333 )
336- self .sleep (3 )
337-
338- def use_skill (self , skill_time ):
339- if not hasattr (self , "config" ):
340- return
341- if self .config .get ("使用技能" , "不使用" ) != "不使用" and time .time () - skill_time >= self .config .get ("技能释放频率" , 5 ):
342- skill_time = time .time ()
343- if self .config .get ("使用技能" ) == "战技" :
344- self .get_current_char ().send_combat_key ()
345- elif self .config .get ("使用技能" ) == "终结技" :
346- self .get_current_char ().send_ultimate_key ()
347- elif self .config .get ("使用技能" ) == "魔灵支援" :
348- self .get_current_char ().send_geniemon_key ()
349- return skill_time
334+ self .sleep (0.1 )
350335
351336 def create_skill_ticker (self ):
352337
@@ -366,8 +351,8 @@ def get_round_info(self):
366351 """获取并更新当前轮次信息。"""
367352 if self .in_team ():
368353 return
369-
370- self .sleep ( 1 )
354+ box = self . box_of_screen ( 0.241 , 0.361 , 0.259 , 0.394 , name = "green_mark" , hcenter = True )
355+ self .wait_until ( lambda : self . calculate_color_percentage ( green_mark_color , box ) > 0.135 , time_out = 1 )
371356 round_info_box = self .box_of_screen_scaled (2560 , 1440 , 531 , 517 , 618 , 602 , name = "round_info" , hcenter = True )
372357 texts = self .ocr (box = round_info_box )
373358
@@ -477,24 +462,23 @@ def find_next_hint(self, x1, y1, x2, y2, s, box_name="hint_text"):
477462
478463 def reset_and_transport (self ):
479464 self .open_in_mission_menu ()
480- self .sleep (0.8 )
481465 self .wait_until (
482466 condition = lambda : not self .find_esc_menu (),
483- post_action = self .click_relative_random (0.688 , 0.875 , 0.770 , 0.956 , after_sleep = 0.5 ),
467+ post_action = self .click_relative_random (0.688 , 0.875 , 0.770 , 0.956 ),
484468 time_out = 10 ,
485469 )
486470 setting_box = self .box_of_screen_scaled (2560 , 1440 , 738 , 4 , 1123 , 79 , name = "other_section" , hcenter = True )
487471 setting_other = self .wait_until (lambda : self .find_one ("setting_other" , box = setting_box ), time_out = 10 ,
488472 raise_if_not_found = True )
489473 self .wait_until (
490474 condition = lambda : self .calculate_color_percentage (setting_menu_selected_color , setting_other ) > 0.24 ,
491- post_action = lambda : self .click_box_random (setting_other , after_sleep = 0.5 ),
475+ post_action = lambda : self .click_box_random (setting_other ),
492476 time_out = 10 ,
493477 )
494478 confirm_box = self .box_of_screen_scaled (2560 , 1440 , 1298 , 776 , 1368 , 843 , name = "confirm_btn" , hcenter = True )
495479 self .wait_until (
496480 condition = lambda : self .find_start_btn (box = confirm_box ),
497- post_action = lambda : self .click_relative_random (0.501 , 0.294 , 0.690 , 0.325 , use_safe_move = True , after_sleep = 0.5 ),
481+ post_action = lambda : self .click_relative_random (0.501 , 0.294 , 0.690 , 0.325 , use_safe_move = True ),
498482 time_out = 10 ,
499483 )
500484 if not self .wait_until (condition = self .in_team , post_action = lambda : self .click_relative_random (0.514 , 0.547 , 0.671 , 0.578 , after_sleep = 0.5 ),
@@ -543,6 +527,12 @@ def reset(self):
543527 'b' : (79 , 89 ) # Blue range
544528}
545529
530+ green_mark_color = {
531+ 'r' : (40 , 55 ), # Red range
532+ 'g' : (165 , 170 ), # Green range
533+ 'b' : (120 , 130 ) # Blue range
534+ }
535+
546536
547537def _default_movement ():
548538 pass
0 commit comments