1
0
mirror of https://gitee.com/sui-feng-cb/AzurLaneAutoScript1 synced 2026-03-22 18:43:44 +08:00

Fix: Handle missing / in tactical skill ocr

This commit is contained in:
LmeSzinc
2024-02-06 20:29:10 +08:00
parent a8a5f5b888
commit 1750f31199
2 changed files with 17 additions and 2 deletions

View File

@@ -24,12 +24,12 @@ class StockCounter(DigitCounter):
def after_process(self, result):
result = super().after_process(result)
if re.match(f'^\d\d$', result):
if re.match(r'^\d\d$', result):
# 55 -> 5/5
new = f'{result[0]}/{result[1]}'
logger.info(f'StockCounter result {result} is revised to {new}')
result = new
if re.match(f'^\d{4,}$', result):
if re.match(r'^\d{4,}$', result):
# 1515 -> 15/15
new = f'{result[0:2]}/{result[2:4]}'
logger.info(f'StockCounter result {result} is revised to {new}')