0
0
mirror of https://github.com/ok-oldking/ok-wuthering-waves.git synced 2025-06-05 08:25:28 +00:00

修复出本后可能会卡住(fix #3)

修复刷冰蚊子可能卡住(fix #8)
This commit is contained in:
firedcto@gmail.com 2024-07-18 17:59:47 +08:00
parent 974ac33f20
commit 6ffac69556
21 changed files with 550 additions and 508 deletions

File diff suppressed because it is too large Load Diff

View File

@ -25,6 +25,7 @@ class CombatCheck:
self.boss_health_box = None
self.boss_health = None
self.out_of_combat_reason = ""
self.combat_check_interval = 0.8
def reset_to_false(self, recheck=False, reason=""):
if is_pure_black(self.frame):
@ -133,7 +134,7 @@ class CombatCheck:
return True
if self._in_combat:
now = time.time()
if now - self.last_combat_check > 1:
if now - self.last_combat_check > self.combat_check_interval:
self.last_combat_check = now
if not self.in_team()[0]:
return self.reset_to_false(recheck=False, reason="not in team")

View File

@ -244,8 +244,7 @@ class BaseCombatTask(BaseTask, FindFeature, OCR, CombatCheck):
return True
def walk_until_f(self, direction='w', time_out=0, raise_if_not_found=True, backward_time=0):
if not self.find_one('pick_up_f', horizontal_variance=0.1, vertical_variance=0.1, threshold=0.8,
use_gray_scale=True):
if not self.find_one('pick_up_f', horizontal_variance=0.01, vertical_variance=0.01, threshold=0.8):
if backward_time > 0:
if self.send_key_and_wait_f('s', raise_if_not_found, backward_time):
return True

View File

@ -51,7 +51,7 @@ class FarmEchoTask(BaseCombatTask):
self.combat_once()
logger.info(f'farm echo combat end')
self.wait_in_team_and_world(time_out=20)
logger.info(f'farm echo move forward walk_until_f to find echo')
logger.info(f'farm echo move {self.config.get("Entrance Direction")} walk_until_f to find echo')
if self.config.get('Entrance Direction') == 'Forward':
dropped = self.walk_until_f(time_out=3,
raise_if_not_found=False) # find and pick echo

View File

@ -61,17 +61,15 @@ class FarmWorldBossTask(BaseCombatTask):
else:
logger.info('click normal boss')
self.click_relative(0.21, 0.36)
# self.wait_click_feature('gray_book_forgery', raise_if_not_found=True, use_gray_scale=True, threshold=0.7)
# self.wait_click_feature('gray_book_boss', raise_if_not_found=True, use_gray_scale=True, threshold=0.7)
self.sleep(1)
# while index > 4: # first page
if index > 4:
self.log_info(f'click scroll bar')
self.click_relative(3760 / 3840, 1852 / 2160)
self.sleep(0.5)
# self.scroll_down_a_page()
index -= 4
# y = y + (index - 1) * distance
self.log_info(f'index after scrolling down {index}')
proceeds = self.find_feature('boss_proceed', vertical_variance=1, use_gray_scale=True, threshold=0.8)
if self.debug:
@ -79,8 +77,6 @@ class FarmWorldBossTask(BaseCombatTask):
if not proceeds:
raise Exception("can't find the boss proceeds")
# self.click_relative(self.crownless_pos[0], self.crownless_pos[1])
# self.wait_click_feature('gray_teleport', raise_if_not_found=True, use_gray_scale=True)
self.wait_feature('gray_teleport', raise_if_not_found=True, use_gray_scale=True, time_out=120,
pre_action=lambda: self.click_box(proceeds[index], relative_x=-1), wait_until_before_delay=5)
self.sleep(1)
@ -92,7 +88,7 @@ class FarmWorldBossTask(BaseCombatTask):
self.wait_click_feature('gray_custom_way_point', box=self.box_of_screen(0.62, 0.48, 0.70, 0.66),
raise_if_not_found=True,
use_gray_scale=True, threshold=0.75, time_out=2)
travel = self.wait_feature('fast_travel_custom', raise_if_not_found=True, use_gray_scale=True, threshold=0.75)
travel = self.wait_feature('fast_travel_custom', raise_if_not_found=True, threshold=0.75)
self.click_box(travel, relative_x=1.5)
def wait_book(self):