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

修复F2打不开书

修复boss传送不了
This commit is contained in:
firedcto@gmail.com 2024-11-14 22:42:43 +08:00
parent 777f295aa1
commit 1f2de04f01
3 changed files with 33 additions and 22 deletions

View File

@ -281,8 +281,8 @@ class BaseChar:
self.logger.info(f'click_liberation end {duration}') self.logger.info(f'click_liberation end {duration}')
return clicked return clicked
def add_freeze_duration(self, start, duration=-1, freeze_time=0.1): def add_freeze_duration(self, start, duration=-1.0, freeze_time=0.1):
if duration == -1: if duration < 0:
duration = time.time() - start duration = time.time() - start
if start > 0 and duration > freeze_time: if start > 0 and duration > freeze_time:
current_time = time.time() current_time = time.time()

View File

@ -24,10 +24,11 @@ class Camellya(BaseChar):
self.logger.error('wait wait_resonance_not_gray timed out') self.logger.error('wait wait_resonance_not_gray timed out')
def do_perform(self): def do_perform(self):
if self.has_intro:
self.continues_normal_attack(1.2)
self.click_liberation() self.click_liberation()
i = 0
start_con = self.get_current_con() start_con = self.get_current_con()
if start_con < 0.8: if start_con < 0.82:
loop_time = 1.1 loop_time = 1.1
else: else:
loop_time = 4.1 loop_time = 4.1
@ -46,19 +47,19 @@ class Camellya(BaseChar):
loop_time = 1 loop_time = 1
budding_start_time = time.time() budding_start_time = time.time()
start_con = current_con start_con = current_con
if self.resonance_available(): if self.click_liberation():
self.send_resonance_key(interval=0.1) pass
if self.get_current_con() < 0.7 and not budding: elif self.click_resonance(send_click=False)[0]:
# self.task.screenshot(f'camellya_fast_end_{self.get_current_con()}') if self.get_current_con() < 0.82 and not budding:
self.click_echo()
return self.switch_next_char() return self.switch_next_char()
else: else:
self.click(interval=0.1) self.click(interval=0.1)
self.task.next_frame() self.task.next_frame()
i += 1 self.check_combat()
if budding: if budding:
self.click_resonance() self.click_resonance()
self.click_echo() self.click_echo()
# self.task.screenshot(f'camellya_end_{self.get_current_con()}')
self.switch_next_char() self.switch_next_char()
# def handle_budding(self): # def handle_budding(self):

View File

@ -349,7 +349,11 @@ class BaseWWTask(BaseTask, FindFeature, OCR):
self.log_info(f'teleport to {boss_name} index {index} in_dungeon {in_dungeon}') self.log_info(f'teleport to {boss_name} index {index} in_dungeon {in_dungeon}')
self.sleep(1) self.sleep(1)
self.log_info('click f2 to open the book') self.log_info('click f2 to open the book')
self.send_key('f2') self.send_key_down('alt')
self.sleep(0.1)
self.click_relative(0.77, 0.05)
self.send_key_up('alt')
# self.send_key('F2')
gray_book_boss = self.wait_book() gray_book_boss = self.wait_book()
if not gray_book_boss: if not gray_book_boss:
self.log_error("can't find gray_book_boss, make sure f2 is the hotkey for book", notify=True) self.log_error("can't find gray_book_boss, make sure f2 is the hotkey for book", notify=True)
@ -377,19 +381,25 @@ class BaseWWTask(BaseTask, FindFeature, OCR):
self.wait_in_team_and_world(time_out=120) self.wait_in_team_and_world(time_out=120)
def click_traval_button(self): def click_traval_button(self):
if self.find_one(['fast_travel_custom', 'remove_custom', 'gray_teleport'], threshold=0.6): if feature := self.find_one(['fast_travel_custom', 'remove_custom', 'gray_teleport'], threshold=0.6):
self.click_relative(0.91, 0.92, after_sleep=1) if feature.name == 'gray_teleport':
if self.wait_click_feature(['confirm_btn_hcenter_vcenter', 'confirm_btn_highlight_hcenter_vcenter'], if not self.wait_click_feature('custom_teleport_hcenter_vcenter', raise_if_not_found=False, time_out=2):
relative_x=-1, raise_if_not_found=False, self.click_relative(0.5, 0.5)
threshold=0.7, self.wait_click_feature('gray_custom_way_point', raise_if_not_found=True)
time_out=4): self.sleep(1)
self.wait_click_feature(['confirm_btn_hcenter_vcenter', 'confirm_btn_highlight_hcenter_vcenter'], self.click_relative(0.91, 0.92, after_sleep=1)
relative_x=-1, raise_if_not_found=False,
threshold=0.7,
time_out=1)
return True return True
else: else:
return True self.click_relative(0.91, 0.92, after_sleep=1)
if self.wait_click_feature(['confirm_btn_hcenter_vcenter', 'confirm_btn_highlight_hcenter_vcenter'],
relative_x=-1, raise_if_not_found=True,
threshold=0.7,
time_out=4):
self.wait_click_feature(['confirm_btn_hcenter_vcenter', 'confirm_btn_highlight_hcenter_vcenter'],
relative_x=-1, raise_if_not_found=False,
threshold=0.7,
time_out=1)
return True
elif btn := self.find_one('gray_teleport', threshold=0.7): elif btn := self.find_one('gray_teleport', threshold=0.7):
return self.click_box(btn, relative_x=1) return self.click_box(btn, relative_x=1)