Skip to content

Commit

Permalink
修复出本后可能会卡住(fix #3)
Browse files Browse the repository at this point in the history
修复刷冰蚊子可能卡住(fix #8)
  • Loading branch information
ok-oldking committed Jul 18, 2024
1 parent 974ac33 commit 6ffac69
Show file tree
Hide file tree
Showing 21 changed files with 467 additions and 425 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
872 changes: 459 additions & 413 deletions assets/_annotations.coco.json

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion src/combat/CombatCheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ def __init__(self):
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):
Expand Down Expand Up @@ -133,7 +134,7 @@ def in_combat(self, rechecked=False):
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")
Expand Down
3 changes: 1 addition & 2 deletions src/task/BaseCombatTask.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,7 @@ def handle_claim_button(self):
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
Expand Down
2 changes: 1 addition & 1 deletion src/task/FarmEchoTask.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def run(self):
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
Expand Down
12 changes: 4 additions & 8 deletions src/task/FarmWorldBossTask.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,26 +61,22 @@ def teleport(self, boss_name):
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:
self.screenshot('proceeds')
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)
Expand All @@ -92,7 +88,7 @@ def teleport(self, boss_name):
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):
Expand Down

0 comments on commit 6ffac69

Please sign in to comment.