Opt: Move gui backend to port 22367 and clean up configs

This commit is contained in:
LmeSzinc 2023-06-17 16:32:45 +08:00
parent 4512aeffa7
commit b29d6fcc61
16 changed files with 19 additions and 63 deletions

View File

@ -1,8 +1,7 @@
Deploy: Deploy:
Git: Git:
# URL of AzurLaneAutoScript repository # URL of AzurLaneAutoScript repository
# [CN user] Use 'https://e.coding.net/llop18870/alas/AzurLaneAutoScript.git' for faster and more stable download # [Other] Use 'https://github.com/LmeSzinc/StarRailCopilot'
# [Other] Use 'https://github.com/LmeSzinc/AzurLaneAutoScript'
Repository: https://e.coding.net/llop18870/alas/AzurLaneAutoScript.git Repository: https://e.coding.net/llop18870/alas/AzurLaneAutoScript.git
# Branch of Alas # Branch of Alas
# [Developer] Use 'dev', 'app', etc, to try new features # [Developer] Use 'dev', 'app', etc, to try new features

View File

@ -1,9 +1,8 @@
Deploy: Deploy:
Git: Git:
# URL of AzurLaneAutoScript repository # URL of AzurLaneAutoScript repository
# [CN user] Use 'https://e.coding.net/llop18870/alas/AzurLaneAutoScript.git' for faster and more stable download # [Other] Use 'https://github.com/LmeSzinc/StarRailCopilot'
# [Other] Use 'https://github.com/LmeSzinc/AzurLaneAutoScript' Repository: https://github.com/LmeSzinc/StarRailCopilot
Repository: https://github.com/LmeSzinc/AzurLaneAutoScript
# Branch of Alas # Branch of Alas
# [Developer] Use 'dev', 'app', etc, to try new features # [Developer] Use 'dev', 'app', etc, to try new features
# [Other] Use 'master', the stable branch # [Other] Use 'master', the stable branch

View File

@ -5,7 +5,6 @@
"PackageName": "auto", "PackageName": "auto",
"ScreenshotMethod": "scrcpy", "ScreenshotMethod": "scrcpy",
"ControlMethod": "MaaTouch", "ControlMethod": "MaaTouch",
"ScreenshotDedithering": false,
"AdbRestart": false "AdbRestart": false
}, },
"EmulatorInfo": { "EmulatorInfo": {
@ -20,9 +19,8 @@
"OnePushConfig": "provider: null" "OnePushConfig": "provider: null"
}, },
"Optimization": { "Optimization": {
"ScreenshotInterval": 0.3, "ScreenshotInterval": 0.2,
"CombatScreenshotInterval": 1.0, "CombatScreenshotInterval": 1.0,
"TaskHoardingDuration": 0,
"WhenTaskQueueEmpty": "goto_main" "WhenTaskQueueEmpty": "goto_main"
}, },
"Storage": { "Storage": {

View File

@ -54,7 +54,7 @@ class ConfigModel:
# Webui # Webui
WebuiHost: str = "0.0.0.0" WebuiHost: str = "0.0.0.0"
WebuiPort: int = 22267 WebuiPort: int = 22367
Language: str = "en-US" Language: str = "en-US"
Theme: str = "default" Theme: str = "default"
DpiScaling: bool = True DpiScaling: bool = True

View File

@ -1,9 +1,8 @@
Deploy: Deploy:
Git: Git:
# URL of AzurLaneAutoScript repository # URL of AzurLaneAutoScript repository
# [CN user] Use 'https://e.coding.net/llop18870/alas/AzurLaneAutoScript.git' for faster and more stable download # [Other] Use 'https://github.com/LmeSzinc/StarRailCopilot'
# [Other] Use 'https://github.com/LmeSzinc/AzurLaneAutoScript' Repository: 'https://github.com/LmeSzinc/StarRailCopilot'
Repository: 'https://github.com/LmeSzinc/AzurLaneAutoScript'
# Branch of Alas # Branch of Alas
# [Developer] Use 'dev', 'app', etc, to try new features # [Developer] Use 'dev', 'app', etc, to try new features
# [Other] Use 'master', the stable branch # [Other] Use 'master', the stable branch

2
gui.py
View File

@ -49,7 +49,7 @@ def func(ev: threading.Event):
args, _ = parser.parse_known_args() args, _ = parser.parse_known_args()
host = args.host or State.deploy_config.WebuiHost or "0.0.0.0" host = args.host or State.deploy_config.WebuiHost or "0.0.0.0"
port = args.port or int(State.deploy_config.WebuiPort) or 22267 port = args.port or int(State.deploy_config.WebuiPort) or 22367
State.electron = args.electron State.electron = args.electron
logger.hr("Launcher config") logger.hr("Launcher config")

View File

@ -41,10 +41,6 @@
], ],
"display": "hide" "display": "hide"
}, },
"ScreenshotDedithering": {
"type": "checkbox",
"value": false
},
"AdbRestart": { "AdbRestart": {
"type": "checkbox", "type": "checkbox",
"value": false "value": false
@ -106,15 +102,13 @@
"Optimization": { "Optimization": {
"ScreenshotInterval": { "ScreenshotInterval": {
"type": "input", "type": "input",
"value": 0.3 "value": 0.2,
"display": "hide"
}, },
"CombatScreenshotInterval": { "CombatScreenshotInterval": {
"type": "input", "type": "input",
"value": 1.0 "value": 1.0,
}, "display": "hide"
"TaskHoardingDuration": {
"type": "input",
"value": 0
}, },
"WhenTaskQueueEmpty": { "WhenTaskQueueEmpty": {
"type": "select", "type": "select",

View File

@ -24,7 +24,6 @@ Emulator:
ControlMethod: ControlMethod:
value: MaaTouch value: MaaTouch
option: [ minitouch, MaaTouch ] option: [ minitouch, MaaTouch ]
ScreenshotDedithering: false
AdbRestart: false AdbRestart: false
EmulatorInfo: EmulatorInfo:
Emulator: Emulator:
@ -64,7 +63,6 @@ Error:
Optimization: Optimization:
ScreenshotInterval: 0.3 ScreenshotInterval: 0.3
CombatScreenshotInterval: 1.0 CombatScreenshotInterval: 1.0
TaskHoardingDuration: 0
WhenTaskQueueEmpty: WhenTaskQueueEmpty:
value: goto_main value: goto_main
option: [ stay_there, goto_main, close_game ] option: [ stay_there, goto_main, close_game ]

View File

@ -9,6 +9,9 @@ Alas:
Emulator: Emulator:
ScreenshotMethod: scrcpy ScreenshotMethod: scrcpy
ControlMethod: MaaTouch ControlMethod: MaaTouch
Optimization:
ScreenshotInterval: 0.2
CombatScreenshotInterval: 1.0
Restart: Restart:
Scheduler: Scheduler:
Enable: Enable:

View File

@ -20,7 +20,6 @@ class GeneratedConfig:
Emulator_PackageName = 'auto' # auto, com.miHoYo.hkrpg, com.HoYoverse.hkrpgoversea, com.miHoYo.hkrpg.bilibili Emulator_PackageName = 'auto' # auto, com.miHoYo.hkrpg, com.HoYoverse.hkrpgoversea, com.miHoYo.hkrpg.bilibili
Emulator_ScreenshotMethod = 'auto' # auto, ADB, ADB_nc, uiautomator2, aScreenCap, aScreenCap_nc, DroidCast, DroidCast_raw, scrcpy Emulator_ScreenshotMethod = 'auto' # auto, ADB, ADB_nc, uiautomator2, aScreenCap, aScreenCap_nc, DroidCast, DroidCast_raw, scrcpy
Emulator_ControlMethod = 'MaaTouch' # minitouch, MaaTouch Emulator_ControlMethod = 'MaaTouch' # minitouch, MaaTouch
Emulator_ScreenshotDedithering = False
Emulator_AdbRestart = False Emulator_AdbRestart = False
# Group `EmulatorInfo` # Group `EmulatorInfo`
@ -37,7 +36,6 @@ class GeneratedConfig:
# Group `Optimization` # Group `Optimization`
Optimization_ScreenshotInterval = 0.3 Optimization_ScreenshotInterval = 0.3
Optimization_CombatScreenshotInterval = 1.0 Optimization_CombatScreenshotInterval = 1.0
Optimization_TaskHoardingDuration = 0
Optimization_WhenTaskQueueEmpty = 'goto_main' # stay_there, goto_main, close_game Optimization_WhenTaskQueueEmpty = 'goto_main' # stay_there, goto_main, close_game
# Group `Storage` # Group `Storage`

View File

@ -77,10 +77,6 @@
"minitouch": "minitouch", "minitouch": "minitouch",
"MaaTouch": "MaaTouch" "MaaTouch": "MaaTouch"
}, },
"ScreenshotDedithering": {
"name": "Image Color De-dithering",
"help": "Enable when running Alas on phones"
},
"AdbRestart": { "AdbRestart": {
"name": "Try to restart adb when no device found", "name": "Try to restart adb when no device found",
"help": "" "help": ""
@ -155,10 +151,6 @@
"name": "Take Screenshots Every X Second(s) In Combat", "name": "Take Screenshots Every X Second(s) In Combat",
"help": "Minimum interval between 2 screenshots, limited in 0.1 ~ 1.0, can help reduce CPU during battle" "help": "Minimum interval between 2 screenshots, limited in 0.1 ~ 1.0, can help reduce CPU during battle"
}, },
"TaskHoardingDuration": {
"name": "Hoard Tasks For X Minute(s)",
"help": "By purposely not adding ready tasks to pending, allows for larger subsets to be built and run en masse at a later time\nCan reduce the frequency of operating AL"
},
"WhenTaskQueueEmpty": { "WhenTaskQueueEmpty": {
"name": "When Task Queue is Empty", "name": "When Task Queue is Empty",
"help": "Close AL when there are no pending tasks, can help reduce CPU", "help": "Close AL when there are no pending tasks, can help reduce CPU",

View File

@ -77,10 +77,6 @@
"minitouch": "minitouch", "minitouch": "minitouch",
"MaaTouch": "MaaTouch" "MaaTouch": "MaaTouch"
}, },
"ScreenshotDedithering": {
"name": "Emulator.ScreenshotDedithering.name",
"help": "Emulator.ScreenshotDedithering.help"
},
"AdbRestart": { "AdbRestart": {
"name": "Emulator.AdbRestart.name", "name": "Emulator.AdbRestart.name",
"help": "Emulator.AdbRestart.help" "help": "Emulator.AdbRestart.help"
@ -155,10 +151,6 @@
"name": "Optimization.CombatScreenshotInterval.name", "name": "Optimization.CombatScreenshotInterval.name",
"help": "Optimization.CombatScreenshotInterval.help" "help": "Optimization.CombatScreenshotInterval.help"
}, },
"TaskHoardingDuration": {
"name": "Optimization.TaskHoardingDuration.name",
"help": "Optimization.TaskHoardingDuration.help"
},
"WhenTaskQueueEmpty": { "WhenTaskQueueEmpty": {
"name": "Optimization.WhenTaskQueueEmpty.name", "name": "Optimization.WhenTaskQueueEmpty.name",
"help": "Optimization.WhenTaskQueueEmpty.help", "help": "Optimization.WhenTaskQueueEmpty.help",

View File

@ -77,10 +77,6 @@
"minitouch": "minitouch", "minitouch": "minitouch",
"MaaTouch": "MaaTouch" "MaaTouch": "MaaTouch"
}, },
"ScreenshotDedithering": {
"name": "去除图片色彩抖动",
"help": "在手机上运行时开启"
},
"AdbRestart": { "AdbRestart": {
"name": "在检测不到设备的时候尝试重启adb", "name": "在检测不到设备的时候尝试重启adb",
"help": "" "help": ""
@ -155,10 +151,6 @@
"name": "战斗中放慢截图速度至 X 秒一张", "name": "战斗中放慢截图速度至 X 秒一张",
"help": "执行两次截图之间的最小间隔,限制在 0.1 ~ 1.0,能降低战斗时的 CPU 占用" "help": "执行两次截图之间的最小间隔,限制在 0.1 ~ 1.0,能降低战斗时的 CPU 占用"
}, },
"TaskHoardingDuration": {
"name": "囤积任务 X 分钟",
"help": "能在收菜期间降低操作游戏的频率\n任务触发后等待 X 分钟,再一次性执行囤积的任务"
},
"WhenTaskQueueEmpty": { "WhenTaskQueueEmpty": {
"name": "当任务队列清空后", "name": "当任务队列清空后",
"help": "无任务时关闭游戏,能在收菜期间降低 CPU 占用", "help": "无任务时关闭游戏,能在收菜期间降低 CPU 占用",

View File

@ -77,10 +77,6 @@
"minitouch": "minitouch", "minitouch": "minitouch",
"MaaTouch": "MaaTouch" "MaaTouch": "MaaTouch"
}, },
"ScreenshotDedithering": {
"name": "去除圖片色彩抖動",
"help": "在手機上運行時開啟"
},
"AdbRestart": { "AdbRestart": {
"name": "在檢測不到設備的時候嘗試重啟adb", "name": "在檢測不到設備的時候嘗試重啟adb",
"help": "" "help": ""
@ -155,10 +151,6 @@
"name": "戰鬥中放慢截圖速度至 X 秒一張", "name": "戰鬥中放慢截圖速度至 X 秒一張",
"help": "執行兩次截圖之間的最小間隔,限制在 0.1 ~ 1.0,能降低戰鬥時的 CPU 佔用" "help": "執行兩次截圖之間的最小間隔,限制在 0.1 ~ 1.0,能降低戰鬥時的 CPU 佔用"
}, },
"TaskHoardingDuration": {
"name": "囤積任務 X 分鐘",
"help": "能在收穫期間降低操作遊戲的頻率\n任務觸發後等待 X 分鐘後,一次性執行佇列中的任務"
},
"WhenTaskQueueEmpty": { "WhenTaskQueueEmpty": {
"name": "當任務隊列清空後", "name": "當任務隊列清空後",
"help": "無任務時關閉遊戲,能在收菜期間降低 CPU 佔用", "help": "無任務時關閉遊戲,能在收菜期間降低 CPU 佔用",

View File

@ -55,9 +55,9 @@ class Screenshot(Adb, WSA, DroidCast, AScreenCap, Scrcpy):
) )
self.image = method() self.image = method()
if self.config.Emulator_ScreenshotDedithering: # if self.config.Emulator_ScreenshotDedithering:
# This will take 40-60ms # # This will take 40-60ms
cv2.fastNlMeansDenoising(self.image, self.image, h=17, templateWindowSize=1, searchWindowSize=2) # cv2.fastNlMeansDenoising(self.image, self.image, h=17, templateWindowSize=1, searchWindowSize=2)
self.image = self._handle_orientated_image(self.image) self.image = self._handle_orientated_image(self.image)
if self.config.Error_SaveError: if self.config.Error_SaveError:

View File

@ -41,7 +41,7 @@ def am_i_the_only_thread() -> bool:
def remote_access_service( def remote_access_service(
local_host="127.0.0.1", local_host="127.0.0.1",
local_port=22267, local_port=22367,
server="app.pywebio.online", server="app.pywebio.online",
server_port=1022, server_port=1022,
remote_port="/", remote_port="/",