Merge branch 'master' of https://github.com/whoamikyo/AzurLaneAutoScript
@ -17,7 +17,7 @@ EN support, Thanks **[@whoamikyo](https://github.com/whoamikyo)**
|
||||
|
||||
- **主线图出击** 暂时仅支持前六章和7-2
|
||||
|
||||
- **活动图出击** 支持「穹顶下的圣咏曲」(event_20200521_cn), 针对D1D3有优化, 支持处理光之壁(舰队无法在有光之壁的格子进行通行), 支持开荒
|
||||
- **活动图出击** 支持「峡湾间的反击」(event_20200603_cn), 针对SP1-SP3有优化, 支持开荒
|
||||
|
||||
- **每日任务** 半小时左右一套做完, 重复运行时会跳过当天做过的
|
||||
|
||||
|
BIN
assets/cn/handler/LOGIN_CONFIRM.png
Normal file
After Width: | Height: | Size: 6.8 KiB |
BIN
assets/cn/template/TEMPLATE_SIREN_Z18.png
Normal file
After Width: | Height: | Size: 3.2 KiB |
BIN
assets/cn/template/TEMPLATE_SIREN_Z19.png
Normal file
After Width: | Height: | Size: 3.2 KiB |
BIN
assets/cn/template/TEMPLATE_SIREN_Z2.png
Normal file
After Width: | Height: | Size: 3.0 KiB |
BIN
assets/en/handler/LOGIN_CONFIRM.png
Normal file
After Width: | Height: | Size: 6.8 KiB |
BIN
assets/en/template/TEMPLATE_SIREN_Z18.png
Normal file
After Width: | Height: | Size: 3.2 KiB |
BIN
assets/en/template/TEMPLATE_SIREN_Z19.png
Normal file
After Width: | Height: | Size: 3.2 KiB |
BIN
assets/en/template/TEMPLATE_SIREN_Z2.png
Normal file
After Width: | Height: | Size: 3.0 KiB |
@ -32,8 +32,8 @@ A4, B4, C4, D4, E4, F4, \
|
||||
|
||||
|
||||
class Config:
|
||||
FLEET_2 = 0
|
||||
SUBMARINE = 0
|
||||
FLEET_BOSS = 1
|
||||
|
||||
INTERNAL_LINES_FIND_PEAKS_PARAMETERS = {
|
||||
'height': (120, 255 - 40),
|
||||
'width': (1.5, 10),
|
||||
@ -59,7 +59,7 @@ class Campaign(CampaignBase):
|
||||
def battle_2(self):
|
||||
self.clear_all_mystery()
|
||||
|
||||
if not self.check_accessibility(D4):
|
||||
if not self.check_accessibility(D4, fleet='boss'):
|
||||
return self.battle_default()
|
||||
|
||||
return self.clear_boss()
|
||||
return self.fleet_boss.clear_boss()
|
||||
|
@ -48,7 +48,7 @@ class Campaign(CampaignBase):
|
||||
def battle_3(self):
|
||||
self.clear_all_mystery()
|
||||
|
||||
if not self.check_accessibility(D1):
|
||||
if not self.check_accessibility(D1, fleet='boss'):
|
||||
return self.battle_default()
|
||||
|
||||
return self.clear_boss()
|
||||
return self.fleet_boss.clear_boss()
|
||||
|
@ -48,7 +48,7 @@ class Campaign(CampaignBase):
|
||||
def battle_3(self):
|
||||
self.clear_all_mystery()
|
||||
|
||||
if not self.check_accessibility(E1):
|
||||
if not self.check_accessibility(E1, fleet='boss'):
|
||||
return self.battle_default()
|
||||
|
||||
return self.clear_boss()
|
||||
return self.fleet_boss.clear_boss()
|
||||
|
@ -41,7 +41,7 @@ class Campaign(CampaignBase):
|
||||
return self.battle_default()
|
||||
|
||||
def battle_3(self):
|
||||
if not self.check_accessibility(G1):
|
||||
if not self.check_accessibility(G1, fleet='boss'):
|
||||
return self.battle_default()
|
||||
|
||||
return self.clear_boss()
|
||||
return self.fleet_boss.clear_boss()
|
||||
|
@ -33,8 +33,8 @@ A4, B4, C4, D4, E4, F4, G4, \
|
||||
|
||||
|
||||
class Config:
|
||||
FLEET_2 = 0
|
||||
SUBMARINE = 0
|
||||
FLEET_BOSS = 1
|
||||
|
||||
MAP_MYSTERY_HAS_CARRIER = True
|
||||
INTERNAL_LINES_FIND_PEAKS_PARAMETERS = {
|
||||
'height': (120, 255 - 40),
|
||||
@ -61,7 +61,7 @@ class Campaign(CampaignBase):
|
||||
def battle_3(self):
|
||||
self.clear_all_mystery()
|
||||
|
||||
if not self.check_accessibility(G2):
|
||||
return self.battle_default()
|
||||
if not self.check_accessibility(G2, fleet='boss'):
|
||||
return self.fleet_boss.battle_default()
|
||||
|
||||
return self.clear_boss()
|
||||
|
@ -45,7 +45,7 @@ class Campaign(CampaignBase):
|
||||
def battle_3(self):
|
||||
self.clear_all_mystery()
|
||||
|
||||
if not self.check_accessibility(H1):
|
||||
if not self.check_accessibility(H1, fleet='boss'):
|
||||
return self.battle_default()
|
||||
|
||||
return self.clear_boss()
|
||||
return self.fleet_boss.clear_boss()
|
||||
|
@ -47,7 +47,7 @@ class Campaign(CampaignBase):
|
||||
def battle_3(self):
|
||||
self.clear_all_mystery()
|
||||
|
||||
if not self.check_accessibility(A4):
|
||||
if not self.check_accessibility(A4, fleet='boss'):
|
||||
return self.battle_default()
|
||||
|
||||
return self.clear_boss()
|
||||
return self.fleet_boss.clear_boss()
|
||||
|
@ -50,10 +50,10 @@ class Campaign(CampaignBase):
|
||||
return self.battle_default()
|
||||
|
||||
def battle_3(self):
|
||||
if not self.check_accessibility(H3):
|
||||
if not self.check_accessibility(H3, fleet='boss'):
|
||||
return self.battle_default()
|
||||
|
||||
return self.clear_boss()
|
||||
return self.fleet_boss.clear_boss()
|
||||
|
||||
def handle_boss_appear_refocus(self):
|
||||
for data in self.map.spawn_data:
|
||||
|
@ -39,8 +39,8 @@ A6, B6, C6, D6, E6, F6, \
|
||||
|
||||
|
||||
class Config:
|
||||
FLEET_2 = 0
|
||||
SUBMARINE = 0
|
||||
FLEET_BOSS = 1
|
||||
|
||||
MAP_MYSTERY_HAS_CARRIER = True
|
||||
INTERNAL_LINES_FIND_PEAKS_PARAMETERS = {
|
||||
'height': (120, 255 - 40),
|
||||
@ -72,7 +72,7 @@ class Campaign(CampaignBase):
|
||||
|
||||
boss = self.map.select(is_boss=True)
|
||||
if boss:
|
||||
if not self.check_accessibility(boss[0]):
|
||||
if not self.check_accessibility(boss[0], fleet='boss'):
|
||||
return self.battle_default()
|
||||
|
||||
return self.clear_boss()
|
||||
return self.fleet_boss.clear_boss()
|
||||
|
@ -58,7 +58,7 @@ class Campaign(CampaignBase):
|
||||
|
||||
boss = self.map.select(is_boss=True)
|
||||
if boss:
|
||||
if not self.check_accessibility(boss[0]):
|
||||
if not self.check_accessibility(boss[0], fleet='boss'):
|
||||
return self.battle_default()
|
||||
|
||||
return self.clear_boss()
|
||||
return self.fleet_boss.clear_boss()
|
||||
|
@ -54,7 +54,7 @@ class Campaign(CampaignBase):
|
||||
|
||||
boss = self.map.select(is_boss=True)
|
||||
if boss:
|
||||
if not self.check_accessibility(boss[0]):
|
||||
if not self.check_accessibility(boss[0], fleet='boss'):
|
||||
return self.battle_default()
|
||||
|
||||
return self.clear_boss()
|
||||
return self.fleet_boss.clear_boss()
|
||||
|
@ -65,10 +65,10 @@ class Campaign(CampaignBase):
|
||||
def battle_4(self):
|
||||
boss = self.map.select(is_boss=True)
|
||||
if boss:
|
||||
if not self.check_accessibility(boss[0]):
|
||||
if not self.check_accessibility(boss[0], fleet='boss'):
|
||||
if self.clear_roadblocks([road_main]):
|
||||
return True
|
||||
if self.clear_potential_roadblocks([road_main]):
|
||||
return True
|
||||
|
||||
return self.clear_boss()
|
||||
return self.fleet_boss.clear_boss()
|
||||
|
@ -41,9 +41,9 @@ A6, B6, C6, D6, E6, F6, G6, H6, \
|
||||
|
||||
|
||||
class Config:
|
||||
FLEET_2 = 0
|
||||
SUBMARINE = 0
|
||||
FLEET_BOSS = 1
|
||||
MAP_MYSTERY_HAS_CARRIER = True
|
||||
|
||||
INTERNAL_LINES_FIND_PEAKS_PARAMETERS = {
|
||||
'height': (120, 255 - 40),
|
||||
'width': (1.5, 10),
|
||||
@ -71,7 +71,7 @@ class Campaign(CampaignBase):
|
||||
|
||||
boss = self.map.select(is_boss=True)
|
||||
if boss:
|
||||
if not self.check_accessibility(boss[0]):
|
||||
if not self.check_accessibility(boss[0], fleet='boss'):
|
||||
return self.battle_default()
|
||||
|
||||
return self.clear_boss()
|
||||
return self.fleet_boss.clear_boss()
|
||||
|
@ -51,7 +51,7 @@ class Campaign(CampaignBase):
|
||||
|
||||
boss = self.map.select(is_boss=True)
|
||||
if boss:
|
||||
if not self.check_accessibility(boss[0]):
|
||||
if not self.check_accessibility(boss[0], fleet='boss'):
|
||||
return self.battle_default()
|
||||
|
||||
return self.clear_boss()
|
||||
return self.fleet_boss.clear_boss()
|
||||
|
@ -51,7 +51,7 @@ class Campaign(CampaignBase):
|
||||
|
||||
boss = self.map.select(is_boss=True)
|
||||
if boss:
|
||||
if not self.check_accessibility(boss[0]):
|
||||
if not self.check_accessibility(boss[0], fleet='boss'):
|
||||
return self.battle_default()
|
||||
|
||||
return self.clear_boss()
|
||||
return self.fleet_boss.clear_boss()
|
||||
|
@ -62,10 +62,10 @@ class Campaign(CampaignBase):
|
||||
def battle_4(self):
|
||||
boss = self.map.select(is_boss=True)
|
||||
if boss:
|
||||
if not self.check_accessibility(boss[0]):
|
||||
if not self.check_accessibility(boss[0], fleet='boss'):
|
||||
if self.clear_roadblocks([road_center]):
|
||||
return True
|
||||
if self.clear_potential_roadblocks([road_ring]):
|
||||
return True
|
||||
|
||||
return self.clear_boss()
|
||||
return self.fleet_boss.clear_boss()
|
||||
|
@ -42,7 +42,7 @@ road_mystery = RoadGrids([[C4, D5], D4, G2, [G1, H2]])
|
||||
|
||||
|
||||
class Config:
|
||||
SUBMARINE = 0
|
||||
FLEET_BOSS = 1
|
||||
MAP_MYSTERY_HAS_CARRIER = True
|
||||
|
||||
|
||||
@ -70,7 +70,7 @@ class Campaign(CampaignBase):
|
||||
|
||||
boss = self.map.select(is_boss=True)
|
||||
if boss:
|
||||
if not self.check_accessibility(boss[0], fleet=2):
|
||||
if not self.check_accessibility(boss[0], fleet='boss'):
|
||||
return self.clear_roadblocks([road_boss])
|
||||
|
||||
return self.fleet_2.clear_boss()
|
||||
return self.fleet_boss.clear_boss()
|
||||
|
@ -64,7 +64,7 @@ class Campaign(CampaignBase):
|
||||
|
||||
boss = self.map.select(is_boss=True)
|
||||
if boss:
|
||||
if not self.check_accessibility(boss[0], fleet=2):
|
||||
if not self.check_accessibility(boss[0], fleet='boss'):
|
||||
return self.clear_roadblocks([road_boss])
|
||||
|
||||
return self.fleet_2.clear_boss()
|
||||
return self.fleet_boss.clear_boss()
|
||||
|
@ -77,7 +77,7 @@ class Campaign(CampaignBase):
|
||||
|
||||
boss = self.map.select(is_boss=True)
|
||||
if boss:
|
||||
if not self.check_accessibility(boss[0], fleet=2):
|
||||
if not self.check_accessibility(boss[0], fleet='boss'):
|
||||
return self.clear_roadblocks([road_boss])
|
||||
|
||||
return self.fleet_2.clear_boss()
|
||||
return self.fleet_boss.clear_boss()
|
||||
|
@ -68,9 +68,12 @@ class Campaign(CampaignBase):
|
||||
def battle_5(self):
|
||||
self.clear_all_mystery()
|
||||
|
||||
if not self.config.FLEET_2:
|
||||
self.pick_up_ammo()
|
||||
|
||||
boss = self.map.select(is_boss=True)
|
||||
if boss:
|
||||
if not self.check_accessibility(boss[0], fleet=2):
|
||||
if not self.check_accessibility(boss[0], fleet='boss'):
|
||||
return self.clear_roadblocks([road_boss])
|
||||
|
||||
return self.fleet_2.clear_boss()
|
||||
return self.fleet_boss.clear_boss()
|
||||
|
73
campaign/event_20200603_cn/sp1.py
Normal file
@ -0,0 +1,73 @@
|
||||
from module.campaign.campaign_base import CampaignBase
|
||||
from module.map.map_base import CampaignMap
|
||||
|
||||
MAP = CampaignMap()
|
||||
MAP.map_data = '''
|
||||
++ ++ ++ -- ME -- -- -- -- ++ --
|
||||
-- ME -- ++ -- ++ ++ ME -- ++ ME
|
||||
ME -- -- ME -- ME ++ -- ME ++ --
|
||||
-- -- -- -- -- ++ ME -- -- -- SP
|
||||
ME -- -- ME -- -- -- __ -- -- SP
|
||||
-- -- ME ++ -- MS -- ME -- -- --
|
||||
-- -- -- ++ MB -- MB ++ ++ ++ ++
|
||||
'''
|
||||
MAP.camera_data = ['D3', 'D5', 'H3', 'H5']
|
||||
MAP.weight_data = '''
|
||||
10 10 10 10 40 10 10 10 10 10 50
|
||||
10 30 10 10 10 10 10 20 10 10 50
|
||||
30 10 10 10 10 20 10 10 10 10 50
|
||||
10 10 10 10 10 10 10 10 10 10 10
|
||||
10 10 10 10 10 10 10 10 10 10 10
|
||||
30 10 20 10 10 10 10 10 10 10 10
|
||||
10 10 10 10 10 10 10 10 10 10 10
|
||||
'''
|
||||
MAP.spawn_data = [
|
||||
{'battle': 0, 'enemy': 3, 'siren': 1},
|
||||
{'battle': 1, 'enemy': 1},
|
||||
{'battle': 2, 'enemy': 1},
|
||||
{'battle': 3, 'enemy': 1},
|
||||
{'battle': 4, 'boss': 1},
|
||||
]
|
||||
|
||||
|
||||
class Config:
|
||||
SUBMARINE = 0
|
||||
|
||||
POOR_MAP_DATA = True
|
||||
MAP_HAS_AMBUSH = False
|
||||
MAP_HAS_FLEET_STEP = True
|
||||
MAP_HAS_MOVABLE_ENEMY = True
|
||||
MAP_HAS_SIREN = True
|
||||
MAP_HAS_DYNAMIC_RED_BORDER = False
|
||||
MAP_HAS_MAP_STORY = True
|
||||
MAP_SIREN_TEMPLATE = ['Z18']
|
||||
MAP_SIREN_COUNT = 1
|
||||
|
||||
TRUST_EDGE_LINES = False
|
||||
INTERNAL_LINES_FIND_PEAKS_PARAMETERS = {
|
||||
'height': (100, 255 - 24),
|
||||
'width': 1,
|
||||
'prominence': 10,
|
||||
'distance': 35,
|
||||
}
|
||||
EDGE_LINES_FIND_PEAKS_PARAMETERS = {
|
||||
'height': (255 - 24, 255),
|
||||
'prominence': 2,
|
||||
'distance': 50,
|
||||
'wlen': 1000
|
||||
}
|
||||
|
||||
|
||||
class Campaign(CampaignBase):
|
||||
MAP = MAP
|
||||
|
||||
def battle_0(self):
|
||||
if self.clear_siren():
|
||||
return True
|
||||
if self.fleet_2_break_siren_caught():
|
||||
return True
|
||||
|
||||
return self.battle_default()
|
||||
|
||||
def battle_4(self):
|
||||
return self.fleet_boss.clear_boss()
|
55
campaign/event_20200603_cn/sp2.py
Normal file
@ -0,0 +1,55 @@
|
||||
from module.campaign.campaign_base import CampaignBase
|
||||
from module.map.map_base import CampaignMap
|
||||
from campaign.event_20200603_cn.sp1 import Config as ConfigBase
|
||||
|
||||
MAP = CampaignMap()
|
||||
MAP.map_data = '''
|
||||
-- -- ++ ++ SP -- SP ++ ++ ++ ++
|
||||
-- ME ++ ++ -- -- -- -- -- ME ME
|
||||
ME -- -- MS -- -- -- ME -- -- MB
|
||||
++ -- -- -- ME -- ME ++ __ -- MB
|
||||
-- -- ++ ++ ++ MS -- ++ -- -- ME
|
||||
-- ME -- ME ++ -- -- -- -- ME ++
|
||||
-- -- -- -- -- ME ME ME ME -- ++
|
||||
'''
|
||||
MAP.camera_data = ['D3', 'D5', 'H3', 'H5']
|
||||
MAP.weight_data = '''
|
||||
10 10 10 10 10 10 10 10 10 10 10
|
||||
10 10 10 10 10 10 10 10 10 10 10
|
||||
10 10 10 10 10 10 10 10 10 10 10
|
||||
10 10 10 10 10 10 10 10 10 10 10
|
||||
10 10 10 10 10 10 10 10 10 10 10
|
||||
10 10 10 10 10 10 10 10 10 10 10
|
||||
10 10 10 10 10 10 10 10 10 10 10
|
||||
'''
|
||||
MAP.spawn_data = [
|
||||
{'battle': 0, 'enemy': 3, 'siren': 2},
|
||||
{'battle': 1, 'enemy': 2},
|
||||
{'battle': 2, 'enemy': 1},
|
||||
{'battle': 3, 'enemy': 1},
|
||||
{'battle': 4},
|
||||
{'battle': 5, 'boss': 1},
|
||||
]
|
||||
|
||||
|
||||
class Config(ConfigBase):
|
||||
FLEET_BOSS = 2
|
||||
|
||||
# POOR_MAP_DATA = True
|
||||
MAP_SIREN_TEMPLATE = ['Z2']
|
||||
MAP_SIREN_COUNT = 2
|
||||
|
||||
|
||||
class Campaign(CampaignBase):
|
||||
MAP = MAP
|
||||
|
||||
def battle_0(self):
|
||||
if self.clear_siren():
|
||||
return True
|
||||
if self.fleet_2_break_siren_caught():
|
||||
return True
|
||||
|
||||
return self.battle_default()
|
||||
|
||||
def battle_5(self):
|
||||
return self.fleet_2.clear_boss()
|
55
campaign/event_20200603_cn/sp3.py
Normal file
@ -0,0 +1,55 @@
|
||||
from module.campaign.campaign_base import CampaignBase
|
||||
from module.map.map_base import CampaignMap
|
||||
from campaign.event_20200603_cn.sp1 import Config as ConfigBase
|
||||
|
||||
MAP = CampaignMap()
|
||||
MAP.map_data = '''
|
||||
++ ++ ++ MS ++ ME -- ME ++ ++ ++
|
||||
SP -- -- -- -- -- MS -- ME ME --
|
||||
SP -- -- -- -- ME -- __ -- -- ME
|
||||
++ ++ ++ MS -- ++ ++ -- ME ++ --
|
||||
MB MB ++ -- ME ++ ++ -- -- ++ ++
|
||||
-- -- -- -- -- -- -- -- -- ME --
|
||||
ME ME -- ME -- ME ++ ME -- ME --
|
||||
'''
|
||||
MAP.camera_data = ['D3', 'D5', 'G3', 'G5']
|
||||
MAP.weight_data = '''
|
||||
10 10 10 10 10 10 10 10 10 10 10
|
||||
10 10 10 10 10 10 10 10 10 10 10
|
||||
10 10 10 10 10 10 10 10 10 10 10
|
||||
10 10 10 10 10 10 10 10 10 10 10
|
||||
10 10 10 10 10 10 10 10 10 10 10
|
||||
10 10 10 10 10 10 10 10 10 10 10
|
||||
10 10 10 10 10 10 10 10 10 10 10
|
||||
'''
|
||||
MAP.spawn_data = [
|
||||
{'battle': 0, 'enemy': 3, 'siren': 2},
|
||||
{'battle': 1, 'enemy': 2, 'siren': 1},
|
||||
{'battle': 2, 'enemy': 1},
|
||||
{'battle': 3, 'enemy': 1},
|
||||
{'battle': 4, 'enemy': 1},
|
||||
{'battle': 5, 'boss': 1},
|
||||
]
|
||||
|
||||
|
||||
class Config(ConfigBase):
|
||||
FLEET_BOSS = 2
|
||||
|
||||
# POOR_MAP_DATA = True
|
||||
MAP_SIREN_TEMPLATE = ['Z19']
|
||||
MAP_SIREN_COUNT = 2
|
||||
|
||||
|
||||
class Campaign(CampaignBase):
|
||||
MAP = MAP
|
||||
|
||||
def battle_0(self):
|
||||
if self.clear_siren():
|
||||
return True
|
||||
if self.fleet_2_break_siren_caught():
|
||||
return True
|
||||
|
||||
return self.battle_default()
|
||||
|
||||
def battle_5(self):
|
||||
return self.fleet_2.clear_boss()
|
@ -5,6 +5,7 @@ import shutil
|
||||
|
||||
from gooey import Gooey, GooeyParser
|
||||
|
||||
import module.config.server as server
|
||||
from alas import AzurLaneAutoScript
|
||||
from module.config.dictionary import dic_chi_to_eng, dic_eng_to_chi
|
||||
from module.logger import logger, pyw_name
|
||||
@ -81,7 +82,10 @@ def main(ini_name=''):
|
||||
|
||||
config = update_config_from_template(config, file=config_file)
|
||||
|
||||
event_folder = [dic_eng_to_chi.get(f, f) for f in os.listdir('./campaign') if f.startswith('event_')][::-1]
|
||||
event_folder = [f for f in os.listdir('./campaign') if f.startswith('event_') and f.split('_')[-1] == server.server]
|
||||
event_latest = sorted([f for f in event_folder], reverse=True)[0]
|
||||
event_folder = [dic_eng_to_chi.get(f, f) for f in event_folder][::-1]
|
||||
event_latest = dic_eng_to_chi.get(event_latest, event_latest)
|
||||
|
||||
saved_config = {}
|
||||
for opt, option in config.items():
|
||||
@ -141,12 +145,12 @@ def main(ini_name=''):
|
||||
f1.add_argument('--舰队步长1', default=default('--舰队步长1'), choices=['1', '2', '3', '4', '5', '6'])
|
||||
|
||||
f2 = fleet.add_argument_group('BOSS队')
|
||||
f2.add_argument('--舰队编号2', default=default('--舰队编号2'), choices=['1', '2', '3', '4', '5', '6'])
|
||||
f2.add_argument('--舰队编号2', default=default('--舰队编号2'), choices=['不使用', '1', '2', '3', '4', '5', '6'])
|
||||
f2.add_argument('--舰队阵型2', default=default('--舰队阵型2'), choices=['单纵阵', '复纵阵', '轮形阵'])
|
||||
f2.add_argument('--舰队步长2', default=default('--舰队步长2'), choices=['1', '2', '3', '4', '5', '6'])
|
||||
|
||||
f3 = fleet.add_argument_group('备用道中队')
|
||||
f3.add_argument('--舰队编号3', default=default('--舰队编号3'), choices=['1', '2', '3', '4', '5', '6'])
|
||||
f3.add_argument('--舰队编号3', default=default('--舰队编号3'), choices=['不使用', '1', '2', '3', '4', '5', '6'])
|
||||
f3.add_argument('--舰队阵型3', default=default('--舰队阵型3'), choices=['单纵阵', '复纵阵', '轮形阵'])
|
||||
f3.add_argument('--舰队步长3', default=default('--舰队步长3'), choices=['1', '2', '3', '4', '5', '6'])
|
||||
|
||||
@ -316,7 +320,7 @@ def main(ini_name=''):
|
||||
# ==========每日活动图三倍PT==========
|
||||
event_ab_parser = subs.add_parser('每日活动图三倍PT')
|
||||
event_name = event_ab_parser.add_argument_group('选择活动', '')
|
||||
event_name.add_argument('--活动名称ab', default=default('--活动名称ab'), choices=event_folder, help='例如 event_20200326_cn')
|
||||
event_name.add_argument('--活动名称ab', default=event_latest, choices=event_folder, help='例如 event_20200326_cn')
|
||||
|
||||
# ==========主线图==========
|
||||
main_parser = subs.add_parser('主线图')
|
||||
@ -328,8 +332,7 @@ def main(ini_name=''):
|
||||
event_parser = subs.add_parser('活动图')
|
||||
|
||||
description = """
|
||||
支持「穹顶下的圣咏曲」(event_20200521_cn), 针对D1D3有优化
|
||||
D3第一次进图和100%通关时均有剧情战斗, 会导致报错
|
||||
支持「峡湾间的反击」(event_20200603_cn), 针对SP1-SP3有优化
|
||||
出击未优化关卡或地图未达到安全海域时, 使用开荒模式运行(较慢)
|
||||
"""
|
||||
event = event_parser.add_argument_group(
|
||||
@ -340,7 +343,7 @@ def main(ini_name=''):
|
||||
event.add_argument('--sp地图', default=default('--sp地图'),
|
||||
choices=['sp1', 'sp2', 'sp3'],
|
||||
help='例如 sp3')
|
||||
event.add_argument('--活动名称', default=default('--活动名称'), choices=event_folder, help='例如 event_20200312_cn')
|
||||
event.add_argument('--活动名称', default=event_latest, choices=event_folder, help='例如 event_20200312_cn')
|
||||
|
||||
# ==========半自动==========
|
||||
semi_parser = subs.add_parser('半自动辅助点击')
|
||||
|
@ -5,6 +5,7 @@ import shutil
|
||||
|
||||
from gooey import Gooey, GooeyParser
|
||||
|
||||
import module.config.server as server
|
||||
from alas import AzurLaneAutoScript
|
||||
from module.config.dictionary import dic_true_eng_to_eng, dic_eng_to_true_eng
|
||||
from module.logger import logger, pyw_name
|
||||
@ -79,7 +80,10 @@ def main(ini_name=''):
|
||||
|
||||
config = update_config_from_template(config, file=config_file)
|
||||
|
||||
event_folder = [dic_eng_to_true_eng.get(f, f) for f in os.listdir('./campaign') if f.startswith('event_')][::-1]
|
||||
event_folder = [f for f in os.listdir('./campaign') if f.startswith('event_') and f.split('_')[-1] == server.server]
|
||||
event_latest = sorted([f for f in event_folder], reverse=True)[0]
|
||||
event_folder = [dic_eng_to_true_eng.get(f, f) for f in event_folder][::-1]
|
||||
event_latest = dic_eng_to_true_eng.get(event_latest, event_latest)
|
||||
|
||||
saved_config = {}
|
||||
for opt, option in config.items():
|
||||
@ -139,12 +143,12 @@ def main(ini_name=''):
|
||||
f1.add_argument('--fleet_step_1', default=default('--fleet_step_1'), choices=['1', '2', '3', '4', '5', '6'], help='In event map, fleet has limit on moving, so fleet_step is how far can a fleet goes in one operation, if map cleared, it will be ignored')
|
||||
|
||||
f2 = fleet.add_argument_group('Boss Fleet')
|
||||
f2.add_argument('--fleet_index_2', default=default('--fleet_index_2'), choices=['1', '2', '3', '4', '5', '6'])
|
||||
f2.add_argument('--fleet_index_2', default=default('--fleet_index_2'), choices=['do_not_use', '1', '2', '3', '4', '5', '6'])
|
||||
f2.add_argument('--fleet_formation_2', default=default('--fleet_formation_2'), choices=['Line Ahead', 'Double Line', 'Diamond'])
|
||||
f2.add_argument('--fleet_step_2', default=default('--fleet_step_2'), choices=['1', '2', '3', '4', '5', '6'], help='In event map, fleet has limit on moving, so fleet_step is how far can a fleet goes in one operation, if map cleared, it will be ignored')
|
||||
|
||||
f3 = fleet.add_argument_group('Alternate Mob Fleet')
|
||||
f3.add_argument('--fleet_index_3', default=default('--fleet_index_3'), choices=['1', '2', '3', '4', '5', '6'])
|
||||
f3.add_argument('--fleet_index_3', default=default('--fleet_index_3'), choices=['do_not_use', '1', '2', '3', '4', '5', '6'])
|
||||
f3.add_argument('--fleet_formation_3', default=default('--fleet_formation_3'), choices=['Line Ahead', 'Double Line', 'Diamond'])
|
||||
f3.add_argument('--fleet_step_3', default=default('--fleet_step_3'), choices=['1', '2', '3', '4', '5', '6'], help='In event map, fleet has limit on moving, so fleet_step is how far can a fleet goes in one operation, if map cleared, it will be ignored')
|
||||
|
||||
@ -314,7 +318,7 @@ def main(ini_name=''):
|
||||
# ==========event_daily_ab==========
|
||||
event_ab_parser = subs.add_parser('event_daily_bonus')
|
||||
event_name = event_ab_parser.add_argument_group('Choose an event', 'bonus for first clear each day')
|
||||
event_name.add_argument('--event_name_ab', default=default('--event_name_ab'), choices=event_folder, help='There a dropdown menu with many options')
|
||||
event_name.add_argument('--event_name_ab', default=event_latest, choices=event_folder, help='There a dropdown menu with many options')
|
||||
# event_name.add_argument('--enable_hard_bonus', default=default('--enable_hard_bonus'), choices=['yes', 'no'], help='Will enable Daily bonus for Event hard maps') # Trying implement all event maps
|
||||
|
||||
# ==========main==========
|
||||
@ -337,7 +341,7 @@ def main(ini_name=''):
|
||||
event.add_argument('--sp_stage', default=default('--sp_stage'),
|
||||
choices=['sp1', 'sp2', 'sp3'],
|
||||
help='E.g sp3')
|
||||
event.add_argument('--event_name', default=default('--event_name'), choices=event_folder, help='There a dropdown menu with many options')
|
||||
event.add_argument('--event_name', default=event_latest, choices=event_folder, help='There a dropdown menu with many options')
|
||||
|
||||
# ==========半自动==========
|
||||
semi_parser = subs.add_parser('semi_auto')
|
||||
|
@ -419,7 +419,7 @@ class AzurLaneConfig:
|
||||
self.ENABLE_FLEET_CONTROL = to_bool(option['enable_fleet_control'])
|
||||
self.ENABLE_MAP_FLEET_LOCK = to_bool(option['enable_map_fleet_lock'])
|
||||
for n in ['1', '2', '3']:
|
||||
self.__setattr__(f'FLEET_{n}', int(option[f'fleet_index_{n}']))
|
||||
self.__setattr__(f'FLEET_{n}', int(option[f'fleet_index_{n}']) if to_bool(option[f'fleet_index_{n}']) else 0)
|
||||
self.__setattr__(f'FLEET_{n}_FORMATION', int(option[f'fleet_formation_{n}'].split('_')[1]))
|
||||
self.__setattr__(f'FLEET_{n}_STEP', int(option[f'fleet_step_{n}']))
|
||||
self.COMBAT_AUTO_MODE = option['combat_auto_mode']
|
||||
|
@ -387,6 +387,7 @@ dic_chi_to_eng = {
|
||||
'复刻苍红的回响': 'event_20200423_cn',
|
||||
'夜幕下的归途': 'event_20200507_cn',
|
||||
'穹顶下的圣咏曲': 'event_20200521_cn',
|
||||
'峡湾间的反击': 'event_20200603_cn',
|
||||
}
|
||||
|
||||
dic_eng_to_chi = {v: k for k, v in dic_chi_to_eng.items()}
|
||||
|
@ -22,7 +22,8 @@ IN_MAP = Button(area={'cn': (749, 654, 921, 707), 'en': (748, 652, 922, 702)}, c
|
||||
IN_STAGE = Button(area={'cn': (122, 16, 172, 39), 'en': (120, 18, 208, 40)}, color={'cn': (149, 167, 207), 'en': (104, 118, 157)}, button={'cn': (122, 16, 172, 39), 'en': (120, 18, 208, 40)}, file={'cn': './assets/cn/handler/IN_STAGE.png', 'en': './assets/en/handler/IN_STAGE.png'})
|
||||
LOGIN_ANNOUNCE = Button(area={'cn': (1160, 45, 1227, 90), 'en': (1159, 44, 1228, 91)}, color={'cn': (174, 61, 56), 'en': (193, 79, 73)}, button={'cn': (1160, 45, 1227, 90), 'en': (1159, 44, 1228, 91)}, file={'cn': './assets/cn/handler/LOGIN_ANNOUNCE.png', 'en': './assets/en/handler/LOGIN_ANNOUNCE.png'})
|
||||
LOGIN_CHECK = Button(area={'cn': (77, 655, 154, 711), 'en': (77, 655, 154, 711)}, color={'cn': (33, 36, 33), 'en': (33, 36, 33)}, button={'cn': (416, 294, 534, 400), 'en': (416, 294, 534, 400)}, file={'cn': './assets/cn/handler/LOGIN_CHECK.png', 'en': './assets/en/handler/LOGIN_CHECK.png'})
|
||||
LOGIN_GAME_UPDATE = Button(area={'cn': (700, 471, 873, 529), 'en': (699, 470, 874, 530)}, color={'cn': (238, 170, 78), 'en': (236, 167, 74)}, button={'cn': (700, 471, 873, 529), 'en': (699, 470, 874, 530)}, file={'cn': './assets/cn/handler/LOGIN_GAME_UPDATE.png', 'en': './assets/en/handler/LOGIN_GAME_UPDATE.png'})
|
||||
LOGIN_CONFIRM = Button(area={'cn': (464, 372, 814, 426), 'en': (464, 372, 814, 426)}, color={'cn': (39, 174, 229), 'en': (39, 174, 229)}, button={'cn': (464, 372, 814, 426), 'en': (464, 372, 814, 426)}, file={'cn': './assets/cn/handler/LOGIN_CONFIRM.png', 'en': './assets/en/handler/LOGIN_CONFIRM.png'})
|
||||
LOGIN_GAME_UPDATE = Button(area={'cn': (700, 471, 873, 529), 'en': (700, 471, 873, 529)}, color={'cn': (238, 170, 78), 'en': (238, 170, 78)}, button={'cn': (700, 471, 873, 529), 'en': (700, 471, 873, 529)}, file={'cn': './assets/cn/handler/LOGIN_GAME_UPDATE.png', 'en': './assets/en/handler/LOGIN_GAME_UPDATE.png'})
|
||||
LOGIN_RETURN_SIGN = Button(area={'cn': (1, 7, 104, 47), 'en': (1195, 524, 1272, 547)}, color={'cn': (158, 214, 229), 'en': (202, 202, 203)}, button={'cn': (1, 7, 104, 47), 'en': (1195, 524, 1272, 547)}, file={'cn': './assets/cn/handler/LOGIN_RETURN_SIGN.png', 'en': './assets/en/handler/LOGIN_RETURN_SIGN.png'})
|
||||
MAP_AIR_RAID = Button(area={'cn': (350, 447, 1280, 472), 'en': (350, 447, 1280, 472)}, color={'cn': (154, 43, 46), 'en': (154, 43, 46)}, button={'cn': (350, 447, 1280, 472), 'en': (350, 447, 1280, 472)}, file={'cn': './assets/cn/handler/MAP_AIR_RAID.png', 'en': './assets/en/handler/MAP_AIR_RAID.png'})
|
||||
MAP_AMBUSH = Button(area={'cn': (261, 433, 1280, 449), 'en': (261, 433, 1280, 449)}, color={'cn': (161, 41, 43), 'en': (161, 41, 43)}, button={'cn': (261, 433, 1280, 449), 'en': (261, 433, 1280, 449)}, file={'cn': './assets/cn/handler/MAP_AMBUSH.png', 'en': './assets/en/handler/MAP_AMBUSH.png'})
|
||||
|
@ -26,6 +26,8 @@ class LoginHandler(Combat):
|
||||
continue
|
||||
if self.appear_then_click(LOGIN_RETURN_SIGN, offset=(30, 30), interval=1):
|
||||
continue
|
||||
if self.appear_then_click(LOGIN_CONFIRM, offset=(30, 30), interval=1):
|
||||
continue
|
||||
|
||||
if self.info_bar_count() and self.appear_then_click(LOGIN_CHECK, interval=0.5):
|
||||
logger.info('Login success')
|
||||
|
@ -50,11 +50,18 @@ class Fleet(Camera, MapOperation, AmbushHandler):
|
||||
|
||||
@property
|
||||
def fleet_boss(self):
|
||||
if self.config.FLEET_BOSS == 2 and self.config.FLEET_2:
|
||||
if self.config.FLEET_BOSS == 2 or self.config.FLEET_2:
|
||||
return self.fleet_2
|
||||
else:
|
||||
return self.fleet_1
|
||||
|
||||
@property
|
||||
def fleet_boss_index(self):
|
||||
if self.config.FLEET_BOSS == 2 or self.config.FLEET_2:
|
||||
return 1
|
||||
else:
|
||||
return 1
|
||||
|
||||
@property
|
||||
def fleet_step(self):
|
||||
if not self.config.MAP_HAS_FLEET_STEP:
|
||||
@ -84,6 +91,7 @@ class Fleet(Camera, MapOperation, AmbushHandler):
|
||||
location (tuple, str, GridInfo): Destination.
|
||||
"""
|
||||
location = location_ensure(location)
|
||||
siren_count = self.map.select(is_siren=True).count
|
||||
result_mystery = ''
|
||||
|
||||
while 1:
|
||||
@ -99,7 +107,7 @@ class Fleet(Camera, MapOperation, AmbushHandler):
|
||||
self.device.click(grid)
|
||||
arrived = False
|
||||
# Wait to confirm fleet arrived. It does't appear immediately if fleet in combat .
|
||||
add = self.config.MAP_SIREN_MOVE_WAIT * self.config.MAP_SIREN_COUNT \
|
||||
add = self.config.MAP_SIREN_MOVE_WAIT * min(self.config.MAP_SIREN_COUNT, siren_count) \
|
||||
if self.config.MAP_HAS_MOVABLE_ENEMY and not self.config.ENABLE_FAST_FORWARD else 0
|
||||
arrive_timer = Timer(0.3 + add)
|
||||
arrive_unexpected_timer = Timer(1.5 + add)
|
||||
@ -409,13 +417,18 @@ class Fleet(Camera, MapOperation, AmbushHandler):
|
||||
"""
|
||||
Args:
|
||||
grid (Grid):
|
||||
fleet (int): 1, 2
|
||||
fleet (int, str): 1, 2, 'boss'
|
||||
|
||||
Returns:
|
||||
bool: If accessible.
|
||||
"""
|
||||
if fleet is None:
|
||||
return grid.is_accessible
|
||||
if isinstance(fleet, str) and fleet.isdigit():
|
||||
fleet = int(fleet)
|
||||
if fleet == 'boss':
|
||||
fleet = self.fleet_boss_index
|
||||
|
||||
if fleet == self.fleet_current_index:
|
||||
return grid.is_accessible
|
||||
else:
|
||||
|
@ -27,5 +27,8 @@ TEMPLATE_SIREN_Algerie = Template(file={'cn': './assets/cn/template/TEMPLATE_SIR
|
||||
TEMPLATE_SIREN_DD = Template(file={'cn': './assets/cn/template/TEMPLATE_SIREN_DD.png', 'en': './assets/en/template/TEMPLATE_SIREN_DD.png'})
|
||||
TEMPLATE_SIREN_LaGalissonniere = Template(file={'cn': './assets/cn/template/TEMPLATE_SIREN_LaGalissonniere.png', 'en': './assets/en/template/TEMPLATE_SIREN_LaGalissonniere.png'})
|
||||
TEMPLATE_SIREN_Vauquelin = Template(file={'cn': './assets/cn/template/TEMPLATE_SIREN_Vauquelin.png', 'en': './assets/en/template/TEMPLATE_SIREN_Vauquelin.png'})
|
||||
TEMPLATE_SIREN_Z18 = Template(file={'cn': './assets/cn/template/TEMPLATE_SIREN_Z18.png', 'en': './assets/cn/template/TEMPLATE_SIREN_Z18.png'})
|
||||
TEMPLATE_SIREN_Z19 = Template(file={'cn': './assets/cn/template/TEMPLATE_SIREN_Z19.png', 'en': './assets/cn/template/TEMPLATE_SIREN_Z19.png'})
|
||||
TEMPLATE_SIREN_Z2 = Template(file={'cn': './assets/cn/template/TEMPLATE_SIREN_Z2.png', 'en': './assets/cn/template/TEMPLATE_SIREN_Z2.png'})
|
||||
TEMPLATE_STAGE_CLEAR = Template(file={'cn': './assets/cn/template/TEMPLATE_STAGE_CLEAR.png', 'en': './assets/en/template/TEMPLATE_STAGE_CLEAR.png'})
|
||||
TEMPLATE_STAGE_PERCENT = Template(file={'cn': './assets/cn/template/TEMPLATE_STAGE_PERCENT.png', 'en': './assets/en/template/TEMPLATE_STAGE_PERCENT.png'})
|
||||
|