mirror of
https://github.com/LmeSzinc/StarRailCopilot.git
synced 2024-11-23 00:52:22 +00:00
Add: Fleet settings check
- Delete option do_not_use in fleet_2 and fleet_3 - Exit if receive wrong settings
This commit is contained in:
parent
07db609ce2
commit
0206a6480d
1
alas.py
1
alas.py
@ -42,6 +42,7 @@ class AzurLaneAutoScript:
|
||||
print(f'{key} = {value}')
|
||||
|
||||
logger.hr('Settings saved')
|
||||
self.config.config_check()
|
||||
|
||||
def reward(self):
|
||||
for key, value in self.config.config['Reward'].items():
|
||||
|
@ -141,12 +141,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'])
|
||||
|
||||
|
@ -139,12 +139,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=['do_not_use', '1', '2', '3', '4', '5', '6'])
|
||||
f2.add_argument('--fleet_index_2', default=default('--fleet_index_2'), choices=['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=['do_not_use', '1', '2', '3', '4', '5', '6'])
|
||||
f3.add_argument('--fleet_index_3', default=default('--fleet_index_3'), choices=['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')
|
||||
|
||||
|
@ -375,6 +375,13 @@ class AzurLaneConfig:
|
||||
self.CONFIG_FILE = f'./config/{name}.ini'
|
||||
self.config.read_file(codecs.open(self.CONFIG_FILE, "r", "utf8"))
|
||||
self.load_from_config(self.config)
|
||||
self.config_check()
|
||||
|
||||
def config_check(self):
|
||||
if self.FLEET_1 == self.FLEET_2:
|
||||
logger.warning(f'Mob fleet [{self.FLEET_1}] and boss fleet [{self.FLEET_2}] is the same')
|
||||
logger.warning('They should to be set to different fleets')
|
||||
exit(1)
|
||||
|
||||
def save(self):
|
||||
self.config.write(codecs.open(self.CONFIG_FILE, "w+", "utf8"))
|
||||
|
@ -30,7 +30,7 @@ class UI(ModuleBase):
|
||||
logger.hr('UI click')
|
||||
if appear_button is None:
|
||||
appear_button = click_button
|
||||
click_timer = Timer(retry_wait, count=6)
|
||||
click_timer = Timer(retry_wait, count=retry_wait // 0.5)
|
||||
while 1:
|
||||
if skip_first_screenshot:
|
||||
skip_first_screenshot = False
|
||||
|
Loading…
Reference in New Issue
Block a user