1
0
mirror of https://gitee.com/sui-feng-cb/AzurLaneAutoScript1 synced 2026-03-25 06:52:50 +08:00

Fix: Configuration missing in MAA

This commit is contained in:
SarContDeli
2022-09-14 12:02:28 +08:00
parent f513f0fa91
commit 3c467a51b6
5 changed files with 58 additions and 4 deletions

View File

@@ -375,8 +375,10 @@ class AzurLaneAutoScript:
def wait_until(self, future): def wait_until(self, future):
""" """
Wait until a specific time. Wait until a specific time.
Args: Args:
future (datetime): future (datetime):
Returns: Returns:
bool: True if wait finished, False if config changed. bool: True if wait finished, False if config changed.
""" """

View File

@@ -46,6 +46,7 @@ def name_to_function(name):
""" """
Args: Args:
name (str): name (str):
Returns: Returns:
Function: Function:
""" """
@@ -318,6 +319,7 @@ class AzurLaneConfig(ConfigUpdater, ManualConfig, GeneratedConfig, ConfigWatcher
def multi_set(self): def multi_set(self):
""" """
Set multiple arguments but save once. Set multiple arguments but save once.
Examples: Examples:
with self.config.multi_set(): with self.config.multi_set():
self.config.foo1 = 1 self.config.foo1 = 1
@@ -327,10 +329,12 @@ class AzurLaneConfig(ConfigUpdater, ManualConfig, GeneratedConfig, ConfigWatcher
def cross_get(self, keys, default=None): def cross_get(self, keys, default=None):
""" """
Get configs from other tasks Get configs from other tasks.
Args: Args:
keys (str, list[str]): Such as `{task}.Scheduler.Enable` keys (str, list[str]): Such as `{task}.Scheduler.Enable`
default: default:
Returns: Returns:
Any: Any:
""" """
@@ -338,10 +342,12 @@ class AzurLaneConfig(ConfigUpdater, ManualConfig, GeneratedConfig, ConfigWatcher
def cross_set(self, keys, value): def cross_set(self, keys, value):
""" """
Set configs to other tasks Set configs to other tasks.
Args: Args:
keys (str, list[str]): Such as `{task}.Scheduler.Enable` keys (str, list[str]): Such as `{task}.Scheduler.Enable`
value (Any): value (Any):
Returns: Returns:
Any: Any:
""" """
@@ -354,6 +360,7 @@ class AzurLaneConfig(ConfigUpdater, ManualConfig, GeneratedConfig, ConfigWatcher
Set Scheduler.NextRun Set Scheduler.NextRun
Should set at least one arguments. Should set at least one arguments.
If multiple arguments are set, use the nearest. If multiple arguments are set, use the nearest.
Args: Args:
success (bool): success (bool):
If True, delay Scheduler.SuccessInterval If True, delay Scheduler.SuccessInterval
@@ -415,6 +422,7 @@ class AzurLaneConfig(ConfigUpdater, ManualConfig, GeneratedConfig, ConfigWatcher
def opsi_task_delay(self, recon_scan=False, submarine_call=False, ap_limit=False): def opsi_task_delay(self, recon_scan=False, submarine_call=False, ap_limit=False):
""" """
Delay the NextRun of all OpSi tasks. Delay the NextRun of all OpSi tasks.
Args: Args:
recon_scan (bool): True to delay all tasks requiring recon scan 27 min. recon_scan (bool): True to delay all tasks requiring recon scan 27 min.
submarine_call (bool): True to delay all tasks requiring submarine call 60 min. submarine_call (bool): True to delay all tasks requiring submarine call 60 min.
@@ -544,7 +552,7 @@ class AzurLaneConfig(ConfigUpdater, ManualConfig, GeneratedConfig, ConfigWatcher
@staticmethod @staticmethod
def task_stop(message=""): def task_stop(message=""):
""" """
Stop current task Stop current task.
Raises: Raises:
TaskEnd: TaskEnd:
@@ -577,7 +585,7 @@ class AzurLaneConfig(ConfigUpdater, ManualConfig, GeneratedConfig, ConfigWatcher
def check_task_switch(self, message=""): def check_task_switch(self, message=""):
""" """
Stop current task Stop current task when task switched.
Raises: Raises:
TaskEnd: TaskEnd:
@@ -605,6 +613,7 @@ class AzurLaneConfig(ConfigUpdater, ManualConfig, GeneratedConfig, ConfigWatcher
""" """
Args: Args:
other (AzurLaneConfig, Config): other (AzurLaneConfig, Config):
Returns: Returns:
AzurLaneConfig AzurLaneConfig
""" """
@@ -674,12 +683,15 @@ class AzurLaneConfig(ConfigUpdater, ManualConfig, GeneratedConfig, ConfigWatcher
def temporary(self, **kwargs): def temporary(self, **kwargs):
""" """
Cover some settings, and recover later. Cover some settings, and recover later.
Usage: Usage:
backup = self.config.cover(ENABLE_DAILY_REWARD=False) backup = self.config.cover(ENABLE_DAILY_REWARD=False)
# do_something() # do_something()
backup.recover() backup.recover()
Args: Args:
**kwargs: **kwargs:
Returns: Returns:
ConfigBackup: ConfigBackup:
""" """

View File

@@ -9,6 +9,16 @@
"MaaRecord": { "MaaRecord": {
"ReportToPenguin": false, "ReportToPenguin": false,
"PenguinID": null "PenguinID": null
},
"Emulator": {
"ServerName": "disabled"
},
"Error": {
"SaveError": false,
"OnePushConfig": "provider: null"
},
"Optimization": {
"WhenTaskQueueEmpty": "stay_there"
} }
}, },
"MaaStartup": { "MaaStartup": {

View File

@@ -38,6 +38,33 @@
"type": "input", "type": "input",
"value": null "value": null
} }
},
"Emulator": {
"ServerName": {
"type": "input",
"value": "disabled",
"display": "hide"
}
},
"Error": {
"SaveError": {
"type": "checkbox",
"value": false,
"display": "hide"
},
"OnePushConfig": {
"type": "input",
"value": "provider: null",
"mode": "yaml",
"display": "hide"
}
},
"Optimization": {
"WhenTaskQueueEmpty": {
"type": "input",
"value": "stay_there",
"display": "hide"
}
} }
}, },
"MaaStartup": { "MaaStartup": {

View File

@@ -7,6 +7,9 @@
Maa: Maa:
- MaaEmulator - MaaEmulator
- MaaRecord - MaaRecord
- Emulator
- Error
- Optimization
MaaStartup: MaaStartup:
- Scheduler - Scheduler