Skip to content

Commit

Permalink
修复有活动限时任务无法领取日常
Browse files Browse the repository at this point in the history
  • Loading branch information
ok-oldking committed Jun 15, 2024
1 parent 562e8f7 commit cb46166
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
4 changes: 2 additions & 2 deletions task/BJTask.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
from ok.feature.Box import boxes_to_map_by_list_of_names, find_box_by_name
from ok.feature.FindFeature import FindFeature
from ok.ocr.OCR import OCR
from ok.task.OneTimeTask import OneTimeTask
from ok.task.BaseTask import BaseTask


class BJTask(OneTimeTask, OCR, FindFeature):
class BJTask(BaseTask, OCR, FindFeature):
def __init__(self):
super(BJTask, self).__init__()
self.main_menu_buttons = None
Expand Down
20 changes: 9 additions & 11 deletions task/DailyTask.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,15 @@ def claim_dayueka(self):
self.go_home_wait()

def claim_quest(self):
while True:
self.choose_main_menu(re.compile(r"(完成|任务)"))
claim = self.wait_ocr(0.8, 0.75, 0.93, 0.81, match=re.compile(r"领取"), time_out=4)
if not claim:
self.click_relative(0.36, 0.05)
return
else:
self.click_box(claim)
while self.click_to_continue_wait(time_out=4):
self.sleep(2)
self.click_relative(0.37, 0.05)
self.choose_main_menu(re.compile(r"(完成|任务)"))
self.wait_click_ocr(0.03, 0.2, 0.16, 0.83, match="日常")
if self.wait_click_ocr(0.8, 0.75, 0.93, 0.81, match=re.compile(r"领取"), time_out=4):
self.click_to_continue_wait(time_out=4)
self.wait_click_ocr(0.03, 0.2, 0.16, 0.83, match="周常")
if self.wait_click_ocr(0.8, 0.75, 0.93, 0.81, match=re.compile(r"领取"), time_out=4):
self.click_to_continue_wait(time_out=4)
self.sleep(2)
self.click_relative(0.37, 0.05)

def laohen_up(self):
self.choose_main_menu("记忆烙痕")
Expand Down

0 comments on commit cb46166

Please sign in to comment.