mirror of
https://github.com/ok-oldking/ok-wuthering-waves.git
synced 2025-06-07 09:25:34 +00:00
fix farm world boss scrolling
This commit is contained in:
parent
9ead6ff524
commit
5e23415317
@ -45,15 +45,16 @@ class FarmWorldBossTask(BaseCombatTask):
|
|||||||
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('f2')
|
||||||
gray_book_boss = self.wait_until(lambda: self.find_one('gray_book_boss', vertical_variance=1,
|
gray_book_boss = self.wait_until(
|
||||||
threshold=0.8, canny_lower=50,
|
lambda: self.find_one('gray_book_boss', vertical_variance=1, horizontal_variance=0.05,
|
||||||
canny_higher=150) or self.find_one(
|
threshold=0.8, canny_lower=50,
|
||||||
'gray_book_boss_highlight',
|
canny_higher=150) or self.find_one(
|
||||||
vertical_variance=1,
|
'gray_book_boss_highlight',
|
||||||
threshold=0.8,
|
vertical_variance=1, horizontal_variance=0.05,
|
||||||
canny_lower=50,
|
threshold=0.8,
|
||||||
canny_higher=150),
|
canny_lower=50,
|
||||||
time_out=3)
|
canny_higher=150),
|
||||||
|
time_out=3)
|
||||||
if not gray_book_boss:
|
if not gray_book_boss:
|
||||||
self.log_error("can't find the gray_book_boss", notify=True)
|
self.log_error("can't find the gray_book_boss", notify=True)
|
||||||
raise Exception("can't find gray_book_boss")
|
raise Exception("can't find gray_book_boss")
|
||||||
@ -109,15 +110,16 @@ class FarmWorldBossTask(BaseCombatTask):
|
|||||||
source_template = Feature(source_box.crop_frame(self.frame), source_box.x, source_box.y)
|
source_template = Feature(source_box.crop_frame(self.frame), source_box.x, source_box.y)
|
||||||
target_box = self.box_of_screen(0.38, 0.16, 0.42, 0.33)
|
target_box = self.box_of_screen(0.38, 0.16, 0.42, 0.33)
|
||||||
start = time.time()
|
start = time.time()
|
||||||
|
|
||||||
|
self.click_relative(0.5, 0.5)
|
||||||
|
self.sleep(0.1)
|
||||||
# count = 0
|
# count = 0
|
||||||
while True:
|
while True:
|
||||||
if time.time() - start > 20:
|
if time.time() - start > 20:
|
||||||
raise Exception("scroll to long")
|
raise Exception("scroll to long")
|
||||||
# if count % 10 == 0:
|
# if count % 10 == 0:
|
||||||
self.click_relative(0.5, 0.7)
|
|
||||||
self.sleep(0.1)
|
|
||||||
# count += 1
|
# count += 1
|
||||||
self.scroll_relative(0.7, 0.7, -2)
|
self.scroll_relative(0.5, 0.5, -2)
|
||||||
self.sleep(0.1)
|
self.sleep(0.1)
|
||||||
targets = self.find_feature('target_box', box=target_box, template=source_template)
|
targets = self.find_feature('target_box', box=target_box, template=source_template)
|
||||||
if targets:
|
if targets:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user