Compare commits
1 Commits
4e2e4572c3
...
logger_unl
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
678aba2807 |
8
.github/pull.yml
vendored
@@ -1,8 +0,0 @@
|
|||||||
version: "1"
|
|
||||||
rules:
|
|
||||||
- base: master
|
|
||||||
upstream: LmeSzinc:master
|
|
||||||
mergeMethod: merge
|
|
||||||
mergeUnstable: true
|
|
||||||
label: ":arrow_heading_down: pull"
|
|
||||||
conflictLabel: "merge-conflict": true
|
|
||||||
33
.github/workflows/main.yml
vendored
@@ -1,33 +0,0 @@
|
|||||||
name: Upstream Sync
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
|
|
||||||
on:
|
|
||||||
schedule:
|
|
||||||
- cron: "0 * * * *"
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
sync_with_upstream:
|
|
||||||
name: Sync with Upstream
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout target repo
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Sync Upstream
|
|
||||||
uses: aormsby/Fork-Sync-With-Upstream-action@v3.4
|
|
||||||
with:
|
|
||||||
target_repo_token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
upstream_sync_repo: LmeSzinc/AzurLaneAutoScript
|
|
||||||
upstream_sync_branch: master
|
|
||||||
target_sync_branch: master
|
|
||||||
test_mode: false
|
|
||||||
|
|
||||||
- name: Check for Failure
|
|
||||||
if: failure()
|
|
||||||
run: |
|
|
||||||
echo "[Error] Due to a change in the workflow file of the upstream repository, GitHub has automatically suspended the scheduled automatic update. You need to manually sync your fork."
|
|
||||||
exit 1
|
|
||||||
@@ -177,3 +177,4 @@ Alas 仍在活跃开发中,我们会不定期发布未来的工作在 [Issues]
|
|||||||
- QQ 八群:[938081688](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=3h8Gl323WkIt6yGx8Jx5Ht93puZxeA8T&authKey=xPT6kPm7W9jWO2TNzPdohJ27l1njxorwKmkDrbwwYGGA6Oni1xQSJhHsRIJ8w7GZ&noverify=0&group_code=938081688)
|
- QQ 八群:[938081688](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=3h8Gl323WkIt6yGx8Jx5Ht93puZxeA8T&authKey=xPT6kPm7W9jWO2TNzPdohJ27l1njxorwKmkDrbwwYGGA6Oni1xQSJhHsRIJ8w7GZ&noverify=0&group_code=938081688)
|
||||||
- QQ 一群:[1087735381](https://jq.qq.com/?_wv=1027&k=I4NSqX7g) (有开发意向请加一群,入群需要提供你的Github用户名)
|
- QQ 一群:[1087735381](https://jq.qq.com/?_wv=1027&k=I4NSqX7g) (有开发意向请加一群,入群需要提供你的Github用户名)
|
||||||
- Bilibili 直播间:https://live.bilibili.com/22216705 ,偶尔直播写Alas,~~为了拯救Alas,Lme决定出道成为偶像~~
|
- Bilibili 直播间:https://live.bilibili.com/22216705 ,偶尔直播写Alas,~~为了拯救Alas,Lme决定出道成为偶像~~
|
||||||
|
|
||||||
|
|||||||
49
alas.py
@@ -14,8 +14,6 @@ from module.exception import *
|
|||||||
from module.logger import logger
|
from module.logger import logger
|
||||||
from module.notify import handle_notify
|
from module.notify import handle_notify
|
||||||
|
|
||||||
RESTART_SENSITIVE_TASKS = ['OpsiObscure', 'OpsiAbyssal', 'OpsiCrossMonth']
|
|
||||||
|
|
||||||
|
|
||||||
class AzurLaneAutoScript:
|
class AzurLaneAutoScript:
|
||||||
stop_event: threading.Event = None
|
stop_event: threading.Event = None
|
||||||
@@ -50,9 +48,6 @@ class AzurLaneAutoScript:
|
|||||||
except RequestHumanTakeover:
|
except RequestHumanTakeover:
|
||||||
logger.critical('Request human takeover')
|
logger.critical('Request human takeover')
|
||||||
exit(1)
|
exit(1)
|
||||||
except EmulatorNotRunningError:
|
|
||||||
logger.critical('EmulatorNotRunningError')
|
|
||||||
exit(1)
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.exception(e)
|
logger.exception(e)
|
||||||
exit(1)
|
exit(1)
|
||||||
@@ -101,10 +96,12 @@ class AzurLaneAutoScript:
|
|||||||
if self.checker.is_available():
|
if self.checker.is_available():
|
||||||
logger.critical('Game page unknown')
|
logger.critical('Game page unknown')
|
||||||
self.save_error_log()
|
self.save_error_log()
|
||||||
logger.warning('Restart to reset Game page in 10 seconds')
|
handle_notify(
|
||||||
self.config.task_call('Restart')
|
self.config.Error_OnePushConfig,
|
||||||
self.device.sleep(10)
|
title=f"Alas <{self.config_name}> crashed",
|
||||||
return False
|
content=f"<{self.config_name}> GamePageUnknownError",
|
||||||
|
)
|
||||||
|
exit(1)
|
||||||
else:
|
else:
|
||||||
self.checker.wait_until_available()
|
self.checker.wait_until_available()
|
||||||
return False
|
return False
|
||||||
@@ -244,10 +241,6 @@ class AzurLaneAutoScript:
|
|||||||
from module.private_quarters.private_quarters import PrivateQuarters
|
from module.private_quarters.private_quarters import PrivateQuarters
|
||||||
PrivateQuarters(config=self.config, device=self.device).run()
|
PrivateQuarters(config=self.config, device=self.device).run()
|
||||||
|
|
||||||
def island(self):
|
|
||||||
from module.island.island import Island
|
|
||||||
Island(config=self.config, device=self.device).run()
|
|
||||||
|
|
||||||
def daily(self):
|
def daily(self):
|
||||||
from module.daily.daily import Daily
|
from module.daily.daily import Daily
|
||||||
Daily(config=self.config, device=self.device).run()
|
Daily(config=self.config, device=self.device).run()
|
||||||
@@ -386,10 +379,6 @@ class AzurLaneAutoScript:
|
|||||||
from module.event_hospital.hospital import Hospital
|
from module.event_hospital.hospital import Hospital
|
||||||
Hospital(config=self.config, device=self.device).run()
|
Hospital(config=self.config, device=self.device).run()
|
||||||
|
|
||||||
def hospital_event(self):
|
|
||||||
from module.event_hospital.hospital_event import HospitalEvent
|
|
||||||
HospitalEvent(config=self.config, device=self.device).run()
|
|
||||||
|
|
||||||
def coalition(self):
|
def coalition(self):
|
||||||
from module.coalition.coalition import Coalition
|
from module.coalition.coalition import Coalition
|
||||||
Coalition(config=self.config, device=self.device).run()
|
Coalition(config=self.config, device=self.device).run()
|
||||||
@@ -430,14 +419,6 @@ class AzurLaneAutoScript:
|
|||||||
from module.eventstory.eventstory import EventStory
|
from module.eventstory.eventstory import EventStory
|
||||||
EventStory(config=self.config, device=self.device, task="EventStory").run()
|
EventStory(config=self.config, device=self.device, task="EventStory").run()
|
||||||
|
|
||||||
def box_disassemble(self):
|
|
||||||
from module.storage.box_disassemble import StorageBox
|
|
||||||
StorageBox(config=self.config, device=self.device, task="BoxDisassemble").run()
|
|
||||||
|
|
||||||
def island_pearl(self):
|
|
||||||
from module.island.pearl_daemon import IslandPearl
|
|
||||||
IslandPearl(config=self.config, device=self.device, task="IslandPearl").run()
|
|
||||||
|
|
||||||
def azur_lane_uncensored(self):
|
def azur_lane_uncensored(self):
|
||||||
from module.daemon.uncensored import AzurLaneUncensored
|
from module.daemon.uncensored import AzurLaneUncensored
|
||||||
AzurLaneUncensored(config=self.config, device=self.device, task="AzurLaneUncensored").run()
|
AzurLaneUncensored(config=self.config, device=self.device, task="AzurLaneUncensored").run()
|
||||||
@@ -560,12 +541,8 @@ class AzurLaneAutoScript:
|
|||||||
_ = self.device
|
_ = self.device
|
||||||
self.device.config = self.config
|
self.device.config = self.config
|
||||||
# Skip first restart
|
# Skip first restart
|
||||||
if task == 'Restart':
|
if self.is_first_task and task == 'Restart':
|
||||||
if self.is_first_task:
|
logger.info('Skip task `Restart` at scheduler start')
|
||||||
logger.info('Skip task `Restart` at scheduler start')
|
|
||||||
else:
|
|
||||||
from module.handler.login import LoginHandler
|
|
||||||
LoginHandler(self.config, self.device).app_restart()
|
|
||||||
self.config.task_delay(server_update=True)
|
self.config.task_delay(server_update=True)
|
||||||
del_cached_property(self, 'config')
|
del_cached_property(self, 'config')
|
||||||
continue
|
continue
|
||||||
@@ -583,21 +560,17 @@ class AzurLaneAutoScript:
|
|||||||
failed = deep_get(self.failure_record, keys=task, default=0)
|
failed = deep_get(self.failure_record, keys=task, default=0)
|
||||||
failed = 0 if success else failed + 1
|
failed = 0 if success else failed + 1
|
||||||
deep_set(self.failure_record, keys=task, value=failed)
|
deep_set(self.failure_record, keys=task, value=failed)
|
||||||
if failed >= 3 or (self.config.Error_StrictRestart and failed >= 1 and task in RESTART_SENSITIVE_TASKS):
|
if failed >= 3:
|
||||||
logger.critical(f"Task `{task}` failed {failed} or more times.")
|
logger.critical(f"Task `{task}` failed 3 or more times.")
|
||||||
logger.critical("Possible reason #1: You haven't used it correctly. "
|
logger.critical("Possible reason #1: You haven't used it correctly. "
|
||||||
"Please read the help text of the options.")
|
"Please read the help text of the options.")
|
||||||
logger.critical("Possible reason #2: There is a problem with this task. "
|
logger.critical("Possible reason #2: There is a problem with this task. "
|
||||||
"Please contact developers or try to fix it yourself.")
|
"Please contact developers or try to fix it yourself.")
|
||||||
if self.config.Error_StrictRestart and task in RESTART_SENSITIVE_TASKS:
|
|
||||||
logger.critical("Possible reason #3: This is a restart sensitive task. "
|
|
||||||
"Please take over the game manually or turn off 'StrictRestart' option.")
|
|
||||||
logger.critical('Request human takeover')
|
logger.critical('Request human takeover')
|
||||||
|
|
||||||
handle_notify(
|
handle_notify(
|
||||||
self.config.Error_OnePushConfig,
|
self.config.Error_OnePushConfig,
|
||||||
title=f"Alas <{self.config_name}> crashed",
|
title=f"Alas <{self.config_name}> crashed",
|
||||||
content=f"<{self.config_name}> RequestHumanTakeover\nTask `{task}` failed {failed} or more times.",
|
content=f"<{self.config_name}> RequestHumanTakeover\nTask `{task}` failed 3 or more times.",
|
||||||
)
|
)
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 6.7 KiB |
|
Before Width: | Height: | Size: 5.9 KiB |
|
Before Width: | Height: | Size: 6.6 KiB |
|
Before Width: | Height: | Size: 7.9 KiB After Width: | Height: | Size: 8.9 KiB |
|
Before Width: | Height: | Size: 3.4 KiB |
|
Before Width: | Height: | Size: 3.6 KiB |
|
Before Width: | Height: | Size: 7.1 KiB |
|
Before Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 8.8 KiB |
|
Before Width: | Height: | Size: 9.0 KiB |
|
Before Width: | Height: | Size: 9.3 KiB |
|
Before Width: | Height: | Size: 7.9 KiB |
|
Before Width: | Height: | Size: 8.5 KiB |
|
Before Width: | Height: | Size: 8.4 KiB |
|
Before Width: | Height: | Size: 8.4 KiB |
|
Before Width: | Height: | Size: 9.1 KiB |
|
Before Width: | Height: | Size: 9.0 KiB |
|
Before Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 8.7 KiB |
|
Before Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 8.1 KiB |
|
Before Width: | Height: | Size: 7.3 KiB |
|
Before Width: | Height: | Size: 8.3 KiB |
|
Before Width: | Height: | Size: 7.0 KiB |
|
Before Width: | Height: | Size: 7.5 KiB |
|
Before Width: | Height: | Size: 7.1 KiB |
|
Before Width: | Height: | Size: 7.2 KiB |
|
Before Width: | Height: | Size: 7.3 KiB |
|
Before Width: | Height: | Size: 5.2 KiB |
|
Before Width: | Height: | Size: 5.3 KiB |
|
Before Width: | Height: | Size: 5.1 KiB |
|
Before Width: | Height: | Size: 6.9 KiB |
|
Before Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 9.5 KiB |
|
Before Width: | Height: | Size: 9.1 KiB |
|
Before Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 9.1 KiB |
|
Before Width: | Height: | Size: 7.8 KiB |
|
Before Width: | Height: | Size: 7.8 KiB |
|
Before Width: | Height: | Size: 8.9 KiB |
|
Before Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 6.9 KiB |
|
Before Width: | Height: | Size: 3.4 KiB |
|
Before Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 3.9 KiB |
|
Before Width: | Height: | Size: 5.2 KiB |
|
Before Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 3.9 KiB |
|
Before Width: | Height: | Size: 3.6 KiB |
|
Before Width: | Height: | Size: 5.0 KiB |
|
Before Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 3.2 KiB |
|
Before Width: | Height: | Size: 154 KiB |
|
Before Width: | Height: | Size: 9.0 KiB |
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 7.1 KiB |
|
Before Width: | Height: | Size: 4.9 KiB |
|
Before Width: | Height: | Size: 4.0 KiB |
|
Before Width: | Height: | Size: 3.6 KiB |
|
Before Width: | Height: | Size: 6.4 KiB |
|
Before Width: | Height: | Size: 4.9 KiB |
|
Before Width: | Height: | Size: 4.9 KiB |
|
Before Width: | Height: | Size: 8.9 KiB |
|
Before Width: | Height: | Size: 4.1 KiB |
|
Before Width: | Height: | Size: 4.0 KiB |
|
Before Width: | Height: | Size: 6.7 KiB |
|
Before Width: | Height: | Size: 7.5 KiB |
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 7.3 KiB |
|
Before Width: | Height: | Size: 7.5 KiB |
|
Before Width: | Height: | Size: 6.9 KiB |
|
Before Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 6.9 KiB |
|
Before Width: | Height: | Size: 3.8 KiB |
|
Before Width: | Height: | Size: 7.5 KiB |
|
Before Width: | Height: | Size: 7.5 KiB |
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 4.5 KiB |
|
Before Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 7.8 KiB |
|
Before Width: | Height: | Size: 3.5 KiB |
|
Before Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 8.6 KiB |
|
Before Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 7.6 KiB |
|
Before Width: | Height: | Size: 4.4 KiB |
|
Before Width: | Height: | Size: 4.4 KiB |
|
Before Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 6.0 KiB |
|
Before Width: | Height: | Size: 9.1 KiB |