Skip to content

Commit

Permalink
fix schedule cafe_reward
Browse files Browse the repository at this point in the history
  • Loading branch information
pur1fying committed Dec 26, 2023
1 parent b084e0e commit 98bc49f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions module/cafe_reward.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ def cn_implement(self):
op = np.full(2, False, dtype=bool)
if not image.compare_image(self, 'cafe_0.0', 3):
op[0] = True
if self.ocrCN.ocr_for_single_line(image.screenshot_cut(self, (801, 586, 875, 606), self.latest_img_array))[
'text'] == "可以使用":
res = self.ocrCN.ocr_for_single_line(image.screenshot_cut(self, (801, 586, 875, 606), self.latest_img_array))['text'].replace('<unused3>', '')
if res == "可以使用":
op[1] = True
if op[0]:
self.logger.info("Collect Cafe Earnings")
Expand Down
4 changes: 2 additions & 2 deletions module/lesson.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ def get_region_num(self, region_name, letter_dict=None, region_name_len=None):
self.latest_img_array = self.get_screenshot_array()
t1 = time.time()
name = self.ocrCN.ocr_for_single_line(self.latest_img_array[97:128, 925:1240])['text']
name.replace('<unused3>', '')
name = name.replace('<unused3>', '')
t2 = time.time()
self.logger.info("ocr_lesson_name:" + str(t2 - t1))
for i in range(4, -1, -1):
for i in range(6, -1, -1):
if name[i] in ['评', '级', ' '] or name[i].isdigit():
name = name[i + 1:]
break
Expand Down

0 comments on commit 98bc49f

Please sign in to comment.