mirror of
https://github.com/LmeSzinc/StarRailCopilot.git
synced 2024-11-21 16:28:17 +00:00
Opt: Move gui backend to port 22367 and clean up configs
This commit is contained in:
parent
4512aeffa7
commit
b29d6fcc61
@ -1,8 +1,7 @@
|
||||
Deploy:
|
||||
Git:
|
||||
# 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/AzurLaneAutoScript'
|
||||
# [Other] Use 'https://github.com/LmeSzinc/StarRailCopilot'
|
||||
Repository: https://e.coding.net/llop18870/alas/AzurLaneAutoScript.git
|
||||
# Branch of Alas
|
||||
# [Developer] Use 'dev', 'app', etc, to try new features
|
||||
|
@ -1,9 +1,8 @@
|
||||
Deploy:
|
||||
Git:
|
||||
# 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/AzurLaneAutoScript'
|
||||
Repository: https://github.com/LmeSzinc/AzurLaneAutoScript
|
||||
# [Other] Use 'https://github.com/LmeSzinc/StarRailCopilot'
|
||||
Repository: https://github.com/LmeSzinc/StarRailCopilot
|
||||
# Branch of Alas
|
||||
# [Developer] Use 'dev', 'app', etc, to try new features
|
||||
# [Other] Use 'master', the stable branch
|
||||
|
@ -5,7 +5,6 @@
|
||||
"PackageName": "auto",
|
||||
"ScreenshotMethod": "scrcpy",
|
||||
"ControlMethod": "MaaTouch",
|
||||
"ScreenshotDedithering": false,
|
||||
"AdbRestart": false
|
||||
},
|
||||
"EmulatorInfo": {
|
||||
@ -20,9 +19,8 @@
|
||||
"OnePushConfig": "provider: null"
|
||||
},
|
||||
"Optimization": {
|
||||
"ScreenshotInterval": 0.3,
|
||||
"ScreenshotInterval": 0.2,
|
||||
"CombatScreenshotInterval": 1.0,
|
||||
"TaskHoardingDuration": 0,
|
||||
"WhenTaskQueueEmpty": "goto_main"
|
||||
},
|
||||
"Storage": {
|
||||
|
@ -54,7 +54,7 @@ class ConfigModel:
|
||||
|
||||
# Webui
|
||||
WebuiHost: str = "0.0.0.0"
|
||||
WebuiPort: int = 22267
|
||||
WebuiPort: int = 22367
|
||||
Language: str = "en-US"
|
||||
Theme: str = "default"
|
||||
DpiScaling: bool = True
|
||||
|
@ -1,9 +1,8 @@
|
||||
Deploy:
|
||||
Git:
|
||||
# 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/AzurLaneAutoScript'
|
||||
Repository: 'https://github.com/LmeSzinc/AzurLaneAutoScript'
|
||||
# [Other] Use 'https://github.com/LmeSzinc/StarRailCopilot'
|
||||
Repository: 'https://github.com/LmeSzinc/StarRailCopilot'
|
||||
# Branch of Alas
|
||||
# [Developer] Use 'dev', 'app', etc, to try new features
|
||||
# [Other] Use 'master', the stable branch
|
||||
|
2
gui.py
2
gui.py
@ -49,7 +49,7 @@ def func(ev: threading.Event):
|
||||
args, _ = parser.parse_known_args()
|
||||
|
||||
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
|
||||
|
||||
logger.hr("Launcher config")
|
||||
|
@ -41,10 +41,6 @@
|
||||
],
|
||||
"display": "hide"
|
||||
},
|
||||
"ScreenshotDedithering": {
|
||||
"type": "checkbox",
|
||||
"value": false
|
||||
},
|
||||
"AdbRestart": {
|
||||
"type": "checkbox",
|
||||
"value": false
|
||||
@ -106,15 +102,13 @@
|
||||
"Optimization": {
|
||||
"ScreenshotInterval": {
|
||||
"type": "input",
|
||||
"value": 0.3
|
||||
"value": 0.2,
|
||||
"display": "hide"
|
||||
},
|
||||
"CombatScreenshotInterval": {
|
||||
"type": "input",
|
||||
"value": 1.0
|
||||
},
|
||||
"TaskHoardingDuration": {
|
||||
"type": "input",
|
||||
"value": 0
|
||||
"value": 1.0,
|
||||
"display": "hide"
|
||||
},
|
||||
"WhenTaskQueueEmpty": {
|
||||
"type": "select",
|
||||
|
@ -24,7 +24,6 @@ Emulator:
|
||||
ControlMethod:
|
||||
value: MaaTouch
|
||||
option: [ minitouch, MaaTouch ]
|
||||
ScreenshotDedithering: false
|
||||
AdbRestart: false
|
||||
EmulatorInfo:
|
||||
Emulator:
|
||||
@ -64,7 +63,6 @@ Error:
|
||||
Optimization:
|
||||
ScreenshotInterval: 0.3
|
||||
CombatScreenshotInterval: 1.0
|
||||
TaskHoardingDuration: 0
|
||||
WhenTaskQueueEmpty:
|
||||
value: goto_main
|
||||
option: [ stay_there, goto_main, close_game ]
|
||||
|
@ -9,6 +9,9 @@ Alas:
|
||||
Emulator:
|
||||
ScreenshotMethod: scrcpy
|
||||
ControlMethod: MaaTouch
|
||||
Optimization:
|
||||
ScreenshotInterval: 0.2
|
||||
CombatScreenshotInterval: 1.0
|
||||
Restart:
|
||||
Scheduler:
|
||||
Enable:
|
||||
|
@ -20,7 +20,6 @@ class GeneratedConfig:
|
||||
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_ControlMethod = 'MaaTouch' # minitouch, MaaTouch
|
||||
Emulator_ScreenshotDedithering = False
|
||||
Emulator_AdbRestart = False
|
||||
|
||||
# Group `EmulatorInfo`
|
||||
@ -37,7 +36,6 @@ class GeneratedConfig:
|
||||
# Group `Optimization`
|
||||
Optimization_ScreenshotInterval = 0.3
|
||||
Optimization_CombatScreenshotInterval = 1.0
|
||||
Optimization_TaskHoardingDuration = 0
|
||||
Optimization_WhenTaskQueueEmpty = 'goto_main' # stay_there, goto_main, close_game
|
||||
|
||||
# Group `Storage`
|
||||
|
@ -77,10 +77,6 @@
|
||||
"minitouch": "minitouch",
|
||||
"MaaTouch": "MaaTouch"
|
||||
},
|
||||
"ScreenshotDedithering": {
|
||||
"name": "Image Color De-dithering",
|
||||
"help": "Enable when running Alas on phones"
|
||||
},
|
||||
"AdbRestart": {
|
||||
"name": "Try to restart adb when no device found",
|
||||
"help": ""
|
||||
@ -155,10 +151,6 @@
|
||||
"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"
|
||||
},
|
||||
"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": {
|
||||
"name": "When Task Queue is Empty",
|
||||
"help": "Close AL when there are no pending tasks, can help reduce CPU",
|
||||
|
@ -77,10 +77,6 @@
|
||||
"minitouch": "minitouch",
|
||||
"MaaTouch": "MaaTouch"
|
||||
},
|
||||
"ScreenshotDedithering": {
|
||||
"name": "Emulator.ScreenshotDedithering.name",
|
||||
"help": "Emulator.ScreenshotDedithering.help"
|
||||
},
|
||||
"AdbRestart": {
|
||||
"name": "Emulator.AdbRestart.name",
|
||||
"help": "Emulator.AdbRestart.help"
|
||||
@ -155,10 +151,6 @@
|
||||
"name": "Optimization.CombatScreenshotInterval.name",
|
||||
"help": "Optimization.CombatScreenshotInterval.help"
|
||||
},
|
||||
"TaskHoardingDuration": {
|
||||
"name": "Optimization.TaskHoardingDuration.name",
|
||||
"help": "Optimization.TaskHoardingDuration.help"
|
||||
},
|
||||
"WhenTaskQueueEmpty": {
|
||||
"name": "Optimization.WhenTaskQueueEmpty.name",
|
||||
"help": "Optimization.WhenTaskQueueEmpty.help",
|
||||
|
@ -77,10 +77,6 @@
|
||||
"minitouch": "minitouch",
|
||||
"MaaTouch": "MaaTouch"
|
||||
},
|
||||
"ScreenshotDedithering": {
|
||||
"name": "去除图片色彩抖动",
|
||||
"help": "在手机上运行时开启"
|
||||
},
|
||||
"AdbRestart": {
|
||||
"name": "在检测不到设备的时候尝试重启adb",
|
||||
"help": ""
|
||||
@ -155,10 +151,6 @@
|
||||
"name": "战斗中放慢截图速度至 X 秒一张",
|
||||
"help": "执行两次截图之间的最小间隔,限制在 0.1 ~ 1.0,能降低战斗时的 CPU 占用"
|
||||
},
|
||||
"TaskHoardingDuration": {
|
||||
"name": "囤积任务 X 分钟",
|
||||
"help": "能在收菜期间降低操作游戏的频率\n任务触发后,等待 X 分钟,再一次性执行囤积的任务"
|
||||
},
|
||||
"WhenTaskQueueEmpty": {
|
||||
"name": "当任务队列清空后",
|
||||
"help": "无任务时关闭游戏,能在收菜期间降低 CPU 占用",
|
||||
|
@ -77,10 +77,6 @@
|
||||
"minitouch": "minitouch",
|
||||
"MaaTouch": "MaaTouch"
|
||||
},
|
||||
"ScreenshotDedithering": {
|
||||
"name": "去除圖片色彩抖動",
|
||||
"help": "在手機上運行時開啟"
|
||||
},
|
||||
"AdbRestart": {
|
||||
"name": "在檢測不到設備的時候嘗試重啟adb",
|
||||
"help": ""
|
||||
@ -155,10 +151,6 @@
|
||||
"name": "戰鬥中放慢截圖速度至 X 秒一張",
|
||||
"help": "執行兩次截圖之間的最小間隔,限制在 0.1 ~ 1.0,能降低戰鬥時的 CPU 佔用"
|
||||
},
|
||||
"TaskHoardingDuration": {
|
||||
"name": "囤積任務 X 分鐘",
|
||||
"help": "能在收穫期間降低操作遊戲的頻率\n任務觸發後,等待 X 分鐘後,一次性執行佇列中的任務"
|
||||
},
|
||||
"WhenTaskQueueEmpty": {
|
||||
"name": "當任務隊列清空後",
|
||||
"help": "無任務時關閉遊戲,能在收菜期間降低 CPU 佔用",
|
||||
|
@ -55,9 +55,9 @@ class Screenshot(Adb, WSA, DroidCast, AScreenCap, Scrcpy):
|
||||
)
|
||||
self.image = method()
|
||||
|
||||
if self.config.Emulator_ScreenshotDedithering:
|
||||
# This will take 40-60ms
|
||||
cv2.fastNlMeansDenoising(self.image, self.image, h=17, templateWindowSize=1, searchWindowSize=2)
|
||||
# if self.config.Emulator_ScreenshotDedithering:
|
||||
# # This will take 40-60ms
|
||||
# cv2.fastNlMeansDenoising(self.image, self.image, h=17, templateWindowSize=1, searchWindowSize=2)
|
||||
self.image = self._handle_orientated_image(self.image)
|
||||
|
||||
if self.config.Error_SaveError:
|
||||
|
@ -41,7 +41,7 @@ def am_i_the_only_thread() -> bool:
|
||||
|
||||
def remote_access_service(
|
||||
local_host="127.0.0.1",
|
||||
local_port=22267,
|
||||
local_port=22367,
|
||||
server="app.pywebio.online",
|
||||
server_port=1022,
|
||||
remote_port="/",
|
||||
|
Loading…
Reference in New Issue
Block a user