Skip to content

Commit

Permalink
修复F2打不开书
Browse files Browse the repository at this point in the history
修复boss传送不了
  • Loading branch information
ok-oldking committed Nov 14, 2024
1 parent 777f295 commit 1f2de04
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 22 deletions.
4 changes: 2 additions & 2 deletions src/char/BaseChar.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,8 +281,8 @@ def click_liberation(self, con_less_than=-1, send_click=False, wait_if_cd_ready=
self.logger.info(f'click_liberation end {duration}')
return clicked

def add_freeze_duration(self, start, duration=-1, freeze_time=0.1):
if duration == -1:
def add_freeze_duration(self, start, duration=-1.0, freeze_time=0.1):
if duration < 0:
duration = time.time() - start
if start > 0 and duration > freeze_time:
current_time = time.time()
Expand Down
17 changes: 9 additions & 8 deletions src/char/Camellya.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,11 @@ def wait_resonance_not_gray(self, timeout=5):
self.logger.error('wait wait_resonance_not_gray timed out')

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

# def handle_budding(self):
Expand Down
34 changes: 22 additions & 12 deletions src/task/BaseWWTask.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,11 @@ def teleport_to_boss(self, boss_name):
self.log_info(f'teleport to {boss_name} index {index} in_dungeon {in_dungeon}')
self.sleep(1)
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()
if not gray_book_boss:
self.log_error("can't find gray_book_boss, make sure f2 is the hotkey for book", notify=True)
Expand Down Expand Up @@ -377,19 +381,25 @@ def teleport_to_boss(self, boss_name):
self.wait_in_team_and_world(time_out=120)

def click_traval_button(self):
if self.find_one(['fast_travel_custom', 'remove_custom', 'gray_teleport'], threshold=0.6):
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=False,
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)
if feature := self.find_one(['fast_travel_custom', 'remove_custom', 'gray_teleport'], threshold=0.6):
if feature.name == 'gray_teleport':
if not self.wait_click_feature('custom_teleport_hcenter_vcenter', raise_if_not_found=False, time_out=2):
self.click_relative(0.5, 0.5)
self.wait_click_feature('gray_custom_way_point', raise_if_not_found=True)
self.sleep(1)
self.click_relative(0.91, 0.92, after_sleep=1)
return True
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):
return self.click_box(btn, relative_x=1)

Expand Down

0 comments on commit 1f2de04

Please sign in to comment.