Merge pull request #4291 from LmeSzinc/dev

Bug fix
This commit is contained in:
LmeSzinc 2024-10-16 13:06:35 +08:00 committed by GitHub
commit 423ac123bf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
67 changed files with 67 additions and 29 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 9.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 53 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 429 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.3 KiB

After

Width:  |  Height:  |  Size: 9.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

After

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.0 KiB

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.3 KiB

After

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.3 KiB

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View File

@ -58,12 +58,15 @@ class CampaignBase(CampaignBase_):
Fixed number of scrolls until give up, may need to
increase as more war archives campaigns are added
"""
for _ in range(10):
for _ in range(20):
if skip_first_screenshot:
skip_first_screenshot = False
else:
self.device.screenshot()
while self.device.click_record and self.device.click_record[-1] == 'WAR_ARCHIVES_SCROLL':
self.device.click_record.pop()
# Drag may result in accidental exit, recover
# before starting next search attempt
while not self.appear(WAR_ARCHIVES_CHECK):
@ -80,7 +83,7 @@ class CampaignBase(CampaignBase_):
if WAR_ARCHIVES_SCROLL.at_bottom(main=self):
WAR_ARCHIVES_SCROLL.set_top(main=self)
else:
WAR_ARCHIVES_SCROLL.next_page(main=self)
WAR_ARCHIVES_SCROLL.next_page(main=self, page=0.66)
continue
else:
break

View File

@ -1,3 +1,5 @@
import module.config.server as server
from module.base.base import ModuleBase
from module.base.button import *
from module.base.decorator import Config
@ -41,7 +43,7 @@ class Level(ModuleBase):
@Config.when(SERVER='jp')
def _lv_grid(self):
return ButtonGrid(origin=(58, 128), delta=(0, 100), button_shape=(46, 19), grid_shape=(1, 6))
return ButtonGrid(origin=(34, 128), delta=(0, 100), button_shape=(68, 19), grid_shape=(1, 6))
@Config.when(SERVER=None)
def _lv_grid(self):
@ -125,11 +127,20 @@ class LevelOcr(Digit):
image = cv2.subtract(255, cv2.multiply(image, 255 / (255 - luma_bg)))
# Find 'L' to strip 'LV.'.
# Return an empty image if 'L' is not found.
letter_l = np.nonzero(image[9:15, :].max(axis=0) < 127)[0]
if len(letter_l):
first_digit = letter_l[0] + 17
if first_digit + 3 < 46: # LV_GRID_MAIN.button_shape[0] = 46
return image[:, first_digit:]
if server.server != 'jp':
letter_l = np.nonzero(image[9:15, :].max(axis=0) < 127)[0]
if len(letter_l):
first_digit = letter_l[0] + 17
if first_digit + 3 < 46: # LV_GRID_MAIN.button_shape[0] = 46
return image[:, first_digit:]
else:
letter_l = np.nonzero(image[5:11, :].max(axis=0) < 63)[0]
if len(letter_l):
first_digit = letter_l[0] + 23 # maximal size in dock and minimal size in sea grid
if first_digit + 3 < 70: # LV_GRID_MAIN.button_shape[0] = 46
image = image[:, first_digit:]
image = cv2.copyMakeBorder(image, 2, 2, 2, 2, cv2.BORDER_CONSTANT, value=(255, 255, 255))
return image
return np.array([[255]], dtype=np.uint8)
def after_process(self, result):

View File

@ -6,12 +6,12 @@ from module.base.template import Template
DORM_FEED_CHECK = Button(area={'cn': (162, 342, 274, 370), 'en': (162, 342, 274, 370), 'jp': (162, 342, 274, 370), 'tw': (162, 342, 274, 370)}, color={'cn': (182, 179, 171), 'en': (182, 179, 171), 'jp': (182, 179, 171), 'tw': (182, 179, 171)}, button={'cn': (162, 342, 274, 370), 'en': (162, 342, 274, 370), 'jp': (162, 342, 274, 370), 'tw': (162, 342, 274, 370)}, file={'cn': './assets/cn/dorm/DORM_FEED_CHECK.png', 'en': './assets/en/dorm/DORM_FEED_CHECK.png', 'jp': './assets/jp/dorm/DORM_FEED_CHECK.png', 'tw': './assets/tw/dorm/DORM_FEED_CHECK.png'})
DORM_FEED_ENTER = Button(area={'cn': (254, 581, 300, 605), 'en': (298, 581, 344, 605), 'jp': (254, 581, 300, 605), 'tw': (254, 581, 300, 605)}, color={'cn': (204, 192, 177), 'en': (204, 192, 176), 'jp': (204, 192, 177), 'tw': (204, 192, 177)}, button={'cn': (254, 581, 300, 605), 'en': (298, 581, 344, 605), 'jp': (254, 581, 300, 605), 'tw': (254, 581, 300, 605)}, file={'cn': './assets/cn/dorm/DORM_FEED_ENTER.png', 'en': './assets/en/dorm/DORM_FEED_ENTER.png', 'jp': './assets/jp/dorm/DORM_FEED_ENTER.png', 'tw': './assets/tw/dorm/DORM_FEED_ENTER.png'})
DORM_FURNITURE_BUY_ALL = Button(area={'cn': (818, 621, 1072, 677), 'en': (819, 621, 1072, 677), 'jp': (820, 621, 1072, 677), 'tw': (818, 621, 1072, 677)}, color={'cn': (249, 202, 66), 'en': (248, 201, 66), 'jp': (247, 201, 66), 'tw': (248, 201, 66)}, button={'cn': (818, 621, 1072, 677), 'en': (819, 621, 1072, 677), 'jp': (820, 621, 1072, 677), 'tw': (818, 621, 1072, 677)}, file={'cn': './assets/cn/dorm/DORM_FURNITURE_BUY_ALL.png', 'en': './assets/en/dorm/DORM_FURNITURE_BUY_ALL.png', 'jp': './assets/jp/dorm/DORM_FURNITURE_BUY_ALL.png', 'tw': './assets/tw/dorm/DORM_FURNITURE_BUY_ALL.png'})
DORM_FURNITURE_BUY_CONFIRM = Button(area={'cn': (644, 464, 972, 517), 'en': (645, 464, 971, 518), 'jp': (645, 465, 973, 517), 'tw': (644, 464, 972, 518)}, color={'cn': (251, 204, 66), 'en': (250, 203, 66), 'jp': (250, 203, 66), 'tw': (250, 203, 66)}, button={'cn': (644, 464, 972, 517), 'en': (645, 464, 971, 518), 'jp': (645, 465, 973, 517), 'tw': (644, 464, 972, 518)}, file={'cn': './assets/cn/dorm/DORM_FURNITURE_BUY_CONFIRM.png', 'en': './assets/en/dorm/DORM_FURNITURE_BUY_CONFIRM.png', 'jp': './assets/jp/dorm/DORM_FURNITURE_BUY_CONFIRM.png', 'tw': './assets/tw/dorm/DORM_FURNITURE_BUY_CONFIRM.png'})
DORM_FURNITURE_BUY_SET = Button(area={'cn': (505, 621, 759, 677), 'en': (505, 621, 759, 677), 'jp': (505, 621, 760, 677), 'tw': (505, 621, 759, 677)}, color={'cn': (248, 202, 66), 'en': (247, 201, 66), 'jp': (245, 199, 65), 'tw': (247, 201, 66)}, button={'cn': (505, 621, 759, 677), 'en': (505, 621, 759, 677), 'jp': (505, 621, 760, 677), 'tw': (505, 621, 759, 677)}, file={'cn': './assets/cn/dorm/DORM_FURNITURE_BUY_SET.png', 'en': './assets/en/dorm/DORM_FURNITURE_BUY_SET.png', 'jp': './assets/jp/dorm/DORM_FURNITURE_BUY_SET.png', 'tw': './assets/tw/dorm/DORM_FURNITURE_BUY_SET.png'})
DORM_FURNITURE_BUY_ALL = Button(area={'cn': (818, 621, 1072, 677), 'en': (819, 621, 1072, 677), 'jp': (899, 636, 991, 661), 'tw': (818, 621, 1072, 677)}, color={'cn': (249, 202, 66), 'en': (248, 201, 66), 'jp': (215, 171, 65), 'tw': (248, 201, 66)}, button={'cn': (818, 621, 1072, 677), 'en': (819, 621, 1072, 677), 'jp': (899, 636, 991, 661), 'tw': (818, 621, 1072, 677)}, file={'cn': './assets/cn/dorm/DORM_FURNITURE_BUY_ALL.png', 'en': './assets/en/dorm/DORM_FURNITURE_BUY_ALL.png', 'jp': './assets/jp/dorm/DORM_FURNITURE_BUY_ALL.png', 'tw': './assets/tw/dorm/DORM_FURNITURE_BUY_ALL.png'})
DORM_FURNITURE_BUY_CONFIRM = Button(area={'cn': (644, 464, 972, 517), 'en': (645, 464, 971, 518), 'jp': (763, 473, 854, 509), 'tw': (644, 464, 972, 518)}, color={'cn': (251, 204, 66), 'en': (250, 203, 66), 'jp': (232, 185, 68), 'tw': (250, 203, 66)}, button={'cn': (644, 464, 972, 517), 'en': (645, 464, 971, 518), 'jp': (763, 473, 854, 509), 'tw': (644, 464, 972, 518)}, file={'cn': './assets/cn/dorm/DORM_FURNITURE_BUY_CONFIRM.png', 'en': './assets/en/dorm/DORM_FURNITURE_BUY_CONFIRM.png', 'jp': './assets/jp/dorm/DORM_FURNITURE_BUY_CONFIRM.png', 'tw': './assets/tw/dorm/DORM_FURNITURE_BUY_CONFIRM.png'})
DORM_FURNITURE_BUY_SET = Button(area={'cn': (505, 621, 759, 677), 'en': (505, 621, 759, 677), 'jp': (570, 636, 696, 661), 'tw': (505, 621, 759, 677)}, color={'cn': (248, 202, 66), 'en': (247, 201, 66), 'jp': (219, 175, 65), 'tw': (247, 201, 66)}, button={'cn': (505, 621, 759, 677), 'en': (505, 621, 759, 677), 'jp': (570, 636, 696, 661), 'tw': (505, 621, 759, 677)}, file={'cn': './assets/cn/dorm/DORM_FURNITURE_BUY_SET.png', 'en': './assets/en/dorm/DORM_FURNITURE_BUY_SET.png', 'jp': './assets/jp/dorm/DORM_FURNITURE_BUY_SET.png', 'tw': './assets/tw/dorm/DORM_FURNITURE_BUY_SET.png'})
DORM_FURNITURE_CONFIRM = Button(area={'cn': (614, 476, 667, 503), 'en': (593, 470, 688, 505), 'jp': (614, 476, 667, 503), 'tw': (614, 476, 667, 503)}, color={'cn': (226, 155, 84), 'en': (228, 159, 89), 'jp': (226, 155, 84), 'tw': (226, 155, 84)}, button={'cn': (614, 476, 667, 503), 'en': (593, 470, 688, 505), 'jp': (614, 476, 667, 503), 'tw': (614, 476, 667, 503)}, file={'cn': './assets/cn/dorm/DORM_FURNITURE_CONFIRM.png', 'en': './assets/en/dorm/DORM_FURNITURE_CONFIRM.png', 'jp': './assets/cn/dorm/DORM_FURNITURE_CONFIRM.png', 'tw': './assets/cn/dorm/DORM_FURNITURE_CONFIRM.png'})
DORM_FURNITURE_COUNTDOWN = Button(area={'cn': (422, 244, 437, 259), 'en': (422, 244, 437, 259), 'jp': (422, 244, 437, 259), 'tw': (422, 244, 437, 259)}, color={'cn': (222, 222, 224), 'en': (222, 222, 224), 'jp': (222, 222, 224), 'tw': (222, 222, 224)}, button={'cn': (422, 244, 437, 259), 'en': (422, 244, 437, 259), 'jp': (422, 244, 437, 259), 'tw': (422, 244, 437, 259)}, file={'cn': './assets/cn/dorm/DORM_FURNITURE_COUNTDOWN.png', 'en': './assets/en/dorm/DORM_FURNITURE_COUNTDOWN.png', 'jp': './assets/jp/dorm/DORM_FURNITURE_COUNTDOWN.png', 'tw': './assets/tw/dorm/DORM_FURNITURE_COUNTDOWN.png'})
DORM_FURNITURE_DETAILS_ENTER = Button(area={'cn': (1003, 444, 1259, 496), 'en': (1003, 444, 1259, 496), 'jp': (1003, 444, 1259, 496), 'tw': (1003, 444, 1258, 496)}, color={'cn': (252, 204, 66), 'en': (251, 204, 66), 'jp': (251, 204, 66), 'tw': (251, 204, 66)}, button={'cn': (1003, 444, 1259, 496), 'en': (1003, 444, 1259, 496), 'jp': (1003, 444, 1259, 496), 'tw': (1003, 444, 1258, 496)}, file={'cn': './assets/cn/dorm/DORM_FURNITURE_DETAILS_ENTER.png', 'en': './assets/en/dorm/DORM_FURNITURE_DETAILS_ENTER.png', 'jp': './assets/jp/dorm/DORM_FURNITURE_DETAILS_ENTER.png', 'tw': './assets/tw/dorm/DORM_FURNITURE_DETAILS_ENTER.png'})
DORM_FURNITURE_DETAILS_ENTER = Button(area={'cn': (1003, 444, 1259, 496), 'en': (1003, 444, 1259, 496), 'jp': (1107, 457, 1155, 482), 'tw': (1003, 444, 1258, 496)}, color={'cn': (252, 204, 66), 'en': (251, 204, 66), 'jp': (216, 172, 65), 'tw': (251, 204, 66)}, button={'cn': (1003, 444, 1259, 496), 'en': (1003, 444, 1259, 496), 'jp': (1107, 457, 1155, 482), 'tw': (1003, 444, 1258, 496)}, file={'cn': './assets/cn/dorm/DORM_FURNITURE_DETAILS_ENTER.png', 'en': './assets/en/dorm/DORM_FURNITURE_DETAILS_ENTER.png', 'jp': './assets/jp/dorm/DORM_FURNITURE_DETAILS_ENTER.png', 'tw': './assets/tw/dorm/DORM_FURNITURE_DETAILS_ENTER.png'})
DORM_FURNITURE_DETAILS_QUIT = Button(area={'cn': (100, 121, 114, 141), 'en': (100, 121, 114, 141), 'jp': (100, 121, 114, 141), 'tw': (100, 121, 114, 141)}, color={'cn': (255, 224, 131), 'en': (255, 224, 131), 'jp': (255, 224, 131), 'tw': (255, 224, 131)}, button={'cn': (100, 121, 114, 141), 'en': (100, 121, 114, 141), 'jp': (100, 121, 114, 141), 'tw': (100, 121, 114, 141)}, file={'cn': './assets/cn/dorm/DORM_FURNITURE_DETAILS_QUIT.png', 'en': './assets/en/dorm/DORM_FURNITURE_DETAILS_QUIT.png', 'jp': './assets/jp/dorm/DORM_FURNITURE_DETAILS_QUIT.png', 'tw': './assets/tw/dorm/DORM_FURNITURE_DETAILS_QUIT.png'})
DORM_FURNITURE_SHOP_ENTER = Button(area={'cn': (1067, 604, 1120, 650), 'en': (1085, 604, 1139, 650), 'jp': (1067, 604, 1120, 650), 'tw': (1067, 604, 1120, 650)}, color={'cn': (255, 226, 130), 'en': (255, 227, 132), 'jp': (255, 226, 130), 'tw': (255, 226, 130)}, button={'cn': (1067, 604, 1120, 650), 'en': (1085, 604, 1139, 650), 'jp': (1067, 604, 1120, 650), 'tw': (1067, 604, 1120, 650)}, file={'cn': './assets/cn/dorm/DORM_FURNITURE_SHOP_ENTER.png', 'en': './assets/en/dorm/DORM_FURNITURE_SHOP_ENTER.png', 'jp': './assets/jp/dorm/DORM_FURNITURE_SHOP_ENTER.png', 'tw': './assets/tw/dorm/DORM_FURNITURE_SHOP_ENTER.png'})
DORM_FURNITURE_SHOP_FIRST = Button(area={'cn': (241, 565, 271, 572), 'en': (241, 565, 271, 572), 'jp': (241, 565, 271, 572), 'tw': (241, 565, 271, 572)}, color={'cn': (247, 213, 129), 'en': (247, 213, 129), 'jp': (247, 213, 129), 'tw': (247, 213, 129)}, button={'cn': (241, 565, 271, 572), 'en': (241, 565, 271, 572), 'jp': (241, 565, 271, 572), 'tw': (241, 565, 271, 572)}, file={'cn': './assets/cn/dorm/DORM_FURNITURE_SHOP_FIRST.png', 'en': './assets/en/dorm/DORM_FURNITURE_SHOP_FIRST.png', 'jp': './assets/jp/dorm/DORM_FURNITURE_SHOP_FIRST.png', 'tw': './assets/tw/dorm/DORM_FURNITURE_SHOP_FIRST.png'})

View File

@ -27,11 +27,11 @@ META_AUTO_ATTACKING = Button(area={'cn': (746, 649, 778, 680), 'en': (746, 649,
META_AUTO_ATTACK_CONFIRM = Button(area={'cn': (717, 493, 884, 547), 'en': (736, 494, 861, 544), 'jp': (717, 493, 884, 547), 'tw': (717, 493, 884, 547)}, color={'cn': (185, 98, 88), 'en': (190, 109, 99), 'jp': (185, 98, 88), 'tw': (185, 98, 88)}, button={'cn': (717, 493, 884, 547), 'en': (736, 494, 861, 544), 'jp': (717, 493, 884, 547), 'tw': (717, 493, 884, 547)}, file={'cn': './assets/cn/os_ash/META_AUTO_ATTACK_CONFIRM.png', 'en': './assets/en/os_ash/META_AUTO_ATTACK_CONFIRM.png', 'jp': './assets/cn/os_ash/META_AUTO_ATTACK_CONFIRM.png', 'tw': './assets/cn/os_ash/META_AUTO_ATTACK_CONFIRM.png'})
META_AUTO_ATTACK_START = Button(area={'cn': (746, 648, 777, 683), 'en': (718, 653, 742, 677), 'jp': (746, 648, 777, 683), 'tw': (746, 648, 777, 683)}, color={'cn': (77, 63, 61), 'en': (103, 86, 85), 'jp': (77, 63, 61), 'tw': (77, 63, 61)}, button={'cn': (746, 648, 777, 683), 'en': (718, 653, 742, 677), 'jp': (746, 648, 777, 683), 'tw': (746, 648, 777, 683)}, file={'cn': './assets/cn/os_ash/META_AUTO_ATTACK_START.png', 'en': './assets/en/os_ash/META_AUTO_ATTACK_START.png', 'jp': './assets/cn/os_ash/META_AUTO_ATTACK_START.png', 'tw': './assets/cn/os_ash/META_AUTO_ATTACK_START.png'})
META_AUTO_CONFIRM = Button(area={'cn': (608, 506, 674, 535), 'en': (584, 510, 698, 530), 'jp': (563, 498, 717, 540), 'tw': (608, 506, 674, 535)}, color={'cn': (208, 148, 141), 'en': (216, 168, 162), 'jp': (187, 103, 92), 'tw': (208, 148, 141)}, button={'cn': (608, 506, 674, 535), 'en': (584, 510, 698, 530), 'jp': (563, 498, 717, 540), 'tw': (608, 506, 674, 535)}, file={'cn': './assets/cn/os_ash/META_AUTO_CONFIRM.png', 'en': './assets/en/os_ash/META_AUTO_CONFIRM.png', 'jp': './assets/jp/os_ash/META_AUTO_CONFIRM.png', 'tw': './assets/cn/os_ash/META_AUTO_CONFIRM.png'})
META_BEACON_DATA = Button(area={'cn': (840, 22, 951, 45), 'en': (840, 22, 951, 45), 'jp': (840, 22, 951, 45), 'tw': (840, 22, 951, 45)}, color={'cn': (49, 53, 52), 'en': (49, 53, 52), 'jp': (49, 53, 52), 'tw': (49, 53, 52)}, button={'cn': (840, 22, 951, 45), 'en': (840, 22, 951, 45), 'jp': (840, 22, 951, 45), 'tw': (840, 22, 951, 45)}, file={'cn': './assets/cn/os_ash/META_BEACON_DATA.png', 'en': './assets/en/os_ash/META_BEACON_DATA.png', 'jp': './assets/jp/os_ash/META_BEACON_DATA.png', 'tw': './assets/tw/os_ash/META_BEACON_DATA.png'})
META_BEACON_DATA = Button(area={'cn': (840, 22, 951, 45), 'en': (840, 22, 951, 45), 'jp': (865, 21, 923, 44), 'tw': (840, 22, 951, 45)}, color={'cn': (49, 53, 52), 'en': (49, 53, 52), 'jp': (63, 61, 62), 'tw': (49, 53, 52)}, button={'cn': (840, 22, 951, 45), 'en': (840, 22, 951, 45), 'jp': (865, 21, 923, 44), 'tw': (840, 22, 951, 45)}, file={'cn': './assets/cn/os_ash/META_BEACON_DATA.png', 'en': './assets/en/os_ash/META_BEACON_DATA.png', 'jp': './assets/jp/os_ash/META_BEACON_DATA.png', 'tw': './assets/tw/os_ash/META_BEACON_DATA.png'})
META_BEACON_FLAG = Button(area={'cn': (788, 22, 811, 45), 'en': (788, 22, 811, 45), 'jp': (788, 22, 811, 45), 'tw': (788, 22, 811, 45)}, color={'cn': (48, 111, 134), 'en': (48, 111, 134), 'jp': (48, 111, 134), 'tw': (48, 111, 134)}, button={'cn': (788, 22, 811, 45), 'en': (788, 22, 811, 45), 'jp': (788, 22, 811, 45), 'tw': (788, 22, 811, 45)}, file={'cn': './assets/cn/os_ash/META_BEACON_FLAG.png', 'en': './assets/en/os_ash/META_BEACON_FLAG.png', 'jp': './assets/jp/os_ash/META_BEACON_FLAG.png', 'tw': './assets/tw/os_ash/META_BEACON_FLAG.png'})
META_BEGIN_ENTRANCE = Button(area={'cn': (651, 348, 706, 372), 'en': (646, 359, 706, 370), 'jp': (652, 348, 706, 371), 'tw': (650, 348, 706, 372)}, color={'cn': (99, 99, 98), 'en': (100, 104, 103), 'jp': (101, 102, 101), 'tw': (95, 97, 99)}, button={'cn': (546, 115, 748, 503), 'en': (546, 115, 748, 503), 'jp': (546, 115, 748, 503), 'tw': (546, 115, 748, 503)}, file={'cn': './assets/cn/os_ash/META_BEGIN_ENTRANCE.png', 'en': './assets/en/os_ash/META_BEGIN_ENTRANCE.png', 'jp': './assets/jp/os_ash/META_BEGIN_ENTRANCE.gif', 'tw': './assets/tw/os_ash/META_BEGIN_ENTRANCE.png'})
META_DAMAGE = Button(area={'cn': (1196, 380, 1276, 416), 'en': (1196, 380, 1276, 416), 'jp': (1196, 380, 1276, 416), 'tw': (1196, 380, 1276, 416)}, color={'cn': (58, 59, 58), 'en': (58, 59, 58), 'jp': (58, 59, 58), 'tw': (58, 59, 58)}, button={'cn': (1196, 380, 1276, 416), 'en': (1196, 380, 1276, 416), 'jp': (1196, 380, 1276, 416), 'tw': (1196, 380, 1276, 416)}, file={'cn': './assets/cn/os_ash/META_DAMAGE.png', 'en': './assets/en/os_ash/META_DAMAGE.png', 'jp': './assets/jp/os_ash/META_DAMAGE.png', 'tw': './assets/tw/os_ash/META_DAMAGE.png'})
META_DOSSIER_DATA = Button(area={'cn': (1050, 22, 1161, 46), 'en': (1050, 22, 1161, 46), 'jp': (1050, 22, 1161, 46), 'tw': (1050, 22, 1161, 46)}, color={'cn': (53, 56, 56), 'en': (53, 56, 56), 'jp': (53, 56, 56), 'tw': (53, 56, 56)}, button={'cn': (1050, 22, 1161, 46), 'en': (1050, 22, 1161, 46), 'jp': (1050, 22, 1161, 46), 'tw': (1050, 22, 1161, 46)}, file={'cn': './assets/cn/os_ash/META_DOSSIER_DATA.png', 'en': './assets/en/os_ash/META_DOSSIER_DATA.png', 'jp': './assets/jp/os_ash/META_DOSSIER_DATA.png', 'tw': './assets/tw/os_ash/META_DOSSIER_DATA.png'})
META_DAMAGE = Button(area={'cn': (1196, 380, 1276, 416), 'en': (1196, 380, 1276, 416), 'jp': (1217, 378, 1276, 407), 'tw': (1196, 380, 1276, 416)}, color={'cn': (58, 59, 58), 'en': (58, 59, 58), 'jp': (59, 60, 59), 'tw': (58, 59, 58)}, button={'cn': (1196, 380, 1276, 416), 'en': (1196, 380, 1276, 416), 'jp': (1217, 378, 1276, 407), 'tw': (1196, 380, 1276, 416)}, file={'cn': './assets/cn/os_ash/META_DAMAGE.png', 'en': './assets/en/os_ash/META_DAMAGE.png', 'jp': './assets/jp/os_ash/META_DAMAGE.png', 'tw': './assets/tw/os_ash/META_DAMAGE.png'})
META_DOSSIER_DATA = Button(area={'cn': (1050, 22, 1161, 46), 'en': (1050, 22, 1161, 46), 'jp': (1070, 21, 1141, 44), 'tw': (1050, 22, 1161, 46)}, color={'cn': (53, 56, 56), 'en': (53, 56, 56), 'jp': (66, 65, 65), 'tw': (53, 56, 56)}, button={'cn': (1050, 22, 1161, 46), 'en': (1050, 22, 1161, 46), 'jp': (1070, 21, 1141, 44), 'tw': (1050, 22, 1161, 46)}, file={'cn': './assets/cn/os_ash/META_DOSSIER_DATA.png', 'en': './assets/en/os_ash/META_DOSSIER_DATA.png', 'jp': './assets/jp/os_ash/META_DOSSIER_DATA.png', 'tw': './assets/tw/os_ash/META_DOSSIER_DATA.png'})
META_DOSSIER_FLAG = Button(area={'cn': (999, 22, 1022, 45), 'en': (999, 22, 1022, 45), 'jp': (999, 22, 1022, 45), 'tw': (999, 22, 1022, 45)}, color={'cn': (123, 70, 44), 'en': (123, 70, 44), 'jp': (123, 70, 44), 'tw': (123, 70, 44)}, button={'cn': (999, 22, 1022, 45), 'en': (999, 22, 1022, 45), 'jp': (999, 22, 1022, 45), 'tw': (999, 22, 1022, 45)}, file={'cn': './assets/cn/os_ash/META_DOSSIER_FLAG.png', 'en': './assets/en/os_ash/META_DOSSIER_FLAG.png', 'jp': './assets/jp/os_ash/META_DOSSIER_FLAG.png', 'tw': './assets/tw/os_ash/META_DOSSIER_FLAG.png'})
META_ENTRANCE = Button(area={'cn': (578, 463, 623, 493), 'en': (578, 463, 623, 493), 'jp': (578, 463, 623, 493), 'tw': (578, 463, 623, 493)}, color={'cn': (106, 134, 169), 'en': (106, 134, 169), 'jp': (106, 134, 169), 'tw': (106, 134, 169)}, button={'cn': (578, 463, 623, 493), 'en': (578, 463, 623, 493), 'jp': (578, 463, 623, 493), 'tw': (578, 463, 623, 493)}, file={'cn': './assets/cn/os_ash/META_ENTRANCE.png', 'en': './assets/en/os_ash/META_ENTRANCE.png', 'jp': './assets/jp/os_ash/META_ENTRANCE.png', 'tw': './assets/tw/os_ash/META_ENTRANCE.png'})
META_INNER_PAGE_DAMAGE = Button(area={'cn': (936, 105, 1029, 128), 'en': (938, 108, 1073, 125), 'jp': (937, 109, 1088, 128), 'tw': (936, 105, 1029, 128)}, color={'cn': (148, 105, 105), 'en': (144, 103, 103), 'jp': (115, 78, 77), 'tw': (148, 105, 105)}, button={'cn': (936, 105, 1029, 128), 'en': (938, 108, 1073, 125), 'jp': (937, 109, 1088, 128), 'tw': (936, 105, 1029, 128)}, file={'cn': './assets/cn/os_ash/META_INNER_PAGE_DAMAGE.png', 'en': './assets/en/os_ash/META_INNER_PAGE_DAMAGE.png', 'jp': './assets/jp/os_ash/META_INNER_PAGE_DAMAGE.png', 'tw': './assets/cn/os_ash/META_INNER_PAGE_DAMAGE.png'})

View File

@ -23,7 +23,10 @@ class MetaState(Enum):
OCR_BEACON_TIER = Digit(BEACON_TIER, name='OCR_ASH_TIER')
OCR_META_DAMAGE = Digit(META_DAMAGE, name='OCR_META_DAMAGE')
if server.server != 'jp':
OCR_META_DAMAGE = Digit(META_DAMAGE, name='OCR_META_DAMAGE')
else:
OCR_META_DAMAGE = Digit(META_DAMAGE, letter=(201, 201, 201), name='OCR_META_DAMAGE')
class MetaDigitCounter(DigitCounter):
@ -44,7 +47,10 @@ class MetaDigitCounter(DigitCounter):
class Meta(UI, MapEventHandler):
def digit_ocr_point_and_check(self, button: Button, check_number: int):
point_ocr = MetaDigitCounter(button, letter=(235, 235, 235), threshold=160, name='POINT_OCR')
if server.server != 'jp':
point_ocr = MetaDigitCounter(button, letter=(235, 235, 235), threshold=160, name='POINT_OCR')
else:
point_ocr = MetaDigitCounter(button, letter=(192, 192, 192), threshold=160, name='POINT_OCR')
point, _, _ = point_ocr.ocr(self.device.image)
if point >= check_number:
return True

View File

@ -1,3 +1,5 @@
import module.config.server as server
from module.base.button import ButtonGrid
from module.base.decorator import cached_property
from module.base.timer import Timer
@ -20,8 +22,12 @@ DOCK_FAVOURITE.add_status('off', check_button=COMMON_SHIP_FILTER_DISABLE)
CARD_GRIDS = ButtonGrid(
origin=(93, 76), delta=(164 + 2 / 3, 227), button_shape=(138, 204), grid_shape=(7, 2), name='CARD')
CARD_RARITY_GRIDS = CARD_GRIDS.crop(area=(0, 0, 138, 5), name='RARITY')
CARD_LEVEL_GRIDS = CARD_GRIDS.crop(area=(77, 5, 138, 27), name='LEVEL')
CARD_EMOTION_GRIDS = CARD_GRIDS.crop(area=(23, 29, 48, 52), name='EMOTION')
if server.server != 'jp':
CARD_LEVEL_GRIDS = CARD_GRIDS.crop(area=(77, 5, 138, 27), name='LEVEL')
CARD_EMOTION_GRIDS = CARD_GRIDS.crop(area=(23, 29, 48, 52), name='EMOTION')
else:
CARD_LEVEL_GRIDS = CARD_GRIDS.crop(area=(74, 5, 136, 27), name='LEVEL')
CARD_EMOTION_GRIDS = CARD_GRIDS.crop(area=(31, 29, 61, 52), name='EMOTION')
DOCK_SCROLL = Scroll(DOCK_SCROLL, color=(247, 211, 66), name='DOCK_SCROLL')

View File

@ -318,7 +318,7 @@ class Retirement(Enhancement, QuickRetireSettingHandler):
break
else:
# Try to keep the one with the lowest level
ships.sort(key=lambda ship: -ship.level)
ships.sort(key=lambda s: -s.level)
ships = ships[:-1]
for ship in ships[:10]:
@ -452,8 +452,7 @@ class Retirement(Enhancement, QuickRetireSettingHandler):
button (Button): Ship button to select
skip_first_screenshot:
"""
retire_coin_timer = Timer(2)
count = 0
RETIRE_COIN.load_color(self.device.image)
while 1:
@ -461,14 +460,19 @@ class Retirement(Enhancement, QuickRetireSettingHandler):
skip_first_screenshot = False
else:
self.device.screenshot()
# End
if not self.appear(RETIRE_COIN, threshold=0.97):
return True
if count > 3:
logger.warning('_retire_select_one failed after 3 trial')
return False
if self.appear(SHIP_CONFIRM_2, offset=(30, 30), interval=3):
self.device.click(button)
count += 1
continue
if retire_coin_timer.reached() and not self.appear(RETIRE_COIN, threshold=0.97):
return True
return False
def retirement_get_common_rarity_cv_in_page(self):
"""
Returns:
@ -515,11 +519,11 @@ class Retirement(Enhancement, QuickRetireSettingHandler):
if RETIRE_CONFIRM_SCROLL.at_bottom(main=self):
logger.info('Scroll bar reached end, stop')
break
return button
def keep_one_common_cv(self):
button = self.retirement_get_common_rarity_cv()
if button is not None:
self._retire_select_one(button, skip_first_screenshot=False)
self._retire_select_one(button)
self._have_kept_cv = True

View File

@ -5,6 +5,8 @@ from typing import Any, Dict, List, Tuple, Union
import cv2
import numpy as np
import module.config.server as server
from module.base.button import ButtonGrid
from module.base.utils import color_similar, crop, get_color, limit_in
from module.combat.level import LevelOcr
@ -132,8 +134,12 @@ class EmotionScanner(Scanner):
super().__init__()
self._results = []
self.grids = CARD_EMOTION_GRIDS
self.ocr_model = EmotionDigit(self.grids.buttons,
if server.server != 'jp':
self.ocr_model = EmotionDigit(self.grids.buttons,
name='DOCK_EMOTION_OCR', threshold=176)
else:
self.ocr_model = EmotionDigit(self.grids.buttons,
name='DOCK_EMOTION_OCR', threshold=221)
def _scan(self, image) -> List:
return self.ocr_model.ocr(image)

View File

@ -568,6 +568,8 @@ class UI(InfoHandler):
for switch_button in page_main.links.values():
if button == switch_button:
self.interval_reset(GET_SHIP)
if button in [MAIN_GOTO_REWARD, MAIN_GOTO_REWARD_WHITE]:
self.interval_reset(GET_SHIP)
if button in [MAIN_GOTO_CAMPAIGN, MAIN_GOTO_CAMPAIGN_WHITE]:
self.interval_reset(GET_SHIP)
# Shinano event has the same title as raid