Fix: Wrong OCR result for build ticket count

Fix: Wrong OCR result for build ticket count

Fix: Wrong OCR result for build ticket count (1)
This commit is contained in:
freesrz93 2022-07-29 08:55:17 +08:00
parent 2ff351c2aa
commit b68e8abb6a
6 changed files with 5 additions and 1 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

View File

@ -13,6 +13,7 @@ BUILD_SUBMIT_COUNT = Button(area={'cn': (628, 260, 739, 288), 'en': (604, 257, 6
BUILD_SUBMIT_ORDERS = Button(area={'cn': (1032, 603, 1223, 657), 'en': (1033, 603, 1223, 656), 'jp': (1034, 606, 1220, 656), 'tw': (1036, 606, 1220, 656)}, color={'cn': (236, 186, 112), 'en': (236, 188, 115), 'jp': (237, 189, 120), 'tw': (238, 193, 126)}, button={'cn': (1032, 603, 1223, 657), 'en': (1033, 603, 1223, 656), 'jp': (1034, 606, 1220, 656), 'tw': (1036, 606, 1220, 656)}, file={'cn': './assets/cn/gacha/BUILD_SUBMIT_ORDERS.png', 'en': './assets/en/gacha/BUILD_SUBMIT_ORDERS.png', 'jp': './assets/jp/gacha/BUILD_SUBMIT_ORDERS.png', 'tw': './assets/tw/gacha/BUILD_SUBMIT_ORDERS.png'})
BUILD_SUBMIT_WW_COUNT = Button(area={'cn': (628, 260, 739, 288), 'en': (650, 257, 714, 291), 'jp': (645, 260, 717, 290), 'tw': (614, 255, 747, 294)}, color={'cn': (72, 79, 92), 'en': (75, 80, 90), 'jp': (75, 80, 90), 'tw': (70, 76, 86)}, button={'cn': (628, 260, 739, 288), 'en': (650, 257, 714, 291), 'jp': (645, 260, 717, 290), 'tw': (614, 255, 747, 294)}, file={'cn': './assets/cn/gacha/BUILD_SUBMIT_WW_COUNT.png', 'en': './assets/en/gacha/BUILD_SUBMIT_WW_COUNT.png', 'jp': './assets/jp/gacha/BUILD_SUBMIT_WW_COUNT.png', 'tw': './assets/tw/gacha/BUILD_SUBMIT_WW_COUNT.png'})
BUILD_SUBMIT_WW_ORDERS = Button(area={'cn': (495, 570, 705, 625), 'en': (504, 578, 694, 618), 'jp': (505, 580, 646, 620), 'tw': (506, 580, 646, 620)}, color={'cn': (231, 217, 91), 'en': (231, 218, 92), 'jp': (209, 200, 89), 'tw': (201, 192, 86)}, button={'cn': (495, 570, 705, 625), 'en': (504, 578, 694, 618), 'jp': (505, 580, 646, 620), 'tw': (506, 580, 646, 620)}, file={'cn': './assets/cn/gacha/BUILD_SUBMIT_WW_ORDERS.png', 'en': './assets/en/gacha/BUILD_SUBMIT_WW_ORDERS.png', 'jp': './assets/jp/gacha/BUILD_SUBMIT_WW_ORDERS.png', 'tw': './assets/tw/gacha/BUILD_SUBMIT_WW_ORDERS.png'})
BUILD_TICKET_CHECK = Button(area={'cn': (640, 110, 677, 131), 'en': (640, 110, 677, 131), 'jp': (640, 110, 677, 131), 'tw': (640, 110, 677, 131)}, color={'cn': (56, 107, 211), 'en': (56, 107, 211), 'jp': (56, 107, 211), 'tw': (56, 107, 211)}, button={'cn': (640, 110, 677, 131), 'en': (640, 110, 677, 131), 'jp': (640, 110, 677, 131), 'tw': (640, 110, 677, 131)}, file={'cn': './assets/cn/gacha/BUILD_TICKET_CHECK.png', 'en': './assets/en/gacha/BUILD_TICKET_CHECK.png', 'jp': './assets/jp/gacha/BUILD_TICKET_CHECK.png', 'tw': './assets/tw/gacha/BUILD_TICKET_CHECK.png'})
BUILD_TICKET_COUNT = Button(area={'cn': (681, 105, 788, 138), 'en': (681, 105, 788, 138), 'jp': (681, 105, 788, 138), 'tw': (681, 105, 788, 138)}, color={'cn': (47, 50, 62), 'en': (47, 50, 62), 'jp': (47, 50, 62), 'tw': (47, 50, 62)}, button={'cn': (681, 105, 788, 138), 'en': (681, 105, 788, 138), 'jp': (681, 105, 788, 138), 'tw': (681, 105, 788, 138)}, file={'cn': './assets/cn/gacha/BUILD_TICKET_COUNT.png', 'en': './assets/en/gacha/BUILD_TICKET_COUNT.png', 'jp': './assets/cn/gacha/BUILD_TICKET_COUNT.png', 'tw': './assets/cn/gacha/BUILD_TICKET_COUNT.png'})
BUILD_WW_CHECK = Button(area={'cn': (620, 624, 763, 655), 'en': (602, 603, 784, 650), 'jp': (602, 603, 784, 650), 'tw': (621, 603, 764, 655)}, color={'cn': (129, 137, 152), 'en': (99, 116, 137), 'jp': (99, 116, 137), 'tw': (103, 115, 133)}, button={'cn': (620, 624, 763, 655), 'en': (602, 603, 784, 650), 'jp': (602, 603, 784, 650), 'tw': (621, 603, 764, 655)}, file={'cn': './assets/cn/gacha/BUILD_WW_CHECK.png', 'en': './assets/en/gacha/BUILD_WW_CHECK.png', 'jp': './assets/jp/gacha/BUILD_WW_CHECK.png', 'tw': './assets/tw/gacha/BUILD_WW_CHECK.png'})
SHOP_MEDAL_CHECK = Button(area={'cn': (573, 102, 604, 145), 'en': (573, 102, 604, 145), 'jp': (574, 102, 604, 144), 'tw': (573, 102, 604, 145)}, color={'cn': (93, 102, 118), 'en': (93, 102, 118), 'jp': (94, 103, 118), 'tw': (93, 102, 118)}, button={'cn': (573, 102, 604, 145), 'en': (573, 102, 604, 145), 'jp': (574, 102, 604, 144), 'tw': (573, 102, 604, 145)}, file={'cn': './assets/cn/gacha/SHOP_MEDAL_CHECK.png', 'en': './assets/en/gacha/SHOP_MEDAL_CHECK.png', 'jp': './assets/jp/gacha/SHOP_MEDAL_CHECK.png', 'tw': './assets/tw/gacha/SHOP_MEDAL_CHECK.png'})

View File

@ -298,7 +298,10 @@ class RewardGacha(GachaUI, GeneralShop, Retirement):
# buy = [rolls_using_tickets, rolls_using_cubes]
buy = [self.config.Gacha_Amount, 0]
if actual_pool == "event" and self.config.Gacha_UseTicket:
self.build_ticket_count = OCR_BUILD_TICKET_COUNT.ocr(self.device.image)
if self.appear(BUILD_TICKET_CHECK, offset=(30, 30)):
self.build_ticket_count = OCR_BUILD_TICKET_COUNT.ocr(self.device.image)
else:
logger.info('Build ticket not detected, use cubes and coins')
if self.config.Gacha_Amount > self.build_ticket_count:
buy[0] = self.build_ticket_count
# Calculate rolls allowed based on configurations and resources