Merge branch 'master' into app

# Conflicts:
#	module/campaign/gems_farming.py
#	module/config/config.py
This commit is contained in:
LmeSzinc 2021-09-19 23:34:30 +08:00
commit f71a151678
19 changed files with 69 additions and 23 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

After

Width:  |  Height:  |  Size: 22 KiB

View File

@ -212,6 +212,7 @@ sos_submarine = 0
[War_archives]
war_archives_stage = a1
war_archives_name = war_archives_20190321_en
do_war_archives_in_daily = no
[Raid]
raid_name = raid_20200624
@ -296,6 +297,7 @@ os_mission_finish = 2020-01-01_00:00:00
os_supply_buy = 2020-01-01_00:00:00
os_obscure_finish = 2020-01-01_00:00:00
sos = 2020-01-01_00:00:00
war_archives = 2020-01-01_00:00:00
[RewardRecord]
meowfficer = 2020-01-01_00:00:00

View File

@ -7,8 +7,8 @@ from module.equipment.fleet_equipment import OCR_FLEET_INDEX
from module.map.assets import FLEET_PREPARATION, MAP_PREPARATION
from module.ocr.ocr import Digit
from module.retire.dock import *
from module.retire.dock import Dock
from module.ui.page import page_fleet
from module.ui.page import page_fleet, page_main
from module.exception import CampaignEnd
SIM_VALUE = 0.95
@ -41,7 +41,7 @@ class GemsCampaignOverride(CampaignBase):
or self.appear(MAP_PREPARATION, offset=(20, 20), interval=2):
self.enter_map_cancel()
break
return False
raise CampaignEnd('Emotion withdraw')
else:
return super().handle_combat_low_emotion()
@ -96,6 +96,8 @@ class GemsFarming(CampaignRun, Dock, EquipmentChange):
self.equipment_take_on(index_list=index_list)
self.ui_ensure(page_main)
def vanguard_change(self):
"""
Change vanguard and vanguard's equipment
@ -117,6 +119,7 @@ class GemsFarming(CampaignRun, Dock, EquipmentChange):
self._equip_take_off_one()
self.equipment_take_on()
self.ui_ensure(page_main)
def _ship_change_confirm(self, button):

View File

@ -488,6 +488,7 @@ def main(ini_name=''):
'作战档案设置', '输入地图名称, 然后选择对应的活动', gooey_options={'label_color': '#931D03'})
war_archives.add_argument('--作战档案地图', default=default('--作战档案地图'), help='输入地图名称, 不分大小写, 例如 D3, SP3, HT6', gooey_options={'label_color': '#4B5F83'})
war_archives.add_argument('--作战档案活动', default=default('--作战档案活动'), choices=archives_folder, help='在下拉菜单中选择活动', gooey_options={'label_color': '#4B5F83'})
war_archives.add_argument('--在每日中加入作战档案', default=default('--在每日中加入作战档案'), choices=['', ''], help='添加至每日任务,每天会打四次选定的地图', gooey_options={'label_color': '#4B5F83'})
# ==========共斗活动==========
raid_parser = subs.add_parser('共斗活动')
@ -541,7 +542,7 @@ def main(ini_name=''):
gems.add_argument('--启用红脸撤退', default=default('--启用红脸撤退'), help='红脸时撤退,同时更换前排和后排。\n换前排通过找一艘150心情等级100的白鹰白皮驱逐完成所以尽量保证有足够多的驱逐在后排休息。\n不启用将不更换前排', choices=['', ''], gooey_options={'label_color': '#4B5F83'})
gems.add_argument('--更换旗舰装备', default=default('--更换旗舰装备'), help='换船时更换旗舰装备,这通过记录之前的装备完成。\n只会更换正在装备中的栏位,即使是白装也会更换。\n如果指定了旗舰则会更换全部5个装备未指定旗舰只会更换设备。', choices=['', ''], gooey_options={'label_color': '#4B5F83'})
gems.add_argument('--更换前排装备', default=default('--更换前排装备'), help='换船时更换前排装备,这通过记录之前的装备完成。\n只会更换正在装备中的栏位,即使是白装也会更换。', choices=['', ''], gooey_options={'label_color': '#4B5F83'})
gems.add_argument('--指定旗舰航母', default=default('--指定旗舰航母'), help='指定旗舰用某搜特定的航母,\n这在刷a3等有难度的图会很有用。', choices=['兰利', '博格', '突击者', '竞技神', '任意航母'], gooey_options={'label_color': '#4B5F83'})
gems.add_argument('--指定旗舰航母', default=default('--指定旗舰航母'), help='指定旗舰用某搜特定的航母,\n这在刷a3等有难度的图会很有用。', choices=['兰利', '博格', '突击者', '竞技神', '任意航母'], gooey_options={'label_color': '#4B5F83'})
gems.add_argument('--刷钻石关卡', default=default('--刷钻石关卡'), help='例如 2-4, A3, SP2\n委托油耗比: A3 > A1 > 2-4 > 2-1, 有活动图时建议选活动图, 2-1会拣问号有更多物资', gooey_options={'label_color': '#4B5F83'})
# ==========OS semi auto==========

View File

@ -573,6 +573,7 @@ def main(ini_name=''):
'war archives settings', 'Type a stage and select a corresponding event for that stage', gooey_options={'label_color': '#931D03'})
war_archives.add_argument('--war_archives_stage', default=default('--war_archives_stage'), help='Type stage name, not case sensitive, E.g D3, SP3, HT6', gooey_options={'label_color': '#4B5F83'})
war_archives.add_argument('--war_archives_name', default=default('--war_archives_name'), choices=archives_folder, help='There a dropdown menu with many options', gooey_options={'label_color': '#4B5F83'})
war_archives.add_argument('--do_war_archives_in_daily', default=default('--do_war_archives_in_daily'), choices=['yes', 'no'], help='Adds to daily, 4 runs for a target campaign to account for acquisition of data keys', gooey_options={'label_color': '#4B5F83'})
# ==========Raid==========
raid_parser = subs.add_parser('raid')
@ -634,7 +635,7 @@ def main(ini_name=''):
gems.add_argument('--gems_low_emotion_withdraw', default=default('--gems_low_emotion_withdraw'), help='Withdraw when low emotion and change flagship and vanguard.\nReplacing vanguard is completed by finding a 150-emo 100-lv Eagle common dd, so try to ensure there are enough dd to rest in the back yard.\nDisable will not change vanguard', choices=['yes', 'no'], gooey_options={'label_color': '#4B5F83'})
gems.add_argument('--gems_flag_ship_equip_change', default=default('--gems_flag_ship_equip_change'), help='Change flagship equipment when changing ships, which is done by recording previous equipment.\nOnly equipped cells will be replaced.\nIf a flagship is specified, all five pieces of equipment will be replaced.\nIf no flagship is specified, only the auxiliary equipment will be replaced.', choices=['yes', 'no'], gooey_options={'label_color': '#4B5F83'})
gems.add_argument('--gems_vanguard_ship_equip_change', default=default('--gems_vanguard_ship_equip_change'), help='Change vanguard equipment when changing ships, which is done by recording previous equipment.\nOnly equipped cells will be replaced.', choices=['yes', 'no'], gooey_options={'label_color': '#4B5F83'})
gems.add_argument('--common_cv_name', default=default('--common_cv_name'), help='Specify a flagship, which is useful when framing difficult map such as A3.', choices=['langley', 'bogue', 'ranger', 'hermes', 'any'], gooey_options={'label_color': '#4B5F83'})
gems.add_argument('--common_cv_name', default=default('--common_cv_name'), help='Specify a flagship, which is useful when framing difficult map such as A3.', choices=['langley', 'bogue', 'ranger', 'hermes', 'any'], gooey_options={'label_color': '#4B5F83'})
gems.add_argument('--gems_stage', default=default('--gems_stage'), help='Such as 2-4, A3, SP2\nUrgent commissions per oil: A3 > A1 > 2-4 > 2-1. Event maps are recommended if available. Will pickup mystery in 2-1 for more coins', gooey_options={'label_color': '#4B5F83'})
# ==========OS semi auto==========

View File

@ -573,6 +573,7 @@ def main(ini_name=''):
'war archives settings', 'Type a stage and select a corresponding event for that stage', gooey_options={'label_color': '#931D03'})
war_archives.add_argument('--war_archives_stage', default=default('--war_archives_stage'), help='Type stage name, not case sensitive, E.g D3, SP3, HT6', gooey_options={'label_color': '#4B5F83'})
war_archives.add_argument('--war_archives_name', default=default('--war_archives_name'), choices=archives_folder, help='There a dropdown menu with many options', gooey_options={'label_color': '#4B5F83'})
war_archives.add_argument('--do_war_archives_in_daily', default=default('--do_war_archives_in_daily'), choices=['yes', 'no'], help='Adds to daily, 4 runs for a target campaign to account for acquisition of data keys', gooey_options={'label_color': '#4B5F83'})
# ==========Raid==========
raid_parser = subs.add_parser('raid')
@ -633,7 +634,7 @@ def main(ini_name=''):
gems.add_argument('--gems_low_emotion_withdraw', default=default('--gems_low_emotion_withdraw'), help='Withdraw when low emotion and change flagship and vanguard.\nReplacing vanguard is completed by finding a 150-emo 100-lv Eagle common dd, so try to ensure there are enough dd to rest in the back yard.\nDisable will not change vanguard', choices=['yes', 'no'], gooey_options={'label_color': '#4B5F83'})
gems.add_argument('--gems_flag_ship_equip_change', default=default('--gems_flag_ship_equip_change'), help='Change flagship equipment when changing ships, which is done by recording previous equipment.\nOnly equipped cells will be replaced.\nIf a flagship is specified, all five pieces of equipment will be replaced.\nIf no flagship is specified, only the auxiliary equipment will be replaced.', choices=['yes', 'no'], gooey_options={'label_color': '#4B5F83'})
gems.add_argument('--gems_vanguard_ship_equip_change', default=default('--gems_vanguard_ship_equip_change'), help='Change vanguard equipment when changing ships, which is done by recording previous equipment.\nOnly equipped cells will be replaced.', choices=['yes', 'no'], gooey_options={'label_color': '#4B5F83'})
gems.add_argument('--common_cv_name', default=default('--common_cv_name'), help='Specify a flagship, which is useful when framing difficult map such as A3.', choices=['langley', 'bogue', 'ranger', 'hermes', 'any'], gooey_options={'label_color': '#4B5F83'})
gems.add_argument('--common_cv_name', default=default('--common_cv_name'), help='Specify a flagship, which is useful when framing difficult map such as A3.', choices=['langley', 'bogue', 'ranger', 'hermes', 'any'], gooey_options={'label_color': '#4B5F83'})
gems.add_argument('--gems_stage', default=default('--gems_stage'), help='Such as 2-4, A3, SP2\nUrgent commissions per oil: A3 > A1 > 2-4 > 2-1. Event maps are recommended if available. Will pickup mystery in 2-1 for more coins', gooey_options={'label_color': '#4B5F83'})
# ==========OS semi auto==========

View File

@ -488,6 +488,7 @@ def main(ini_name=''):
'作戰檔案設置', '輸入地圖名稱, 然後選擇對應的活動', gooey_options={'label_color': '#931D03'})
war_archives.add_argument('--作戰檔案地圖', default=default('--作戰檔案地圖'), help='輸入地圖名稱, 不分大小寫, 例如D3, SP3, HT6', gooey_options={'label_color': '#4B5F83'})
war_archives.add_argument('--作戰檔案活動', default=default('--作戰檔案活動'), choices=archives_folder, help='在下拉菜單中選擇活動', gooey_options={'label_color': '#4B5F83'})
war_archives.add_argument('--在每日中加入作戰檔案', default=default('--在每日中加入作戰檔案'), choices=['', ''], help='添加至每日任務,每天會打四次選定的地圖', gooey_options={'label_color': '#4B5F83'})
# ==========共鬥活動==========
raid_parser = subs.add_parser('共鬥活動')
@ -541,7 +542,7 @@ def main(ini_name=''):
gems.add_argument('--啟用紅臉撤退', default=default('--啟用紅臉撤退'), help='紅臉時撤退,同時更換前排和後排。\n換前排通過找一艘150心情等級100的白鷹白皮驅逐完成所以盡量保證有足夠多的驅逐在後排休息。\n不啟用將不更換前排', choices=['', ''], gooey_options={'label_color': '#4B5F83'})
gems.add_argument('--更換旗艦裝備', default=default('--更換旗艦裝備'), help='換船時更換旗艦裝備,這通過記錄之前的裝備完成。\n只會更換正在裝備中的欄位,即使是白裝也會更換。\n如果指定了旗艦則會更換全部5個裝備未指定旗艦只會更換設備。', choices=['', ''], gooey_options={'label_color': '#4B5F83'})
gems.add_argument('--更換前排裝備', default=default('--更換前排裝備'), help='換船時更換前排裝備,這通過記錄之前的裝備完成。\n只會更換正在裝備中的欄位,即使是白裝也會更換。', choices=['', ''], gooey_options={'label_color': '#4B5F83'})
gems.add_argument('--指定旗艦航母', default=default('--指定旗艦航母'), help='指定旗艦用某搜特定的航母,\n這在刷a3等有難度的圖會很有用。', choices=['蘭利', '博格', '突擊者', '競技神', '任意航母'], gooey_options={'label_color': '#4B5F83'})
gems.add_argument('--指定旗艦航母', default=default('--指定旗艦航母'), help='指定旗艦用某搜特定的航母,\n這在刷a3等有難度的圖會很有用。', choices=['蘭利', '博格', '突擊者', '競技神', '任意航母'], gooey_options={'label_color': '#4B5F83'})
gems.add_argument('--刷鑽石關卡', default=default('--刷鑽石關卡'), help='例如 2-4, A3, SP2\n委託油耗比: A3 > A1 > 2-4 > 2-1, 有活動圖時建議選活動圖, 2-1會揀問號有更多物資', gooey_options={'label_color': '#4B5F83'})
# ==========OS semi auto==========

View File

@ -249,6 +249,7 @@ dic_true_eng_to_eng = {
'sos_submarine': 'sos_submarine',
'war_archives_name': 'war_archives_name',
'war_archives_stage': 'war_archives_stage',
'do_war_archives_in_daily': 'do_war_archives_in_daily',
'raid_name': 'raid_name',
'raid_mode': 'raid_mode',
'raid_use_ticket': 'raid_use_ticket',
@ -627,6 +628,7 @@ dic_chi_to_eng = {
'潜艇图潜艇队': 'sos_submarine',
'作战档案活动': 'war_archives_name',
'作战档案地图': 'war_archives_stage',
'在每日中加入作战档案': 'do_war_archives_in_daily',
'共斗名称': 'raid_name',
'共斗难度': 'raid_mode',
'共斗使用挑战券': 'raid_use_ticket',
@ -1006,6 +1008,7 @@ dic_tchi_to_eng = {
'潛艇圖潛艇隊': 'sos_submarine',
'作戰檔案活動': 'war_archives_name',
'作戰檔案地圖': 'war_archives_stage',
'在每日中加入作戰檔案': 'do_war_archives_in_daily',
'共鬥名稱': 'raid_name',
'共鬥難度': 'raid_mode',
'共鬥使用挑戰券': 'raid_use_ticket',

View File

@ -10,6 +10,10 @@ EQUIP_INFO_BAR = ButtonGrid(
origin=(723, 111), delta=(94, 0), button_shape=(76, 76), grid_shape=(5, 1), name="EQUIP_INFO_BAR"
)
EQUIPMENT_GRID = ButtonGrid(
origin=(725, 155), delta=(95, 0), button_shape=(31, 31), grid_shape=(5, 1),
name='EQUIPMENT_GRID')
EQUIPMENT_SCROLL = Scroll(EQUIP_SCROLL, color=(
247, 211, 66), name='EQUIP_SCROLL')
@ -24,18 +28,20 @@ class EquipmentChange(Equipment):
def get_equiping_list(self, skip_first_screenshot=True):
'''
Pages:
in: ship's equipments details
in: ship's details
'''
logger.info("Get equipping list")
if skip_first_screenshot:
pass
else:
self.device.screenshot()
for index in range(0, 5):
enter_button = globals()[
'EQUIP_TAKE_ON_{index}'.format(index=index)]
if self.appear(enter_button, offset=(5, 5)):
index = 0
for button in EQUIPMENT_GRID.buttons:
crop_image = np.array(self.device.image.crop(button.area))
edge_value = abs(np.mean(cv2.Sobel(crop_image,3, 1, 1)))
if edge_value < 0.1:
self.equipping_list.remove(index)
index += 1
logger.info(f"Equipping list: {self.equipping_list}")
def record_equipment(self, index_list=range(0, 5)):
@ -44,9 +50,8 @@ class EquipmentChange(Equipment):
Notice: The equipment icons in the upgrade page are the same size as the icons in the equipment status
'''
logger.info('RECORD EQUIPMENT')
self.equip_side_navbar_ensure(bottom=2)
self.get_equiping_list()
self.equip_side_navbar_ensure(bottom=1)
self.get_equiping_list()
for index in index_list:
if index in self.equipping_list:

View File

@ -372,6 +372,12 @@ class Reward(RewardCommission, RewardTacticalClass, RewardResearch, RewardDorm,
count += 1
self.device.send_notification('Daily Event AB', 'Daily event AB finished.')
if self.config.DO_WAR_ARCHIVES_IN_DAILY:
from module.war_archives.war_archives import CampaignWarArchives
az = CampaignWarArchives(self.config, device=self.device)
if az.run_war_archives_daily():
self.device.send_notification('Daily War Archives', 'Daily war archives campaigns finished.')
if self.config.ENABLE_RAID_DAILY:
from module.raid.daily import RaidDaily
az = RaidDaily(self.config, device=self.device)

View File

@ -8,6 +8,8 @@ SHIPYARD_CONFIRM_DEV = Button(area={'cn': (1074, 497, 1152, 524), 'en': (1067, 4
SHIPYARD_CONFIRM_FATE = Button(area={'cn': (1145, 523, 1221, 558), 'en': (1145, 522, 1242, 555), 'jp': (1137, 525, 1231, 556), 'tw': (1145, 522, 1242, 555)}, color={'cn': (109, 149, 203), 'en': (145, 173, 214), 'jp': (104, 144, 198), 'tw': (145, 173, 214)}, button={'cn': (1145, 523, 1221, 558), 'en': (1145, 522, 1242, 555), 'jp': (1137, 525, 1231, 556), 'tw': (1145, 522, 1242, 555)}, file={'cn': './assets/cn/shipyard/SHIPYARD_CONFIRM_FATE.png', 'en': './assets/en/shipyard/SHIPYARD_CONFIRM_FATE.png', 'jp': './assets/jp/shipyard/SHIPYARD_CONFIRM_FATE.png', 'tw': './assets/tw/shipyard/SHIPYARD_CONFIRM_FATE.png'})
SHIPYARD_GO_FATE = Button(area={'cn': (943, 508, 1031, 531), 'en': (943, 508, 1018, 531), 'jp': (944, 509, 1029, 530), 'tw': (943, 508, 1018, 531)}, color={'cn': (169, 165, 54), 'en': (181, 177, 58), 'jp': (146, 143, 46), 'tw': (181, 177, 58)}, button={'cn': (1080, 415, 1147, 505), 'en': (1080, 415, 1147, 505), 'jp': (1078, 414, 1149, 506), 'tw': (1080, 415, 1147, 505)}, file={'cn': './assets/cn/shipyard/SHIPYARD_GO_FATE.png', 'en': './assets/en/shipyard/SHIPYARD_GO_FATE.png', 'jp': './assets/jp/shipyard/SHIPYARD_GO_FATE.png', 'tw': './assets/tw/shipyard/SHIPYARD_GO_FATE.png'})
SHIPYARD_IN_FATE = Button(area={'cn': (924, 122, 1025, 146), 'en': (924, 124, 1114, 144), 'jp': (925, 122, 1023, 145), 'tw': (924, 124, 1114, 144)}, color={'cn': (186, 181, 81), 'en': (167, 161, 68), 'jp': (176, 173, 76), 'tw': (167, 161, 68)}, button={'cn': (924, 122, 1025, 146), 'en': (924, 124, 1114, 144), 'jp': (925, 122, 1023, 145), 'tw': (924, 124, 1114, 144)}, file={'cn': './assets/cn/shipyard/SHIPYARD_IN_FATE.png', 'en': './assets/en/shipyard/SHIPYARD_IN_FATE.png', 'jp': './assets/jp/shipyard/SHIPYARD_IN_FATE.png', 'tw': './assets/tw/shipyard/SHIPYARD_IN_FATE.png'})
SHIPYARD_LEVEL_NOT_ENOUGH_DEV = Button(area={'cn': (1230, 155, 1273, 171), 'en': (1230, 155, 1273, 171), 'jp': (1230, 155, 1273, 171), 'tw': (1230, 155, 1273, 171)}, color={'cn': (125, 142, 174), 'en': (125, 142, 174), 'jp': (125, 142, 174), 'tw': (125, 142, 174)}, button={'cn': (1230, 155, 1273, 171), 'en': (1230, 155, 1273, 171), 'jp': (1230, 155, 1273, 171), 'tw': (1230, 155, 1273, 171)}, file={'cn': './assets/cn/shipyard/SHIPYARD_LEVEL_NOT_ENOUGH_DEV.png', 'en': './assets/cn/shipyard/SHIPYARD_LEVEL_NOT_ENOUGH_DEV.png', 'jp': './assets/jp/shipyard/SHIPYARD_LEVEL_NOT_ENOUGH_DEV.png', 'tw': './assets/cn/shipyard/SHIPYARD_LEVEL_NOT_ENOUGH_DEV.png'})
SHIPYARD_LEVEL_NOT_ENOUGH_FATE = Button(area={'cn': (1019, 155, 1276, 199), 'en': (1019, 155, 1276, 199), 'jp': (1019, 155, 1276, 199), 'tw': (1019, 155, 1276, 199)}, color={'cn': (63, 42, 41), 'en': (63, 42, 41), 'jp': (63, 42, 41), 'tw': (63, 42, 41)}, button={'cn': (1019, 155, 1276, 199), 'en': (1019, 155, 1276, 199), 'jp': (1019, 155, 1276, 199), 'tw': (1019, 155, 1276, 199)}, file={'cn': './assets/cn/shipyard/SHIPYARD_LEVEL_NOT_ENOUGH_FATE.png', 'en': './assets/cn/shipyard/SHIPYARD_LEVEL_NOT_ENOUGH_FATE.png', 'jp': './assets/jp/shipyard/SHIPYARD_LEVEL_NOT_ENOUGH_FATE.png', 'tw': './assets/cn/shipyard/SHIPYARD_LEVEL_NOT_ENOUGH_FATE.png'})
SHIPYARD_MINUS_DEV = Button(area={'cn': (1053, 424, 1089, 456), 'en': (1053, 424, 1089, 456), 'jp': (1056, 428, 1086, 455), 'tw': (1053, 424, 1089, 456)}, color={'cn': (78, 128, 196), 'en': (78, 128, 196), 'jp': (84, 132, 201), 'tw': (78, 128, 196)}, button={'cn': (1053, 424, 1089, 456), 'en': (1053, 424, 1089, 456), 'jp': (1056, 428, 1086, 455), 'tw': (1053, 424, 1089, 456)}, file={'cn': './assets/cn/shipyard/SHIPYARD_MINUS_DEV.png', 'en': './assets/en/shipyard/SHIPYARD_MINUS_DEV.png', 'jp': './assets/jp/shipyard/SHIPYARD_MINUS_DEV.png', 'tw': './assets/tw/shipyard/SHIPYARD_MINUS_DEV.png'})
SHIPYARD_MINUS_FATE = Button(area={'cn': (1031, 446, 1068, 481), 'en': (1031, 461, 1067, 497), 'jp': (1034, 451, 1064, 479), 'tw': (1031, 461, 1067, 497)}, color={'cn': (77, 127, 195), 'en': (76, 127, 195), 'jp': (81, 131, 199), 'tw': (76, 127, 195)}, button={'cn': (1031, 446, 1068, 481), 'en': (1031, 461, 1067, 497), 'jp': (1034, 451, 1064, 479), 'tw': (1031, 461, 1067, 497)}, file={'cn': './assets/cn/shipyard/SHIPYARD_MINUS_FATE.png', 'en': './assets/en/shipyard/SHIPYARD_MINUS_FATE.png', 'jp': './assets/jp/shipyard/SHIPYARD_MINUS_FATE.png', 'tw': './assets/tw/shipyard/SHIPYARD_MINUS_FATE.png'})
SHIPYARD_PLUS_DEV = Button(area={'cn': (1218, 422, 1256, 458), 'en': (1218, 422, 1256, 458), 'jp': (1223, 426, 1252, 455), 'tw': (1218, 422, 1256, 458)}, color={'cn': (82, 131, 199), 'en': (82, 131, 199), 'jp': (91, 134, 199), 'tw': (82, 131, 199)}, button={'cn': (1218, 422, 1256, 458), 'en': (1218, 422, 1256, 458), 'jp': (1223, 426, 1252, 455), 'tw': (1218, 422, 1256, 458)}, file={'cn': './assets/cn/shipyard/SHIPYARD_PLUS_DEV.png', 'en': './assets/en/shipyard/SHIPYARD_PLUS_DEV.png', 'jp': './assets/jp/shipyard/SHIPYARD_PLUS_DEV.png', 'tw': './assets/tw/shipyard/SHIPYARD_PLUS_DEV.png'})

View File

@ -86,7 +86,7 @@ class RewardShipyard(ShipyardUI, GeneralShop):
start, count = self._shipyard_buy_calc(prev, count)
while count > 0:
if not self._shipyard_buy_enter() or \
self._shipyard_appear_max():
self._shipyard_cannot_strengthen():
break
remain = self._shipyard_ensure_index(count)
@ -110,7 +110,7 @@ class RewardShipyard(ShipyardUI, GeneralShop):
count = self._shipyard_get_bp_count(index)
while count > 0:
if not self._shipyard_buy_enter() or \
self._shipyard_appear_max():
self._shipyard_cannot_strengthen():
break
remain = self._shipyard_ensure_index(count)
@ -147,7 +147,7 @@ class RewardShipyard(ShipyardUI, GeneralShop):
self.ui_ensure(page_shipyard)
if not self.shipyard_set_focus(series=series, index=index) or \
not self._shipyard_buy_enter() or \
self._shipyard_appear_max():
self._shipyard_cannot_strengthen():
return True
self._shipyard_use(index=index)

View File

@ -8,7 +8,7 @@ from module.ui.ui import UI
class ShipyardUI(UI):
def _shipyard_appear_max(self):
def _shipyard_cannot_strengthen(self):
"""
Shorthand for appear if a ship can no longer
be strengthened either in 'DEV' or 'FATE'
@ -17,8 +17,10 @@ class ShipyardUI(UI):
Returns:
bool if appear
"""
if self.appear(SHIPYARD_PROGRESS_DEV, offset=(20, 20)) or \
self.appear(SHIPYARD_PROGRESS_FATE, offset=(20, 20)):
if self.appear(SHIPYARD_PROGRESS_DEV, offset=(20, 20)) \
or self.appear(SHIPYARD_PROGRESS_FATE, offset=(20, 20)) \
or self.appear(SHIPYARD_LEVEL_NOT_ENOUGH_FATE, offset=(20, 20)) \
or self.appear(SHIPYARD_LEVEL_NOT_ENOUGH_DEV, offset=(20, 20)):
logger.info('Ship at full strength for current level, '
'no more BPs can be consumed')
return True
@ -109,7 +111,7 @@ class ShipyardUI(UI):
logger.warning(f'Research Series {series} is not selectable')
return False
self.ui_click(SHIPYARD_SERIES_SELECT_ENTER,
self.ui_click(SHIPYARD_SERIES_SELECT_ENTER, appear_button=SHIPYARD_UI_CHECK,
check_button=SHIPYARD_SERIES_SELECT_CHECK,
skip_first_screenshot=skip_first_screenshot)
series_button = SHIPYARD_SERIES_GRID.buttons[series - 1]

View File

@ -52,7 +52,7 @@ MAIN_GOTO_SHOP = Button(area={'cn': (11, 662, 165, 713), 'en': (11, 662, 165, 71
MEOWFFICER_CHECK = Button(area={'cn': (142, 16, 212, 38), 'en': (617, 568, 658, 605), 'jp': (124, 7, 227, 48), 'tw': (140, 15, 217, 41)}, color={'cn': (180, 175, 175), 'en': (183, 179, 180), 'jp': (236, 234, 235), 'tw': (201, 197, 198)}, button={'cn': (142, 16, 212, 38), 'en': (617, 568, 658, 605), 'jp': (124, 7, 227, 48), 'tw': (140, 15, 217, 41)}, file={'cn': './assets/cn/ui/MEOWFFICER_CHECK.png', 'en': './assets/en/ui/MEOWFFICER_CHECK.png', 'jp': './assets/jp/ui/MEOWFFICER_CHECK.png', 'tw': './assets/tw/ui/MEOWFFICER_CHECK.png'})
MEOWFFICER_GOTO_DORM = Button(area={'cn': (24, 7, 49, 45), 'en': (24, 7, 49, 45), 'jp': (15, 4, 61, 49), 'tw': (24, 7, 49, 45)}, color={'cn': (248, 222, 158), 'en': (248, 222, 158), 'jp': (241, 233, 201), 'tw': (248, 222, 158)}, button={'cn': (24, 7, 49, 45), 'en': (24, 7, 49, 45), 'jp': (15, 4, 61, 49), 'tw': (24, 7, 49, 45)}, file={'cn': './assets/cn/ui/MEOWFFICER_GOTO_DORM.png', 'en': './assets/en/ui/MEOWFFICER_GOTO_DORM.png', 'jp': './assets/jp/ui/MEOWFFICER_GOTO_DORM.png', 'tw': './assets/tw/ui/MEOWFFICER_GOTO_DORM.png'})
MEOWFFICER_INFO = Button(area={'cn': (1090, 603, 1241, 650), 'en': (1106, 616, 1227, 638), 'jp': (1089, 608, 1240, 647), 'tw': (1124, 610, 1207, 647)}, color={'cn': (243, 214, 92), 'en': (212, 182, 77), 'jp': (247, 218, 92), 'tw': (229, 200, 87)}, button={'cn': (1090, 603, 1241, 650), 'en': (1106, 616, 1227, 638), 'jp': (1089, 608, 1240, 647), 'tw': (1124, 610, 1207, 647)}, file={'cn': './assets/cn/ui/MEOWFFICER_INFO.png', 'en': './assets/en/ui/MEOWFFICER_INFO.png', 'jp': './assets/jp/ui/MEOWFFICER_INFO.png', 'tw': './assets/tw/ui/MEOWFFICER_INFO.png'})
META_CHECK = Button(area={'cn': (148, 13, 265, 36), 'en': (148, 13, 265, 36), 'jp': (148, 13, 265, 36), 'tw': (148, 13, 265, 36)}, color={'cn': (170, 156, 156), 'en': (170, 156, 156), 'jp': (170, 156, 156), 'tw': (170, 156, 156)}, button={'cn': (148, 13, 265, 36), 'en': (148, 13, 265, 36), 'jp': (148, 13, 265, 36), 'tw': (148, 13, 265, 36)}, file={'cn': './assets/cn/ui/META_CHECK.png', 'en': './assets/en/ui/META_CHECK.png', 'jp': './assets/jp/ui/META_CHECK.png', 'tw': './assets/tw/ui/META_CHECK.png'})
META_CHECK = Button(area={'cn': (148, 13, 265, 36), 'en': (148, 13, 265, 36), 'jp': (125, 11, 235, 39), 'tw': (148, 13, 265, 36)}, color={'cn': (170, 156, 156), 'en': (170, 156, 156), 'jp': (124, 105, 106), 'tw': (170, 156, 156)}, button={'cn': (148, 13, 265, 36), 'en': (148, 13, 265, 36), 'jp': (125, 11, 235, 39), 'tw': (148, 13, 265, 36)}, file={'cn': './assets/cn/ui/META_CHECK.png', 'en': './assets/en/ui/META_CHECK.png', 'jp': './assets/jp/ui/META_CHECK.png', 'tw': './assets/tw/ui/META_CHECK.png'})
MISSION_CHECK = Button(area={'cn': (120, 15, 173, 40), 'en': (123, 18, 221, 37), 'jp': (120, 14, 173, 40), 'tw': (119, 12, 176, 42)}, color={'cn': (141, 156, 194), 'en': (104, 117, 158), 'jp': (150, 165, 202), 'tw': (125, 139, 178)}, button={'cn': (120, 15, 173, 40), 'en': (123, 18, 221, 37), 'jp': (120, 14, 173, 40), 'tw': (119, 12, 176, 42)}, file={'cn': './assets/cn/ui/MISSION_CHECK.png', 'en': './assets/en/ui/MISSION_CHECK.png', 'jp': './assets/jp/ui/MISSION_CHECK.png', 'tw': './assets/tw/ui/MISSION_CHECK.png'})
MUNITIONS_CHECK = Button(area={'cn': (121, 14, 230, 39), 'en': (115, 16, 235, 36), 'jp': (133, 14, 189, 39), 'tw': (117, 12, 232, 41)}, color={'cn': (151, 165, 203), 'en': (112, 126, 165), 'jp': (160, 176, 211), 'tw': (133, 148, 188)}, button={'cn': (121, 14, 230, 39), 'en': (115, 16, 235, 36), 'jp': (133, 14, 189, 39), 'tw': (117, 12, 232, 41)}, file={'cn': './assets/cn/ui/MUNITIONS_CHECK.png', 'en': './assets/en/ui/MUNITIONS_CHECK.png', 'jp': './assets/jp/ui/MUNITIONS_CHECK.png', 'tw': './assets/tw/ui/MUNITIONS_CHECK.png'})
OS_CHECK = Button(area={'cn': (587, 20, 623, 42), 'en': (587, 20, 623, 42), 'jp': (587, 20, 623, 42), 'tw': (587, 20, 623, 42)}, color={'cn': (159, 168, 177), 'en': (159, 168, 177), 'jp': (159, 168, 177), 'tw': (159, 168, 177)}, button={'cn': (587, 20, 623, 42), 'en': (587, 20, 623, 42), 'jp': (587, 20, 623, 42), 'tw': (587, 20, 623, 42)}, file={'cn': './assets/cn/ui/OS_CHECK.png', 'en': './assets/en/ui/OS_CHECK.png', 'jp': './assets/jp/ui/OS_CHECK.png', 'tw': './assets/tw/ui/OS_CHECK.png'})

View File

@ -5,7 +5,8 @@ from module.ocr.ocr import DigitCounter
from module.war_archives.assets import OCR_DATA_KEY_CAMPAIGN, WAR_ARCHIVES_CAMPAIGN_CHECK
DATA_KEY_CAMPAIGN = DigitCounter(OCR_DATA_KEY_CAMPAIGN, letter=(255, 247, 247), threshold=64)
RECORD_SINCE = (0,)
RECORD_OPTION = ('DailyRecord', 'war_archives')
class CampaignWarArchives(CampaignRun, CampaignBase):
def triggered_stop_condition(self, oil_check=True):
@ -21,6 +22,24 @@ class CampaignWarArchives(CampaignRun, CampaignBase):
# Else, check other stop conditions
return super().triggered_stop_condition(oil_check)
def run_war_archives_daily(self):
"""
Returns:
bool: If executed.
"""
self.reward_backup_daily_reward_settings()
backup = self.config.cover(STOP_IF_COUNT_GREATER_THAN=4) # 4 data keys daily
if not self.config.record_executed_since(option=RECORD_OPTION, since=RECORD_SINCE):
self.run(self.config.WAR_ARCHIVES_STAGE, folder=self.config.WAR_ARCHIVES_NAME)
self.config.record_save(option=RECORD_OPTION)
executed = True
else:
executed = False
backup.recover()
self.reward_recover_daily_reward_settings()
return executed
def run(self, name=None, folder='campaign_main', total=0):
backup = self.config.cover(USE_DATA_KEY=True)
super().run(name, folder, total)