2020-07-17 10:55:17 +08:00
import codecs
2020-08-19 07:48:14 +08:00
import sys
2020-07-17 10:55:17 +08:00
from gooey import Gooey , GooeyParser
import module . config . server as server
from alas import AzurLaneAutoScript
2020-08-19 07:48:14 +08:00
from module . config . dictionary import dic_event , dic_true_eng_to_eng
from module . config . update import get_config
from module . logger import pyw_name
from module . research . preset import DICT_FILTER_PRESET
2020-07-17 10:55:17 +08:00
2020-08-19 07:48:14 +08:00
try :
if sys . stdout . encoding != ' UTF-8 ' :
sys . stdout = codecs . getwriter ( ' utf-8 ' ) ( sys . stdout . buffer , ' strict ' )
if sys . stderr . encoding != ' UTF-8 ' :
sys . stderr = codecs . getwriter ( ' utf-8 ' ) ( sys . stderr . buffer , ' strict ' )
except Exception :
pass
2020-07-17 10:55:17 +08:00
@Gooey (
optional_cols = 2 ,
2020-08-19 07:48:14 +08:00
program_name = pyw_name . capitalize ( ) ,
image_dir = ' assets/gooey ' ,
language_dir = ' assets/gooey ' ,
2020-07-17 10:55:17 +08:00
sidebar_title = ' Function ' ,
terminal_font_family = ' Consolas ' ,
language = ' english ' ,
default_size = ( 1110 , 720 ) ,
navigation = ' SIDEBAR ' ,
tabbed_groups = True ,
show_success_modal = False ,
show_failure_modal = False ,
# show_stop_warning=False,
# load_build_config='gooey_config.json',
# dump_build_config='gooey_config.json',
2020-08-19 07:48:14 +08:00
richtext_controls = False , auto_start = False ,
menu = [ {
' name ' : ' File ' ,
' items ' : [ {
' type ' : ' AboutDialog ' ,
' menuTitle ' : ' About ' ,
' name ' : ' AzurLaneAutoScript ' ,
' description ' : ' Alas, an AzurLane automation tool with GUI (Support CN, EN, JP, able to support other servers). ' ,
' website ' : ' https://github.com/LmeSzinc/AzurLaneAutoScript '
} , {
' type ' : ' Link ' ,
' menuTitle ' : ' Visit our github repository ' ,
' url ' : ' https://github.com/LmeSzinc/AzurLaneAutoScript '
} ]
} , {
' name ' : ' Help ' ,
' items ' : [ {
' type ' : ' Link ' ,
' menuTitle ' : ' Wiki ' ,
' url ' : ' https://github.com/LmeSzinc/AzurLaneAutoScript/wiki '
} , {
' type ' : ' Link ' ,
' menuTitle ' : ' Github Token ' ,
' url ' : ' https://github.com/settings/tokens '
} ]
} ]
2020-07-17 10:55:17 +08:00
)
2020-08-19 07:48:14 +08:00
2020-07-17 10:55:17 +08:00
def main ( ini_name = ' ' ) :
if not ini_name :
ini_name = pyw_name
config_file = f ' ./config/ { ini_name } .ini '
2020-08-19 07:48:14 +08:00
config = get_config ( ini_name . lower ( ) )
# Load translation dictionary
dic_gui_to_ini = dic_true_eng_to_eng # GUI translation dictionary here.
dic_gui_to_ini . update ( dic_event [ server . server ] )
dic_ini_to_gui = { v : k for k , v in dic_gui_to_ini . items ( ) }
# Event list
event_folder = [ f for f in dic_event [ server . server ] . values ( ) if f . startswith ( ' event_ ' ) ]
2020-07-17 10:55:17 +08:00
event_latest = sorted ( [ f for f in event_folder ] , reverse = True ) [ 0 ]
2020-08-19 07:48:14 +08:00
event_folder = [ dic_ini_to_gui . get ( f , f ) for f in event_folder ] [ : : - 1 ]
event_latest = dic_ini_to_gui . get ( event_latest , event_latest )
# Raid list
raid_folder = [ f for f in dic_event [ server . server ] . values ( ) if f . startswith ( ' raid_ ' ) ]
raid_latest = sorted ( [ f for f in raid_folder ] , reverse = True ) [ 0 ]
raid_folder = [ dic_ini_to_gui . get ( f , f ) for f in raid_folder ] [ : : - 1 ]
raid_latest = dic_ini_to_gui . get ( raid_latest , raid_latest )
# Research preset list
research_preset = [ dic_ini_to_gui . get ( f , f ) for f in [ ' customized ' ] + list ( DICT_FILTER_PRESET . keys ( ) ) ]
# Translate settings in ini file
2020-07-17 10:55:17 +08:00
saved_config = { }
for opt , option in config . items ( ) :
for key , value in option . items ( ) :
2020-08-19 07:48:14 +08:00
key = dic_ini_to_gui . get ( key , key )
if value in dic_ini_to_gui :
value = dic_ini_to_gui . get ( value , value )
2020-07-17 10:55:17 +08:00
if value == ' None ' :
value = ' '
saved_config [ key ] = value
2020-08-19 07:48:14 +08:00
message = (
' BlueStacks: \t 127.0.0.1:5555 \n '
' NoxPlayer: \t 127.0.0.1:62001 \n '
' MuMuPlayer: \t 127.0.0.1:7555 \n '
' MemuPlayer: \t 127.0.0.1:21503 \n '
' LDPlayer: \t \t emulator-5554 \n '
)
2020-07-17 10:55:17 +08:00
def default ( name ) :
""" Get default value in .ini file.
Args :
name ( str ) : option , in chinese .
Returns :
str : Default value , in chinese .
"""
name = name . strip ( ' - ' )
return saved_config . get ( name , ' ' )
def choice_list ( total ) :
return [ str ( index ) for index in range ( 1 , total + 1 ) ]
# Don't use checkbox in gooey, use drop box instead.
# https://github.com/chriskiehl/Gooey/issues/148
# https://github.com/chriskiehl/Gooey/issues/485
2020-08-19 07:48:14 +08:00
parser = GooeyParser ( description = f ' AzurLaneAutoScript, An Azur Lane automation tool. Config: { config_file } \n Do not forget to Press start button to save your settings in each function that modifies ' )
2020-07-17 10:55:17 +08:00
subs = parser . add_subparsers ( help = ' commands ' , dest = ' command ' )
# ==========setting==========
setting_parser = subs . add_parser ( ' setting ' )
# 选择关卡
2020-08-19 07:48:14 +08:00
stage = setting_parser . add_argument_group ( ' Level settings ' , ' Need to Press start to save your settings. ' , gooey_options = { ' label_color ' : ' #931D03 ' } )
stage . add_argument ( ' --enable_stop_condition ' , default = default ( ' --enable_stop_condition ' ) , choices = [ ' yes ' , ' no ' ] , help = ' If enabled will start reward loop when triggered any filter below ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
stage . add_argument ( ' --enable_exception ' , default = default ( ' --enable_exception ' ) , choices = [ ' yes ' , ' no ' ] , help = ' Enable or disable some exceptions, ALAS will withdraw from the map when it occurs instead of stopping ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
stage . add_argument ( ' --enable_fast_forward ' , default = default ( ' --enable_fast_forward ' ) , choices = [ ' yes ' , ' no ' ] , help = ' Enable or disable clearing mode ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
stop = stage . add_argument_group ( ' Stop condition ' , ' After triggering, it will not stop immediately. It will complete the current attack first, Set 0 to disable ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
stop . add_argument ( ' --if_count_greater_than ' , default = default ( ' --if_count_greater_than ' ) , help = ' How many map completions \n until ALAS enter in Reward loop. ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
stop . add_argument ( ' --if_time_reach ' , default = default ( ' --if_time_reach ' ) , help = ' How many time in minutes run ALAS until stop \n . It is recommended about \n 10 minutes to complete the current attack. Format 14:59 ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
stop . add_argument ( ' --if_oil_lower_than ' , default = default ( ' --if_oil_lower_than ' ) , help = ' Will enter in reward loop when \n triggered Oil limit ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
stop . add_argument ( ' --if_map_reach ' , default = default ( ' --if_map_reach ' ) , choices = [ ' no ' , ' map_100 ' , ' map_3_star ' , ' map_green_without_3_star ' , ' map_green ' ] , help = ' If already reached, ignore this setting ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
stop . add_argument ( ' --if_trigger_emotion_control ' , default = default ( ' --if_trigger_emotion_control ' ) , choices = [ ' yes ' , ' no ' ] , help = ' Will enter in reward loop when \n triggered Mood limit ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
# stop.add_argument('--if_dock_full', default=default('--if_dock_full'), choices=['yes', 'no'])
2020-07-17 10:55:17 +08:00
# 出击舰队
2020-08-19 07:48:14 +08:00
fleet = setting_parser . add_argument_group ( ' Attack fleet ' , ' No support for alternate lane squadrons, inactive map or weekly mode will ignore the step setting ' , gooey_options = { ' label_color ' : ' #931D03 ' } )
fleet . add_argument ( ' --enable_fleet_control ' , default = default ( ' --enable_fleet_control ' ) , choices = [ ' yes ' , ' no ' ] , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
fleet . add_argument ( ' --enable_map_fleet_lock ' , default = default ( ' --enable_map_fleet_lock ' ) , choices = [ ' yes ' , ' no ' ] , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
f1 = fleet . add_argument_group ( ' Mob Fleet ' , ' Players can choose a formation before battle. Though it has no effect appearance-wise, the formations applies buffs to certain stats. \n Line Ahead: Increases Firepower and Torpedo by 15 % , but reduces Evasion by 10 % (Applies only to Vanguard fleet) \n Double Line: Increases Evasion by 30 % , but decreases Firepower and Torpedo by 5 % (Applies only to Vanguard fleet) \n Diamond: Increases Anti-Air by 20 % (no penalties, applies to entire fleet) ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
f1 . add_argument ( ' --fleet_index_1 ' , default = default ( ' --fleet_index_1 ' ) , choices = [ ' 1 ' , ' 2 ' , ' 3 ' , ' 4 ' , ' 5 ' , ' 6 ' ] , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
f1 . add_argument ( ' --fleet_formation_1 ' , default = default ( ' --fleet_formation_1 ' ) , choices = [ ' Line Ahead ' , ' Double Line ' , ' Diamond ' ] , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
f1 . add_argument ( ' --fleet_auto_mode_1 ' , default = default ( ' --fleet_auto_mode_1 ' ) , choices = [ ' combat_auto ' , ' combat_manual ' , ' stand_still_in_the_middle ' , ' hide_in_bottom_left ' ] , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
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 ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
f2 = fleet . add_argument_group ( ' Boss Fleet ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
f2 . add_argument ( ' --fleet_index_2 ' , default = default ( ' --fleet_index_2 ' ) , choices = [ ' 1 ' , ' 2 ' , ' 3 ' , ' 4 ' , ' 5 ' , ' 6 ' ] , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
f2 . add_argument ( ' --fleet_formation_2 ' , default = default ( ' --fleet_formation_2 ' ) , choices = [ ' Line Ahead ' , ' Double Line ' , ' Diamond ' ] , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
f2 . add_argument ( ' --fleet_auto_mode_2 ' , default = default ( ' --fleet_auto_mode_2 ' ) , choices = [ ' combat_auto ' , ' combat_manual ' , ' stand_still_in_the_middle ' , ' hide_in_bottom_left ' ] , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
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 ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
f3 = fleet . add_argument_group ( ' Alternate Mob Fleet ' , ' It hasnt been implemented yet ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
f3 . add_argument ( ' --fleet_index_3 ' , default = default ( ' --fleet_index_3 ' ) , choices = [ ' 1 ' , ' 2 ' , ' 3 ' , ' 4 ' , ' 5 ' , ' 6 ' ] , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
f3 . add_argument ( ' --fleet_formation_3 ' , default = default ( ' --fleet_formation_3 ' ) , choices = [ ' Line Ahead ' , ' Double Line ' , ' Diamond ' ] , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
f3 . add_argument ( ' --fleet_auto_mode_3 ' , default = default ( ' --fleet_auto_mode_3 ' ) , choices = [ ' combat_auto ' , ' combat_manual ' , ' stand_still_in_the_middle ' , ' hide_in_bottom_left ' ] , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
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 ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
2020-07-17 10:55:17 +08:00
# 潜艇设置
2020-08-19 07:48:14 +08:00
submarine = setting_parser . add_argument_group ( ' Submarine settings ' , ' Only supported: hunt_only, do_not_use and every_combat ' , gooey_options = { ' label_color ' : ' #931D03 ' } )
submarine . add_argument ( ' --fleet_index_4 ' , default = default ( ' --fleet_index_4 ' ) , choices = [ ' do_not_use ' , ' 1 ' , ' 2 ' ] , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
submarine . add_argument ( ' --submarine_mode ' , default = default ( ' --submarine_mode ' ) , choices = [ ' do_not_use ' , ' hunt_only ' , ' every_combat ' , ' when_no_ammo ' , ' when_boss_combat ' , ' when_boss_combat_boss_appear ' ] , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
2020-07-17 10:55:17 +08:00
# 心情控制
2020-08-19 07:48:14 +08:00
emotion = setting_parser . add_argument_group ( ' Mood control ' , gooey_options = { ' label_color ' : ' #931D03 ' } )
emotion . add_argument ( ' --enable_emotion_reduce ' , default = default ( ' --enable_emotion_reduce ' ) , help = ' Set No to disable MOOD control by ALAS ' , choices = [ ' yes ' , ' no ' ] , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
emotion . add_argument ( ' --ignore_low_emotion_warn ' , default = default ( ' --ignore_low_emotion_warn ' ) , choices = [ ' yes ' , ' no ' ] , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
2020-07-17 10:55:17 +08:00
2020-08-19 07:48:14 +08:00
e1 = emotion . add_argument_group ( ' Mob Fleet ' , ' Emotion limit: \n keep_high_emotion: 120 \n avoid_green_face: 40 \n avoid_yellow_face: 30 \n avoid_red_face: 2 ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
e1 . add_argument ( ' --emotion_recover_1 ' , default = default ( ' --emotion_recover_1 ' ) , choices = [ ' not_in_dormitory ' , ' dormitory_floor_1 ' , ' dormitory_floor_2 ' ] , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
e1 . add_argument ( ' --emotion_control_1 ' , default = default ( ' --emotion_control_1 ' ) , choices = [ ' keep_high_emotion ' , ' avoid_green_face ' , ' avoid_yellow_face ' , ' avoid_red_face ' ] , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
e1 . add_argument ( ' --hole_fleet_married_1 ' , default = default ( ' --hole_fleet_married_1 ' ) , choices = [ ' yes ' , ' no ' ] , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
2020-07-17 10:55:17 +08:00
2020-08-19 07:48:14 +08:00
e2 = emotion . add_argument_group ( ' BOSS Fleet ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
e2 . add_argument ( ' --emotion_recover_2 ' , default = default ( ' --emotion_recover_2 ' ) , choices = [ ' not_in_dormitory ' , ' dormitory_floor_1 ' , ' dormitory_floor_2 ' ] , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
e2 . add_argument ( ' --emotion_control_2 ' , default = default ( ' --emotion_control_2 ' ) , choices = [ ' keep_high_emotion ' , ' avoid_green_face ' , ' avoid_yellow_face ' , ' avoid_red_face ' ] , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
e2 . add_argument ( ' --hole_fleet_married_2 ' , default = default ( ' --hole_fleet_married_2 ' ) , choices = [ ' yes ' , ' no ' ] , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
2020-07-17 10:55:17 +08:00
2020-08-19 07:48:14 +08:00
e3 = emotion . add_argument_group ( ' Alternate Mob Fleet ' , ' Will be used when the first team triggers mood control ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
e3 . add_argument ( ' --emotion_recover_3 ' , default = default ( ' --emotion_recover_3 ' ) , choices = [ ' not_in_dormitory ' , ' dormitory_floor_1 ' , ' dormitory_floor_2 ' ] , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
e3 . add_argument ( ' --emotion_control_3 ' , default = default ( ' --emotion_control_3 ' ) , choices = [ ' keep_high_emotion ' , ' avoid_green_face ' , ' avoid_yellow_face ' , ' avoid_red_face ' ] , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
e3 . add_argument ( ' --hole_fleet_married_3 ' , default = default ( ' --hole_fleet_married_3 ' ) , choices = [ ' yes ' , ' no ' ] , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
2020-07-17 10:55:17 +08:00
# 血量平衡
2020-08-19 07:48:14 +08:00
hp = setting_parser . add_argument_group ( ' HP control ' , ' Fleet lock must be turned off to take effect ' , gooey_options = { ' label_color ' : ' #931D03 ' } )
hp . add_argument ( ' --enable_hp_balance ' , default = default ( ' --enable_hp_balance ' ) , choices = [ ' yes ' , ' no ' ] , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
hp . add_argument ( ' --enable_low_hp_withdraw ' , default = default ( ' --enable_low_hp_withdraw ' ) , choices = [ ' yes ' , ' no ' ] , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
hp_balance = hp . add_argument_group ( ' HP Balance ' , ' ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
hp_balance . add_argument ( ' --scout_hp_difference_threshold ' , default = default ( ' --scout_hp_difference_threshold ' ) , help = ' When the difference in HP volume is greater than the threshold, transpose ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
hp_balance . add_argument ( ' --scout_hp_weights ' , default = default ( ' --scout_hp_weights ' ) , help = ' Should be repaired when there is a difference in Vanguard, format 1000,1000,1000 ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
hp_add = hp . add_argument_group ( ' Emergency repair ' , ' ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
hp_add . add_argument ( ' --emergency_repair_single_threshold ' , default = default ( ' --emergency_repair_single_threshold ' ) , help = ' Used when single shipgirl is below the threshold ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
hp_add . add_argument ( ' --emergency_repair_hole_threshold ' , default = default ( ' --emergency_repair_hole_threshold ' ) , help = ' Used when all front rows or all back rows are below the threshold ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
hp_withdraw = hp . add_argument_group ( ' Low HP volume withdrawal ' , ' ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
hp_withdraw . add_argument ( ' --low_hp_withdraw_threshold ' , default = default ( ' --low_hp_withdraw_threshold ' ) , help = ' When HP is below the threshold, retreat ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
2020-07-17 10:55:17 +08:00
# 退役选项
2020-08-19 07:48:14 +08:00
retire = setting_parser . add_argument_group ( ' Retirement settings ' , ' ' , gooey_options = { ' label_color ' : ' #931D03 ' } )
retire . add_argument ( ' --enable_retirement ' , default = default ( ' --enable_retirement ' ) , choices = [ ' yes ' , ' no ' ] , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
retire . add_argument ( ' --retire_method ' , default = default ( ' --retire_method ' ) , choices = [ ' enhance ' , ' one_click_retire ' , ' old_retire ' ] , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
retire . add_argument ( ' --retire_amount ' , default = default ( ' --retire_amount ' ) , choices = [ ' retire_all ' , ' retire_10 ' ] , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
retire . add_argument ( ' --enhance_favourite ' , default = default ( ' --enhance_favourite ' ) , choices = [ ' yes ' , ' no ' ] , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
retire . add_argument ( ' --enhance_order_string ' , default = default ( ' --enhance_order_string ' ) , help = ' Use example format " cv > bb > ... " may omit a ship type category altogether to skip otherwise leave blank to use default enhance method ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
rarity = retire . add_argument_group ( ' Retirement rarity ' , ' The ship type selection is not supported yet. Ignore the following options when using one-key retirement ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
rarity . add_argument ( ' --retire_n ' , default = default ( ' --retire_n ' ) , choices = [ ' yes ' , ' no ' ] , help = ' N ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
rarity . add_argument ( ' --retire_r ' , default = default ( ' --retire_r ' ) , choices = [ ' yes ' , ' no ' ] , help = ' R ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
rarity . add_argument ( ' --retire_sr ' , default = default ( ' --retire_sr ' ) , choices = [ ' yes ' , ' no ' ] , help = ' SR ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
rarity . add_argument ( ' --retire_ssr ' , default = default ( ' --retire_ssr ' ) , choices = [ ' yes ' , ' no ' ] , help = ' SSR ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
2020-07-17 10:55:17 +08:00
# 掉落记录
2020-08-19 07:48:14 +08:00
drop = setting_parser . add_argument_group ( ' Drop record ' , ' Save screenshots of dropped items, which will slow down the click speed when settlement is enabled ' , gooey_options = { ' label_color ' : ' #931D03 ' } )
drop . add_argument ( ' --enable_drop_screenshot ' , default = default ( ' --enable_drop_screenshot ' ) , choices = [ ' yes ' , ' no ' ] , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
drop . add_argument ( ' --drop_screenshot_folder ' , default = default ( ' --drop_screenshot_folder ' ) , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
# clear = setting_parser.add_argument_group('Wasteland mode', 'Unopened maps will stop after completion. Opened maps will ignore options, and its done if you do not open up')
# clear.add_argument('--enable_map_clear_mode', default=default('--enable_map_clear_mode'), choices=['yes', 'no'])
# clear.add_argument('--clear_mode_stop_condition', default=default('--clear_mode_stop_condition'), choices=['map_100', 'map_3_star', 'map_green'])
# clear.add_argument('--map_star_clear_all', default=default('--map_star_clear_all'), choices=['index_1', 'index_2', 'index_3', 'do_not_use'], help='The first few stars are to destroy all enemy ships')
2020-07-17 10:55:17 +08:00
# ==========reward==========
reward_parser = subs . add_parser ( ' reward ' )
2020-08-19 07:48:14 +08:00
reward_condition = reward_parser . add_argument_group ( ' Triggering conditions ' , ' Need to Press start to save your settings, after running it will enter the on-hook vegetable collection mode ' , gooey_options = { ' label_color ' : ' #931D03 ' } )
reward_condition . add_argument ( ' --enable_reward ' , default = default ( ' --enable_reward ' ) ,
choices = [ ' yes ' , ' no ' ] , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
reward_condition . add_argument ( ' --reward_interval ' , default = default ( ' --reward_interval ' ) ,
help = ' How many minutes to trigger collection. Recommend to set a time range, such as " 10, 40 " ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
reward_condition . add_argument ( ' --reward_stop_game_during_interval ' ,
default = default ( ' --reward_stop_game_during_interval ' ) , choices = [ ' yes ' , ' no ' ] , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
reward_condition . add_argument ( ' --enable_daily_reward ' , default = default ( ' --enable_daily_reward ' ) , choices = [ ' yes ' , ' no ' ] ,
help = ' Run daily as a part of reward ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
reward_oil = reward_parser . add_argument_group ( ' Oil supplies ' , ' ' , gooey_options = { ' label_color ' : ' #931D03 ' } )
reward_oil . add_argument ( ' --enable_oil_reward ' , default = default ( ' --enable_oil_reward ' ) , choices = [ ' yes ' , ' no ' ] , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
reward_oil . add_argument ( ' --enable_coin_reward ' , default = default ( ' --enable_coin_reward ' ) , choices = [ ' yes ' , ' no ' ] , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
reward_mission = reward_parser . add_argument_group ( ' mission rewards ' , ' ' , gooey_options = { ' label_color ' : ' #931D03 ' } )
reward_mission . add_argument ( ' --enable_mission_reward ' , default = default ( ' --enable_mission_reward ' ) , choices = [ ' yes ' , ' no ' ] , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
reward_commission = reward_parser . add_argument_group ( ' Commission settings ' , ' ' , gooey_options = { ' label_color ' : ' #931D03 ' } )
reward_commission . add_argument ( ' --enable_commission_reward ' , default = default ( ' --enable_commission_reward ' ) , choices = [ ' yes ' , ' no ' ] , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
reward_commission . add_argument ( ' --commission_time_limit ' , default = default ( ' --commission_time_limit ' ) ,
help = ' Ignore orders whose completion time exceeds the limit, Format: 23:30. Fill in 0 if it is not needed ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
priority1 = reward_commission . add_argument_group ( ' Commission priority by time duration ' , ' ' , gooey_options = { ' label_color ' : ' #931D03 ' } )
priority1 . add_argument ( ' --duration_shorter_than_2 ' , default = default ( ' --duration_shorter_than_2 ' ) , help = ' ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
priority1 . add_argument ( ' --duration_longer_than_6 ' , default = default ( ' --duration_longer_than_6 ' ) , help = ' ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
priority1 . add_argument ( ' --expire_shorter_than_2 ' , default = default ( ' --expire_shorter_than_2 ' ) , help = ' ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
priority1 . add_argument ( ' --expire_longer_than_6 ' , default = default ( ' --expire_longer_than_6 ' ) , help = ' ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
priority2 = reward_commission . add_argument_group ( ' Daily Commission priority ' , ' ' , gooey_options = { ' label_color ' : ' #931D03 ' } )
priority2 . add_argument ( ' --daily_comm ' , default = default ( ' --daily_comm ' ) , help = ' Daily resource development, high-level tactical research and development ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
priority2 . add_argument ( ' --major_comm ' , default = default ( ' --major_comm ' ) , help = ' 1200 oil / 1000 oil commission ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
priority3 = reward_commission . add_argument_group ( ' Additional commission priority ' , ' ' , gooey_options = { ' label_color ' : ' #931D03 ' } )
priority3 . add_argument ( ' --extra_drill ' , default = default ( ' --extra_drill ' ) , help = ' Short-range Sailing Training, Coastal Defense Patrol ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
priority3 . add_argument ( ' --extra_part ' , default = default ( ' --extra_part ' ) , help = ' Small Merchant Escort, Forest Protection Commission ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
priority3 . add_argument ( ' --extra_cube ' , default = default ( ' --extra_cube ' ) , help = ' Fleet Exercise Ⅲ, Fleet Escort ExerciseFleet Exercise Ⅲ ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
priority3 . add_argument ( ' --extra_oil ' , default = default ( ' --extra_oil ' ) , help = ' Small-scale Oil Extraction, Large-scale Oil Extraction ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
priority3 . add_argument ( ' --extra_book ' , default = default ( ' --extra_book ' ) , help = ' Small Merchant Escort, Large Merchant Escort ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
priority4 = reward_commission . add_argument_group ( ' Urgent commission priority ' , ' ' , gooey_options = { ' label_color ' : ' #931D03 ' } )
priority4 . add_argument ( ' --urgent_drill ' , default = default ( ' --urgent_drill ' ) , help = ' Defend the transport troops, annihilate the enemy elite troops ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
priority4 . add_argument ( ' --urgent_part ' , default = default ( ' --urgent_part ' ) , help = ' Support Vila Vela Island, support terror Banner ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
priority4 . add_argument ( ' --urgent_cube ' , default = default ( ' --urgent_cube ' ) , help = ' Rescue merchant ship, enemy attack ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
priority4 . add_argument ( ' --urgent_book ' , default = default ( ' --urgent_book ' ) , help = ' Support Tuhaoer Island, support Moe Island ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
priority4 . add_argument ( ' --urgent_box ' , default = default ( ' --urgent_box ' ) , help = ' BIW Gear Transport, NYB Gear Transport ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
priority4 . add_argument ( ' --urgent_gem ' , default = default ( ' --urgent_gem ' ) , help = ' BIW VIP Escort, NYB VIP Escort ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
priority4 . add_argument ( ' --urgent_ship ' , default = default ( ' --urgent_ship ' ) , help = ' Small Launch Ceremony, Fleet Launch Ceremony, Alliance Launch Ceremony ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
reward_tactical = reward_parser . add_argument_group ( ' Classroom ' , ' Only support continuation of skill books, not new skills ' , gooey_options = { ' label_color ' : ' #931D03 ' } )
reward_tactical . add_argument ( ' --enable_tactical_reward ' , default = default ( ' --enable_tactical_reward ' ) ,
choices = [ ' yes ' , ' no ' ] , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
reward_tactical . add_argument ( ' --tactical_exp_first ' , default = default ( ' --tactical_exp_first ' ) ,
choices = [ ' yes ' , ' no ' ] , help = ' Choose Yes, give priority to the 150 % bonus \n Select No, give priority to the skills book with the same rarity ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
# reward_tactical.add_argument('--tactical_night_range', default=default('--tactical_night_range'), help='Format 23:30-06:30')
reward_tactical . add_argument ( ' --tactical_book_tier_max ' , default = default ( ' --tactical_book_tier_max ' ) ,
choices = [ ' 3 ' , ' 2 ' , ' 1 ' ] , help = ' Wich skill book will use first \n T3 is a gold book, T2 is a purple book, T1 is a blue book \n tier_max should greater than or equal to tier_min ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
reward_tactical . add_argument ( ' --tactical_book_tier_min ' , default = default ( ' --tactical_book_tier_min ' ) ,
choices = [ ' 3 ' , ' 2 ' , ' 1 ' ] , help = ' Minimal tier to choose. ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
# reward_tactical.add_argument('--tactical_book_tier_night', default=default('--tactical_book_tier_night'), choices=['3', '2', '1'])
# reward_tactical.add_argument('--tactical_exp_first_night', default=default('--tactical_exp_first_night'), choices=['yes', 'no'])
reward_tactical . add_argument ( ' --tactical_if_no_book_satisfied ' , default = default ( ' --tactical_if_no_book_satisfied ' ) ,
choices = [ ' cancel_tactical ' , ' use_the_first_book ' ] , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
reward_research = reward_parser . add_argument_group ( ' Research ' , ' If set research_filter_preset=customized, read https://github.com/LmeSzinc/AzurLaneAutoScript/wiki/filter_string_en first ' , gooey_options = { ' label_color ' : ' #931D03 ' } )
reward_research . add_argument ( ' --enable_research_reward ' , default = default ( ' --enable_research_reward ' ) , choices = [ ' yes ' , ' no ' ] , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
research_input = reward_research . add_argument_group ( ' Research input ' , ' ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
research_input . add_argument ( ' --research_use_cube ' , default = default ( ' --research_use_cube ' ) , choices = [ ' yes ' , ' no ' ] , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
research_input . add_argument ( ' --research_use_coin ' , default = default ( ' --research_use_coin ' ) , choices = [ ' yes ' , ' no ' ] , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
research_input . add_argument ( ' --research_use_part ' , default = default ( ' --research_use_part ' ) , choices = [ ' yes ' , ' no ' ] , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
research_output = reward_research . add_argument_group ( ' Research output ' , ' ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
research_output . add_argument ( ' --research_filter_preset ' , default = default ( ' --research_filter_preset ' ) ,
choices = research_preset , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
research_output . add_argument ( ' --research_filter_string ' , default = default ( ' --research_filter_string ' ) ,
help = ' Only if you are using custom preset. ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
reward_buy = reward_parser . add_argument_group ( ' Buy ' , ' If already bought, skip ' , gooey_options = { ' label_color ' : ' #931D03 ' } )
reward_buy . add_argument ( ' --buy_meowfficer ' , default = default ( ' --buy_meowfficer ' ) , help = ' From 0 to 15. If no need, fill 0. ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
2020-08-14 11:54:30 +08:00
2020-07-17 10:55:17 +08:00
# ==========emulator==========
emulator_parser = subs . add_parser ( ' emulator ' )
2020-08-19 07:48:14 +08:00
emulator = emulator_parser . add_argument_group ( ' Emulator ' , ' Need to Press start to save your settings, it will check whether the game is started \n If the game has not started, it will be started ' , gooey_options = { ' label_color ' : ' #931D03 ' } )
emulator . add_argument ( ' --serial ' , default = default ( ' --serial ' ) ,
help = ' ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
emulator . add_argument ( ' --package_name ' , default = ' com.YoStarEN.AzurLane ' , help = ' ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
emulator . add_argument (
' default_serial_list ' ,
default = message ,
widget = ' Textarea ' ,
help = " Some default SERIAL for most popular emulators, Only base values and may change according to the version you use " ,
gooey_options = {
' height ' : 150 ,
' show_help ' : True ,
' show_label ' : True ,
' readonly ' : True ,
' label_color ' : ' #4B5F83 '
}
)
debug = emulator_parser . add_argument_group ( ' Debug settings ' , ' ' , gooey_options = { ' label_color ' : ' #931D03 ' } )
debug . add_argument ( ' --enable_error_log_and_screenshot_save ' , default = default ( ' --enable_error_log_and_screenshot_save ' ) ,
choices = [ ' yes ' , ' no ' ] , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
debug . add_argument ( ' --enable_perspective_error_image_save ' , default = default ( ' --enable_perspective_error_image_save ' ) ,
choices = [ ' yes ' , ' no ' ] , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
adb = emulator_parser . add_argument_group ( ' ADB settings ' , ' ' , gooey_options = { ' label_color ' : ' #931D03 ' } )
adb . add_argument ( ' --device_screenshot_method ' , default = default ( ' --device_screenshot_method ' ) ,
choices = [ ' aScreenCap ' , ' uiautomator2 ' , ' ADB ' ] , help = ' Speed: aScreenCap >> uiautomator2 > ADB ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
adb . add_argument ( ' --device_control_method ' , default = default ( ' --device_control_method ' ) ,
choices = [ ' minitouch ' , ' uiautomator2 ' , ' ADB ' ] , help = ' Speed: minitouch >> uiautomator2 >> ADB ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
adb . add_argument ( ' --combat_screenshot_interval ' , default = default ( ' --combat_screenshot_interval ' ) ,
help = ' Slow down the screenshot speed during battle and reduce CPU ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
update = emulator_parser . add_argument_group ( ' ALAS Update Check ' , ' ' , gooey_options = { ' label_color ' : ' #931D03 ' } )
update . add_argument ( ' --enable_update_check ' , default = default ( ' --enable_update_check ' ) ,
choices = [ ' yes ' , ' no ' ] , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
update . add_argument ( ' --update_method ' , default = default ( ' --update_method ' ) ,
choices = [ ' api ' , ' web ' ] , help = ' ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
update . add_argument ( ' --github_token ' , default = default ( ' --github_token ' ) ,
help = ' To generate your token visit https://github.com/settings/tokens or Help menu above ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
update . add_argument ( ' --update_proxy ' , default = default ( ' --update_proxy ' ) ,
help = ' Local http or socks proxy, example: http://127.0.0.1:10809 ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
2020-07-17 10:55:17 +08:00
# ==========每日任务==========
daily_parser = subs . add_parser ( ' daily ' )
# 选择每日
2020-08-19 07:48:14 +08:00
daily = daily_parser . add_argument_group ( ' Choose daily ' , ' Daily tasks, exercises, difficulty charts ' , gooey_options = { ' label_color ' : ' #931D03 ' } )
daily . add_argument ( ' --enable_daily_mission ' , default = default ( ' --enable_daily_mission ' ) ,
help = ' If there are records on the day, skip ' , choices = [ ' yes ' , ' no ' ] , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
daily . add_argument ( ' --enable_hard_campaign ' , default = default ( ' --enable_hard_campaign ' ) ,
help = ' If there are records on the day, skip ' , choices = [ ' yes ' , ' no ' ] , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
daily . add_argument ( ' --enable_exercise ' , default = default ( ' --enable_exercise ' ) ,
help = ' If there is a record after refreshing, skip ' , choices = [ ' yes ' , ' no ' ] , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
daily . add_argument ( ' --enable_raid_daily ' , default = default ( ' --enable_raid_daily ' ) ,
help = ' If there is a record after refreshing, skip ' , choices = [ ' yes ' , ' no ' ] , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
daily . add_argument ( ' --enable_event_ab ' , default = default ( ' --enable_event_ab ' ) ,
help = ' If there is a record after refreshing, skip ' , choices = [ ' yes ' , ' no ' ] , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
daily . add_argument ( ' --enable_event_sp ' , default = default ( ' --enable_event_sp ' ) ,
help = ' If there is a record after refreshing, skip ' , choices = [ ' yes ' , ' no ' ] , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
2020-07-17 10:55:17 +08:00
# 每日设置
2020-08-19 07:48:14 +08:00
daily_task = daily_parser . add_argument_group ( ' Daily settings ' , ' Does not support submarine daily ' , gooey_options = { ' label_color ' : ' #931D03 ' } )
daily_task . add_argument ( ' --tactical_training ' , default = default ( ' --tactical_training ' ) ,
choices = [ ' daily_air ' , ' daily_gun ' , ' daily_torpedo ' ] , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
daily_task . add_argument ( ' --fierce_assault ' , default = default ( ' --fierce_assault ' ) ,
choices = [ ' high_level ' , ' medium_level ' , ' low_level ' , ' index_1 ' , ' index_2 ' , ' index_3 ' ] , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
daily_task . add_argument ( ' --escort_mission ' , default = default ( ' --escort_mission ' ) ,
choices = [ ' firepower_high_level ' , ' air_high_level ' , ' firepower_low_level ' , ' index_1 ' , ' index_2 ' , ' index_3 ' ] , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
daily_task . add_argument ( ' --advance_mission ' , default = default ( ' --advance_mission ' ) ,
choices = [ ' high_level ' , ' medium_level ' , ' low_level ' , ' index_1 ' , ' index_2 ' , ' index_3 ' ] , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
daily_task . add_argument ( ' --daily_fleet ' , default = default ( ' --daily_fleet ' ) ,
help = ' If use one fleet, fill in the index of the fleet, such as 5 \n If use different fleets in different daily, separate index with commas, order: Escort Mission, Advance Mission, Fierce Assault, Tactical Training, such as 5, 5, 5, 6 ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
daily_task . add_argument ( ' --daily_equipment ' , default = default ( ' --daily_equipment ' ) ,
help = ' Change equipment before playing, unload equipment after playing, do not need to fill in 0 \n comma, such as 3, 1, 0, 1, 1, 0 ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
2020-07-17 10:55:17 +08:00
# 困难设置
2020-08-19 07:48:14 +08:00
hard = daily_parser . add_argument_group ( ' Difficult setting ' , ' Need to turn on weekly mode ' , gooey_options = { ' label_color ' : ' #931D03 ' } )
hard . add_argument ( ' --hard_campaign ' , default = default ( ' --hard_campaign ' ) ,
help = ' For example 10-4 ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
hard . add_argument ( ' --hard_fleet ' , default = default ( ' --hard_fleet ' ) ,
choices = [ ' 1 ' , ' 2 ' ] , help = ' For 10-2 hard, Set Fleet 2 ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
hard . add_argument ( ' --hard_equipment ' , default = default ( ' --hard_equipment ' ) ,
help = ' Change equipment before playing, unload equipment after playing, do not need to fill in 0 \n comma, such as 3, 1, 0, 1, 1, 0 ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
2020-07-17 10:55:17 +08:00
# 演习设置
2020-08-19 07:48:14 +08:00
exercise = daily_parser . add_argument_group ( ' Exercise settings ' , ' ' , gooey_options = { ' label_color ' : ' #931D03 ' } )
exercise . add_argument ( ' --exercise_choose_mode ' , default = default ( ' --exercise_choose_mode ' ) ,
choices = [ ' max_exp ' , ' easiest ' , ' easiest_else_exp ' ] , help = ' ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
exercise . add_argument ( ' --exercise_preserve ' , default = default ( ' --exercise_preserve ' ) ,
help = ' Only 0 are temporarily reserved ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
exercise . add_argument ( ' --exercise_try ' , default = default ( ' --exercise_try ' ) , help = ' The number of attempts by each opponent ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
exercise . add_argument ( ' --exercise_hp_threshold ' , default = default ( ' --exercise_hp_threshold ' ) ,
help = ' HHP <Retreat at Threshold ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
exercise . add_argument ( ' --exercise_low_hp_confirm ' , default = default ( ' --exercise_low_hp_confirm ' ) ,
help = ' After HP is below the threshold, it will retreat after a certain period of time \n Recommended 1.0 ~ 3.0 ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
exercise . add_argument ( ' --exercise_equipment ' , default = default ( ' --exercise_equipment ' ) ,
help = ' Change equipment before playing, unload equipment after playing, do not need to fill in 0 \n comma, such as 3, 1, 0, 1, 1, 0 ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
# event_daily_ab
event_bonus = daily_parser . add_argument_group ( ' Event Daily Bonus ' , ' bonus for first clear each day ' , gooey_options = { ' label_color ' : ' #931D03 ' } )
event_bonus . add_argument ( ' --event_ab_chapter ' , default = default ( ' --event_ab_chapter ' ) , choices = [ ' chapter_ab ' , ' chapter_abcd ' ] ,
help = ' Chapter with PT bonus ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
event_bonus . add_argument ( ' --event_sp_mob_fleet ' , default = default ( ' --event_sp_mob_fleet ' ) , choices = [ ' 1 ' , ' 2 ' ] ,
help = ' ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
event_bonus . add_argument ( ' --event_name_ab ' , default = event_latest , choices = event_folder ,
help = ' There a dropdown menu with many options ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
# Raid daily
raid_bonus = daily_parser . add_argument_group ( ' Raid settings ' , ' ' , gooey_options = { ' label_color ' : ' #931D03 ' } )
raid_bonus . add_argument ( ' --raid_daily_name ' , default = raid_latest , choices = raid_folder , help = ' ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
raid_bonus . add_argument ( ' --raid_hard ' , default = default ( ' --raid_hard ' ) , choices = [ ' yes ' , ' no ' ] , help = ' ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
raid_bonus . add_argument ( ' --raid_normal ' , default = default ( ' --raid_normal ' ) , choices = [ ' yes ' , ' no ' ] , help = ' ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
raid_bonus . add_argument ( ' --raid_easy ' , default = default ( ' --raid_easy ' ) , choices = [ ' yes ' , ' no ' ] , help = ' ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
2020-07-17 10:55:17 +08:00
# ==========event_daily_ab==========
2020-08-19 07:48:14 +08:00
# 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=event_latest, choices=event_folder, help='There a dropdown menu with many options')
2020-07-17 10:55:17 +08:00
# 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==========
main_parser = subs . add_parser ( ' Main_campaign ' )
# 选择关卡
2020-08-19 07:48:14 +08:00
stage = main_parser . add_argument_group ( ' Choose a level ' ,
' Main campaign, Currently, not all maps are being supported, check the folder /doc/development_en.md to know how add new maps ' ,
gooey_options = { ' label_color ' : ' #931D03 ' } )
stage . add_argument ( ' --main_stage ' , default = default ( ' --main_stage ' ) , help = ' E.g 7-2 ' ,
gooey_options = { ' label_color ' : ' #4B5F83 ' } )
stage . add_argument ( ' --campaign_mode ' , default = default ( ' --campaign_mode ' ) , help = ' Useful if you want to clear a hard mode map ' ,
choices = [ ' normal ' , ' hard ' ] , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
2020-07-17 10:55:17 +08:00
# ==========event==========
event_parser = subs . add_parser ( ' event ' )
description = """
2020-08-19 07:48:14 +08:00
2020-07-17 10:55:17 +08:00
"""
event = event_parser . add_argument_group (
2020-08-19 07:48:14 +08:00
' Choose a level ' , ' \n ' . join ( [ line . strip ( ) for line in description . strip ( ) . split ( ' \n ' ) ] ) , gooey_options = { ' label_color ' : ' #931D03 ' } )
2020-09-17 21:43:10 +08:00
event . add_argument ( ' --event_stage ' , default = default ( ' --event_stage ' ) , help = ' E.g D3 ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
2020-08-19 07:48:14 +08:00
event . add_argument ( ' --event_name ' , default = event_latest , choices = event_folder , help = ' There a dropdown menu with many options ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
# ==========Raid==========
raid_parser = subs . add_parser ( ' raid ' )
raid = raid_parser . add_argument_group ( ' Choose a raid ' , ' ' , gooey_options = { ' label_color ' : ' #931D03 ' } )
raid . add_argument ( ' --raid_name ' , default = raid_latest , choices = raid_folder , help = ' ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
raid . add_argument ( ' --raid_mode ' , default = default ( ' --raid_mode ' ) , choices = [ ' hard ' , ' normal ' , ' easy ' ] , help = ' ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
raid . add_argument ( ' --raid_use_ticket ' , default = default ( ' --raid_use_ticket ' ) , choices = [ ' yes ' , ' no ' ] , help = ' ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
2020-07-17 10:55:17 +08:00
# ==========半自动==========
semi_parser = subs . add_parser ( ' semi_auto ' )
2020-08-19 07:48:14 +08:00
semi = semi_parser . add_argument_group ( ' Semi-automatic mode ' , ' Manual selection of enemies, automatic settlement, used to attack unsuited pictures ' , gooey_options = { ' label_color ' : ' #931D03 ' } )
semi . add_argument ( ' --enable_semi_map_preparation ' , default = default ( ' --enable_semi_map_preparation ' ) , help = ' ' ,
choices = [ ' yes ' , ' no ' ] , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
semi . add_argument ( ' --enable_semi_story_skip ' , default = default ( ' --enable_semi_story_skip ' ) , help = ' Note that this will automatically confirm all the prompt boxes, including the red face attack ' ,
choices = [ ' yes ' , ' no ' ] , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
# ==========c11_affinity_farming==========
c_1_1_parser = subs . add_parser ( ' c1-1_affinity_farming ' )
c_1_1 = c_1_1_parser . add_argument_group ( ' c1-1_affinity_farming ' , ' Will auto turn off clearing mode \n With MVP, 8 battle to 1 affnity. Without MVP, 16 battle to 1 affnity. ' ,
gooey_options = { ' label_color ' : ' #931D03 ' } )
c_1_1 . add_argument ( ' --affinity_battle_count ' , default = default ( ' --affinity_battle_count ' ) , help = ' Example: 32 ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
2020-08-14 08:05:26 +08:00
2020-07-17 10:55:17 +08:00
# ==========c72_mystery_farming==========
c_7_2_parser = subs . add_parser ( ' c7-2_mystery_farming ' )
2020-08-19 07:48:14 +08:00
c_7_2 = c_7_2_parser . add_argument_group ( ' c7-2_mystery_farming ' , ' ' , gooey_options = { ' label_color ' : ' #931D03 ' } )
c_7_2 . add_argument ( ' --boss_fleet_step_on_a3 ' , default = default ( ' --boss_fleet_step_on_a3 ' ) ,
choices = [ ' yes ' , ' no ' ] , help = ' A3 has enemies, G3, C3, E3 ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
2020-07-17 10:55:17 +08:00
# ==========c122_leveling==========
c_12_2_parser = subs . add_parser ( ' c12-2_leveling ' )
2020-08-19 07:48:14 +08:00
c_12_2 = c_12_2_parser . add_argument_group ( ' 12-2 enemy search settings ' , ' ' , gooey_options = { ' label_color ' : ' #931D03 ' } )
c_12_2 . add_argument ( ' --s3_enemy_tolerance ' , default = default ( ' --s3_enemy_tolerance ' ) ,
choices = [ ' 0 ' , ' 1 ' , ' 2 ' , ' 10 ' ] , help = ' The maximum number of battles to fight against large enemies ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
2020-07-17 10:55:17 +08:00
# ==========c124_leveling==========
c_12_4_parser = subs . add_parser ( ' c12-4_leveling ' )
2020-08-19 07:48:14 +08:00
c_12_4 = c_12_4_parser . add_argument_group ( ' 12-4 Search enemy settings ' , ' Need to ensure that the team has a certain strength ' , gooey_options = { ' label_color ' : ' #931D03 ' } )
c_12_4 . add_argument ( ' --non_s3_enemy_enter_tolerance ' , default = default ( ' --non_s3_enemy_enter_tolerance ' ) ,
choices = [ ' 0 ' , ' 1 ' , ' 2 ' ] , help = ' Avoid enemy too strong ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
c_12_4 . add_argument ( ' --non_s3_enemy_withdraw_tolerance ' , default = default ( ' --non_s3_enemy_withdraw_tolerance ' ) ,
choices = [ ' 0 ' , ' 1 ' , ' 2 ' , ' 10 ' ] , help = ' How many battles will be fought after there is no large scale enemy ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
c_12_4 . add_argument ( ' --ammo_pick_up_124 ' , default = default ( ' --ammo_pick_up_124 ' ) ,
choices = [ ' 2 ' , ' 3 ' , ' 4 ' , ' 5 ' ] , help = ' How many battles before pick ammo, the recommended is 3 ' , gooey_options = { ' label_color ' : ' #4B5F83 ' } )
2020-07-17 10:55:17 +08:00
args = parser . parse_args ( )
# Convert option from chinese to english.
out = { }
for key , value in vars ( args ) . items ( ) :
2020-08-19 07:48:14 +08:00
key = dic_gui_to_ini . get ( key , key )
value = dic_gui_to_ini . get ( value , value )
2020-07-17 10:55:17 +08:00
out [ key ] = value
args = out
# Update option to .ini file.
command = args [ ' command ' ] . capitalize ( )
config [ ' Command ' ] [ ' command ' ] = command
for key , value in args . items ( ) :
config [ command ] [ key ] = str ( value )
config . write ( codecs . open ( config_file , " w+ " , " utf8 " ) )
# Call AzurLaneAutoScript
alas = AzurLaneAutoScript ( ini_name = ini_name )
alas . run ( command = command )