1
0
mirror of https://github.com/TheFunny/ArisuAutoSweeper synced 2026-01-07 16:15:13 +00:00

Compare commits

..

No commits in common. "d756b0dc3fd1710d2e4d5dbcf1d77b57ad713f91" and "44b6d5cdf8f0228ea16115e81170ee3a9655f06c" have entirely different histories.

3 changed files with 11 additions and 17 deletions

View File

@ -41,9 +41,8 @@ class Bounty(BountyUI):
if action == 'stop':
raise RequestHumanTakeover
elif action == 'skip':
with self.config.multi_set():
self.config.task_delay(server_update=True)
self.config.task_stop()
self.config.task_delay(server_update=True)
self.config.task_stop()
@property
def is_ticket_enough(self) -> bool:

View File

@ -12,10 +12,7 @@ class DataUpdate(UI):
Page:
in: page_work
"""
ap, _, ap_total = DigitCounter(OCR_AP).ocr_single_line(self.device.image)
if ap_total == 0:
logger.warning('Invalid AP')
return False
ap = DigitCounter(OCR_AP).ocr_single_line(self.device.image)
# Data for Credit and Pyroxene
ocr = Digit(OCR_DATA)
timeout = Timer(2, count=6).start()
@ -24,28 +21,27 @@ class DataUpdate(UI):
if len(data) != 2:
data = [data[0], data[-1]]
logger.attr('Data', data)
credit, pyroxene = [int(''.join(filter(lambda x: x.isdigit(), d.ocr_text))) for d in data]
credit, pyroxene = [int(''.join([v for v in d.ocr_text if v.isdigit()])) for d in data]
if credit > 0 or pyroxene > 0:
break
logger.warning(f'Invalid credit and pyroxene: {data}')
if timeout.reached():
logger.warning('Get data timeout')
return False
break
logger.attr('Credit', credit)
logger.attr('Pyroxene', pyroxene)
with self.config.multi_set():
self.config.stored.AP.set(ap, ap_total)
self.config.stored.AP.set(ap[0], ap[2])
self.config.stored.Credit.value = credit
self.config.stored.Pyroxene.value = pyroxene
return True
return ap, credit, pyroxene
def run(self):
self.ui_ensure(page_work, acquire_lang_checked=False)
if self._get_data():
with self.config.multi_set():
self._get_data()
self.config.task_delay(server_update=True)
else:
self.config.task_delay(minute=1)

View File

@ -42,9 +42,8 @@ class Scrimmage(ScrimmageUI):
if action == 'stop':
raise RequestHumanTakeover
elif action == 'skip':
with self.config.multi_set():
self.config.task_delay(server_update=True)
self.config.task_stop()
self.config.task_delay(server_update=True)
self.config.task_stop()
@property
def is_ticket_enough(self) -> bool: