0
0
mirror of https://github.com/ok-oldking/ok-wuthering-waves.git synced 2025-04-24 08:25:16 +00:00

优化拾取声骸

This commit is contained in:
firedcto@gmail.com 2025-04-06 18:26:36 +08:00
parent f0640c28ea
commit 7d3210532a
2 changed files with 9 additions and 8 deletions

View File

@ -56,7 +56,7 @@ numpy==2.2.4
# shapely
rapidocr==2.0.6
# via -r .\requirements.in
ok-script==0.0.519
ok-script==0.0.521
# via -r .\requirements.in
omegaconf==2.3.0
# via ok-rapidocr-dml

View File

@ -405,8 +405,7 @@ class BaseWWTask(BaseTask):
front_box = self.box_of_screen(0.35, 0.35, 0.65, 0.53, hcenter=True)
color_threshold = 0.02
for i in range(4):
self.middle_click_relative(0.5, 0.5, down_time=0.2)
self.sleep(0.4)
self.center_camera()
echo = self.find_echo()
if self.debug:
self.draw_boxes('echo', echo)
@ -421,16 +420,18 @@ class BaseWWTask(BaseTask):
if color_percent > color_threshold:
if self.debug:
self.screenshot('echo_color_picked')
found = self.walk_find_echo(backward_time=0.5)
self.log_debug(f'found color_percent {color_percent} > {color_threshold}, walk now')
return found
self.send_key('a', down_time=0.04)
self.sleep(0.6)
return self.walk_find_echo()
self.send_key('a', down_time=0.05)
self.sleep(0.5)
self.middle_click_relative(0.5, 0.5, down_time=0.2)
self.center_camera()
picked = self.walk_find_echo()
return picked
def center_camera(self):
self.click(0.5, 0.5, down_time=0.2, after_sleep=0.5, key='middle')
def walk_find_echo(self, backward_time=1):
if self.walk_until_f(time_out=4, backward_time=backward_time, target_text=self.absorb_echo_text(),
raise_if_not_found=False): # find and pick echo