mirror of
https://github.com/TheFunny/ArisuAutoSweeper
synced 2025-12-17 21:55:36 +00:00
Compare commits
2 Commits
44b6d5cdf8
...
d756b0dc3f
| Author | SHA1 | Date | |
|---|---|---|---|
| d756b0dc3f | |||
| e71118c09e |
@ -41,8 +41,9 @@ class Bounty(BountyUI):
|
||||
if action == 'stop':
|
||||
raise RequestHumanTakeover
|
||||
elif action == 'skip':
|
||||
self.config.task_delay(server_update=True)
|
||||
self.config.task_stop()
|
||||
with self.config.multi_set():
|
||||
self.config.task_delay(server_update=True)
|
||||
self.config.task_stop()
|
||||
|
||||
@property
|
||||
def is_ticket_enough(self) -> bool:
|
||||
|
||||
@ -12,7 +12,10 @@ class DataUpdate(UI):
|
||||
Page:
|
||||
in: page_work
|
||||
"""
|
||||
ap = DigitCounter(OCR_AP).ocr_single_line(self.device.image)
|
||||
ap, _, ap_total = DigitCounter(OCR_AP).ocr_single_line(self.device.image)
|
||||
if ap_total == 0:
|
||||
logger.warning('Invalid AP')
|
||||
return False
|
||||
# Data for Credit and Pyroxene
|
||||
ocr = Digit(OCR_DATA)
|
||||
timeout = Timer(2, count=6).start()
|
||||
@ -21,27 +24,28 @@ class DataUpdate(UI):
|
||||
if len(data) != 2:
|
||||
data = [data[0], data[-1]]
|
||||
logger.attr('Data', data)
|
||||
credit, pyroxene = [int(''.join([v for v in d.ocr_text if v.isdigit()])) for d in data]
|
||||
credit, pyroxene = [int(''.join(filter(lambda x: x.isdigit(), d.ocr_text))) 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')
|
||||
break
|
||||
return False
|
||||
|
||||
logger.attr('Credit', credit)
|
||||
logger.attr('Pyroxene', pyroxene)
|
||||
with self.config.multi_set():
|
||||
self.config.stored.AP.set(ap[0], ap[2])
|
||||
self.config.stored.AP.set(ap, ap_total)
|
||||
self.config.stored.Credit.value = credit
|
||||
self.config.stored.Pyroxene.value = pyroxene
|
||||
|
||||
return ap, credit, pyroxene
|
||||
return True
|
||||
|
||||
def run(self):
|
||||
self.ui_ensure(page_work, acquire_lang_checked=False)
|
||||
|
||||
with self.config.multi_set():
|
||||
self._get_data()
|
||||
if self._get_data():
|
||||
self.config.task_delay(server_update=True)
|
||||
else:
|
||||
self.config.task_delay(minute=1)
|
||||
|
||||
@ -42,8 +42,9 @@ class Scrimmage(ScrimmageUI):
|
||||
if action == 'stop':
|
||||
raise RequestHumanTakeover
|
||||
elif action == 'skip':
|
||||
self.config.task_delay(server_update=True)
|
||||
self.config.task_stop()
|
||||
with self.config.multi_set():
|
||||
self.config.task_delay(server_update=True)
|
||||
self.config.task_stop()
|
||||
|
||||
@property
|
||||
def is_ticket_enough(self) -> bool:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user