mirror of
https://github.com/ok-oldking/ok-wuthering-waves.git
synced 2025-06-03 09:25:19 +00:00
优化跳过剧情
This commit is contained in:
parent
094cf6c1fc
commit
73582c2ec4
@ -49,15 +49,6 @@ class BaseCombatTask(BaseWWTask, FindFeature, OCR, CombatCheck):
|
||||
self.combat_start = 0
|
||||
|
||||
self.char_texts = ['char_1_text', 'char_2_text', 'char_3_text']
|
||||
self.multiplayer_check_interval = 3
|
||||
self._in_multiplayer = False
|
||||
self._multiplayer_last_check = 0
|
||||
|
||||
def check_in_multiplayer(self):
|
||||
self._multiplayer_last_check = time.time()
|
||||
self._in_multiplayer = self.find_one('multiplayer_world_mark',
|
||||
threshold=0.75) is not None
|
||||
return self._in_multiplayer
|
||||
|
||||
def send_key_and_wait_animation(self, key, check_function, total_wait=10, animation_wait=5):
|
||||
start = time.time()
|
||||
@ -424,13 +415,6 @@ class BaseCombatTask(BaseWWTask, FindFeature, OCR, CombatCheck):
|
||||
percent = 1
|
||||
return percent
|
||||
|
||||
def in_multiplayer(self):
|
||||
if self._in_multiplayer or self._multiplayer_last_check == 0:
|
||||
return self.check_in_multiplayer()
|
||||
if not self._in_multiplayer and time.time() - self._multiplayer_last_check > self.multiplayer_check_interval:
|
||||
return self.check_in_multiplayer()
|
||||
return self._in_multiplayer
|
||||
|
||||
def mouse_reset(self):
|
||||
# # logger.debug("mouse_reset")
|
||||
# try:
|
||||
|
@ -33,6 +33,10 @@ class BaseWWTask(BaseTask, FindFeature, OCR):
|
||||
self.monthly_card_config = self.get_config(monthly_card_config_option)
|
||||
self.next_monthly_card_start = 0
|
||||
|
||||
self.multiplayer_check_interval = 3
|
||||
self._in_multiplayer = False
|
||||
self._multiplayer_last_check = 0
|
||||
|
||||
def validate(self, key, value):
|
||||
message = self.validate_config(key, value)
|
||||
if message:
|
||||
@ -258,6 +262,19 @@ class BaseWWTask(BaseTask, FindFeature, OCR):
|
||||
return self.in_team()[
|
||||
0] # and self.find_one(f'gray_book_button', threshold=0.7, canny_lower=50, canny_higher=150)
|
||||
|
||||
def check_in_multiplayer(self):
|
||||
self._multiplayer_last_check = time.time()
|
||||
self._in_multiplayer = self.find_one('multiplayer_world_mark',
|
||||
threshold=0.75) is not None
|
||||
return self._in_multiplayera
|
||||
|
||||
def in_multiplayer(self):
|
||||
if self._in_multiplayer or self._multiplayer_last_check == 0:
|
||||
return self.check_in_multiplayer()
|
||||
if not self._in_multiplayer and time.time() - self._multiplayer_last_check > self.multiplayer_check_interval:
|
||||
return self.check_in_multiplayer()
|
||||
return self._in_multiplayer
|
||||
|
||||
def in_team(self):
|
||||
if self.in_multiplayer():
|
||||
return False, -1, -1
|
||||
|
Loading…
x
Reference in New Issue
Block a user