Compare commits
1 Commits
dev
...
war_archiv
| Author | SHA1 | Date | |
|---|---|---|---|
| fd1b8adca3 |
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 一群:[1087735381](https://jq.qq.com/?_wv=1027&k=I4NSqX7g) (有开发意向请加一群,入群需要提供你的Github用户名)
|
||||
- Bilibili 直播间:https://live.bilibili.com/22216705 ,偶尔直播写Alas,~~为了拯救Alas,Lme决定出道成为偶像~~
|
||||
|
||||
|
||||
95
alas.py
@@ -14,8 +14,6 @@ from module.exception import *
|
||||
from module.logger import logger
|
||||
from module.notify import handle_notify
|
||||
|
||||
RESTART_SENSITIVE_TASKS = ['OpsiObscure', 'OpsiAbyssal', 'OpsiCrossMonth']
|
||||
|
||||
|
||||
class AzurLaneAutoScript:
|
||||
stop_event: threading.Event = None
|
||||
@@ -50,9 +48,6 @@ class AzurLaneAutoScript:
|
||||
except RequestHumanTakeover:
|
||||
logger.critical('Request human takeover')
|
||||
exit(1)
|
||||
except EmulatorNotRunningError:
|
||||
logger.critical('EmulatorNotRunningError')
|
||||
exit(1)
|
||||
except Exception as e:
|
||||
logger.exception(e)
|
||||
exit(1)
|
||||
@@ -87,20 +82,6 @@ class AzurLaneAutoScript:
|
||||
self.config.task_call('Restart')
|
||||
self.device.sleep(10)
|
||||
return False
|
||||
except EmulatorNetworkError as e:
|
||||
logger.error(e)
|
||||
self.save_error_log()
|
||||
if self.device.is_emulator:
|
||||
logger.info('Game update stuck 3 times. Checking network status on both ends.')
|
||||
self.checker.check_now()
|
||||
if self.checker.is_available() and not self.device.is_network_available():
|
||||
logger.critical('Emulator network is disconnected despite host being online.')
|
||||
logger.warning('Restarting emulator to fix internal network.')
|
||||
self.device.emulator_start()
|
||||
deep_set(self.failure_record, keys='Restart', value=1)
|
||||
self.config.task_call('Restart')
|
||||
self.device.sleep(10)
|
||||
return False
|
||||
except GameBugError as e:
|
||||
logger.warning(e)
|
||||
self.save_error_log()
|
||||
@@ -115,10 +96,12 @@ class AzurLaneAutoScript:
|
||||
if self.checker.is_available():
|
||||
logger.critical('Game page unknown')
|
||||
self.save_error_log()
|
||||
logger.warning('Restart to reset Game page in 10 seconds')
|
||||
self.config.task_call('Restart')
|
||||
self.device.sleep(10)
|
||||
return False
|
||||
handle_notify(
|
||||
self.config.Error_OnePushConfig,
|
||||
title=f"Alas <{self.config_name}> crashed",
|
||||
content=f"<{self.config_name}> GamePageUnknownError",
|
||||
)
|
||||
exit(1)
|
||||
else:
|
||||
self.checker.wait_until_available()
|
||||
return False
|
||||
@@ -238,10 +221,6 @@ class AzurLaneAutoScript:
|
||||
from module.shop.shop_reward import RewardShop
|
||||
RewardShop(config=self.config, device=self.device).run_once()
|
||||
|
||||
def event_shop(self):
|
||||
from module.shop_event.shop_event import EventShop
|
||||
EventShop(config=self.config, device=self.device).run()
|
||||
|
||||
def shipyard(self):
|
||||
from module.shipyard.shipyard_reward import RewardShipyard
|
||||
RewardShipyard(config=self.config, device=self.device).run()
|
||||
@@ -396,26 +375,14 @@ class AzurLaneAutoScript:
|
||||
from module.raid.run import RaidRun
|
||||
RaidRun(config=self.config, device=self.device).run()
|
||||
|
||||
def raid_scuttle(self):
|
||||
from module.raid.scuttle import RaidScuttleRun
|
||||
RaidScuttleRun(config=self.config, device=self.device).run()
|
||||
|
||||
def hospital(self):
|
||||
from module.event_hospital.hospital import Hospital
|
||||
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):
|
||||
from module.coalition.coalition import Coalition
|
||||
Coalition(config=self.config, device=self.device).run()
|
||||
|
||||
def coalition_scuttle(self):
|
||||
from module.coalition.scuttle import CoalitionScuttleRun
|
||||
CoalitionScuttleRun(config=self.config, device=self.device).run()
|
||||
|
||||
def coalition_sp(self):
|
||||
from module.coalition.coalition_sp import CoalitionSP
|
||||
CoalitionSP(config=self.config, device=self.device).run()
|
||||
@@ -440,30 +407,6 @@ class AzurLaneAutoScript:
|
||||
GemsFarming(config=self.config, device=self.device).run(
|
||||
name=self.config.Campaign_Name, folder=self.config.Campaign_Event, mode=self.config.Campaign_Mode)
|
||||
|
||||
def island_production(self):
|
||||
from module.island.production import IslandProduction
|
||||
IslandProduction(config=self.config, device=self.device).run()
|
||||
|
||||
def island_order(self):
|
||||
from module.island.order import IslandOrder
|
||||
IslandOrder(config=self.config, device=self.device).run()
|
||||
|
||||
def island_freebie(self):
|
||||
from module.island.freebie import IslandFreebie
|
||||
IslandFreebie(config=self.config, device=self.device).run()
|
||||
|
||||
def island_collect(self):
|
||||
from module.island.collect import IslandCollect
|
||||
IslandCollect(config=self.config, device=self.device).run()
|
||||
|
||||
def island_season_task(self):
|
||||
from module.island.season_task import IslandSeasonTask
|
||||
IslandSeasonTask(config=self.config, device=self.device).run()
|
||||
|
||||
def island_business(self):
|
||||
from module.island.business import IslandBusiness
|
||||
IslandBusiness(config=self.config, device=self.device).run()
|
||||
|
||||
def daemon(self):
|
||||
from module.daemon.daemon import AzurLaneDaemon
|
||||
AzurLaneDaemon(config=self.config, device=self.device, task="Daemon").run()
|
||||
@@ -476,14 +419,6 @@ class AzurLaneAutoScript:
|
||||
from module.eventstory.eventstory import EventStory
|
||||
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_production_planner(self):
|
||||
from module.island_handler.production_planner import IslandProductionPlanner
|
||||
IslandProductionPlanner(config=self.config, device=self.device, task="IslandProductionPlanner").run()
|
||||
|
||||
def azur_lane_uncensored(self):
|
||||
from module.daemon.uncensored import AzurLaneUncensored
|
||||
AzurLaneUncensored(config=self.config, device=self.device, task="AzurLaneUncensored").run()
|
||||
@@ -492,10 +427,6 @@ class AzurLaneAutoScript:
|
||||
from module.daemon.benchmark import run_benchmark
|
||||
run_benchmark(config=self.config)
|
||||
|
||||
def downtime_fetch(self):
|
||||
from module.smart_mgmt.downtime_fetch import run_downtime_fetch
|
||||
run_downtime_fetch(config=self.config)
|
||||
|
||||
def game_manager(self):
|
||||
from module.daemon.game_manager import GameManager
|
||||
GameManager(config=self.config, device=self.device, task="GameManager").run()
|
||||
@@ -610,7 +541,7 @@ class AzurLaneAutoScript:
|
||||
_ = self.device
|
||||
self.device.config = self.config
|
||||
# Skip first restart
|
||||
if task == 'Restart' and self.is_first_task:
|
||||
if self.is_first_task and task == 'Restart':
|
||||
logger.info('Skip task `Restart` at scheduler start')
|
||||
self.config.task_delay(server_update=True)
|
||||
del_cached_property(self, 'config')
|
||||
@@ -629,23 +560,17 @@ class AzurLaneAutoScript:
|
||||
failed = deep_get(self.failure_record, keys=task, default=0)
|
||||
failed = 0 if success else failed + 1
|
||||
deep_set(self.failure_record, keys=task, value=failed)
|
||||
should_restrict = (self.config.Error_RestrictRestart and task in RESTART_SENSITIVE_TASKS
|
||||
and (task == 'OpsiCrossMonth' or self.config.logger_used))
|
||||
if failed >= 3 or (failed >= 1 and should_restrict):
|
||||
logger.critical(f"Task `{task}` failed {failed} or more times.")
|
||||
if failed >= 3:
|
||||
logger.critical(f"Task `{task}` failed 3 or more times.")
|
||||
logger.critical("Possible reason #1: You haven't used it correctly. "
|
||||
"Please read the help text of the options.")
|
||||
logger.critical("Possible reason #2: There is a problem with this task. "
|
||||
"Please contact developers or try to fix it yourself.")
|
||||
if should_restrict:
|
||||
logger.critical("Possible reason #3: This is a restart sensitive task. "
|
||||
"Please take over the game manually or turn off 'RestrictRestart' option.")
|
||||
logger.critical('Request human takeover')
|
||||
|
||||
handle_notify(
|
||||
self.config.Error_OnePushConfig,
|
||||
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)
|
||||
|
||||
|
||||
|
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: 5.8 KiB |
|
Before Width: | Height: | Size: 5.6 KiB |
|
Before Width: | Height: | Size: 5.5 KiB |
|
Before Width: | Height: | Size: 9.4 KiB |
|
Before Width: | Height: | Size: 5.7 KiB |
|
Before Width: | Height: | Size: 6.8 KiB |
|
Before Width: | Height: | Size: 6.3 KiB |
|
Before Width: | Height: | Size: 5.8 KiB |
|
Before Width: | Height: | Size: 5.3 KiB |
|
Before Width: | Height: | Size: 5.5 KiB |
|
Before Width: | Height: | Size: 9.5 KiB |
|
Before Width: | Height: | Size: 9.7 KiB |
|
Before Width: | Height: | Size: 7.9 KiB After Width: | Height: | Size: 8.9 KiB |
|
Before Width: | Height: | Size: 3.8 KiB |
|
Before Width: | Height: | Size: 6.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.4 KiB |
|
Before Width: | Height: | Size: 8.7 KiB |
|
Before Width: | Height: | Size: 8.5 KiB |
|
Before Width: | Height: | Size: 8.1 KiB |
|
Before Width: | Height: | Size: 8.4 KiB |
|
Before Width: | Height: | Size: 8.4 KiB |
|
Before Width: | Height: | Size: 8.2 KiB |
|
Before Width: | Height: | Size: 8.3 KiB |
|
Before Width: | Height: | Size: 7.3 KiB After Width: | Height: | Size: 5.9 KiB |
|
Before Width: | Height: | Size: 7.5 KiB After Width: | Height: | Size: 5.2 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: 5.4 KiB After Width: | Height: | Size: 7.7 KiB |
|
Before Width: | Height: | Size: 5.6 KiB |
|
Before Width: | Height: | Size: 9.9 KiB |
|
Before Width: | Height: | Size: 7.2 KiB |
|
Before Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 6.9 KiB |
|
Before Width: | Height: | Size: 72 KiB |
|
Before Width: | Height: | Size: 60 KiB |
|
Before Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 34 KiB |
|
Before Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 8.1 KiB |
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 8.8 KiB |
|
Before Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 36 KiB |
|
Before Width: | Height: | Size: 9.2 KiB |
|
Before Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 7.6 KiB |
|
Before Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 7.7 KiB |
|
Before Width: | Height: | Size: 9.4 KiB |
|
Before Width: | Height: | Size: 7.4 KiB |
|
Before Width: | Height: | Size: 7.7 KiB |
|
Before Width: | Height: | Size: 9.6 KiB |
|
Before Width: | Height: | Size: 8.3 KiB |
|
Before Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 9.6 KiB |
|
Before Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 6.5 KiB |