Skip to content

Commit

Permalink
给read_screen传入彩色图片
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhaoZuohong committed Oct 13, 2023
1 parent 10f5ba2 commit 86139e9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions arknights_mower/solvers/base_schedule.py
Original file line number Diff line number Diff line change
Expand Up @@ -963,7 +963,7 @@ def read_time(self, cord, upperlimit, error_count=0, use_digit_reader=False):
if use_digit_reader:
time_str = self.digit_reader.get_time(self.recog.gray)
else:
time_str = self.read_screen(self.recog.gray, type='time', cord=cord)
time_str = self.read_screen(self.recog.img, type='time', cord=cord)
try:
h, m, s = str(time_str).split(':')
if int(m) > 60 or int(s) > 60:
Expand Down Expand Up @@ -1837,7 +1837,7 @@ def get_agent_from_room(self, room, read_time_index=None):
if room == 'meeting':
time.sleep(3)
self.recog.update()
clue_res = self.read_screen(self.recog.gray, limit=10, cord=(645, 977, 755, 1018))
clue_res = self.read_screen(self.recog.img, limit=10, cord=(645, 977, 755, 1018))
if clue_res != 11:
self.clue_count = clue_res
logger.info(f'当前拥有线索数量为{self.clue_count}')
Expand Down Expand Up @@ -1865,7 +1865,7 @@ def get_agent_from_room(self, room, read_time_index=None):
interval=1, rebuild=True)
swiped = True
data = {}
_name = self.read_screen(self.recog.gray[name_p[i][0][1]:name_p[i][1][1], name_p[i][0][0]:name_p[i][1][0]],
_name = self.read_screen(self.recog.img[name_p[i][0][1]:name_p[i][1][1], name_p[i][0][0]:name_p[i][1][0]],
type="name")
error_count = 0
while i >= 3 and _name != '' and (
Expand All @@ -1874,7 +1874,7 @@ def get_agent_from_room(self, room, read_time_index=None):
self.swipe((self.recog.w * 0.8, self.recog.h * 0.5), (0, -self.recog.h * 0.45), duration=500,
interval=1, rebuild=True)
_name = self.read_screen(
self.recog.gray[name_p[i][0][1]:name_p[i][1][1], name_p[i][0][0]:name_p[i][1][0]], type="name")
self.recog.img[name_p[i][0][1]:name_p[i][1][1], name_p[i][0][0]:name_p[i][1][0]], type="name")
error_count += 1
if error_count > 1:
raise Exception("超过出错上限")
Expand Down

0 comments on commit 86139e9

Please sign in to comment.