This website requires JavaScript.
0
Issues
Pull Requests
Milestones
Explore
0
Create…
New Repository
New Migration
New Organization
public
Signed in as
public
Profile
Starred
Subscriptions
Settings
Help
Sign Out
yws
/
lc-mcp
Watch
1
Star
0
Fork
0
Code
Issues
Pull Requests
Actions
Packages
Projects
Releases
Wiki
Activity
Files
lc-mcp
/
scripts
/
or
Cancel
Edit File
Preview
Preview Changes
Spaces
Tabs
2
4
8
Wrap
No wrap
# 注册"到点启动游戏 -> 合成模块 -> 关掉游戏"的计划任务。 # # 用法: # powershell -ExecutionPolicy Bypass -File scripts\install_convert_task.ps1 # powershell -ExecutionPolicy Bypass -File scripts\install_convert_task.ps1 -EveryHours 6 # powershell -ExecutionPolicy Bypass -File scripts\install_convert_task.ps1 -Uninstall # # 默认每 4 小时检查一次; 是否合成以本轮实际体力读数为准, 不按固定恢复速率推算。 # 合成 1 个模块需要 20 点体力。 # # 这个任务和 LcMCPDailyCycle 是分开的: 用户明确要求这次不打任何关卡, # 只挂机攒模块, 所以不能把刷取任务一起打开。 param( [double]$EveryHours = 4, [string]$Python = "", [switch]$Uninstall ) $ErrorActionPreference = "Stop" $Repo = Split-Path -Parent $PSScriptRoot $TaskName = "LcMCPConvertModules" if ($Uninstall) { Unregister-ScheduledTask -TaskName $TaskName -Confirm:$false -ErrorAction SilentlyContinue Write-Output "uninstalled $TaskName" exit 0 } if (-not $Python) { $Python = Join-Path $Repo "vendor\aalc\.venv\Scripts\pythonw.exe" } if (-not (Test-Path $Python)) { throw "找不到 python: $Python" } $script = Join-Path $PSScriptRoot "convert_modules.py" if (-not (Test-Path $script)) { throw "找不到脚本: $script" } # 以当前用户的交互会话运行, 必须保持登录; 注销后没有可供截图/点击的游戏桌面。 $principal = New-ScheduledTaskPrincipal -UserId "$env:USERDOMAIN\$env:USERNAME" ` -LogonType Interactive -RunLevel Limited $action = New-ScheduledTaskAction -Execute $Python -WorkingDirectory $Repo ` -Argument "-X utf8 `"$script`"" # 一次跑 5 分钟足够: 启动游戏 + 进主界面 + 合成 + 关掉。给宽一点防止启动慢。 $limit = New-TimeSpan -Minutes 15 # -Once + 长周期重复, 这样才能设成"每 N 小时" $trigger = New-ScheduledTaskTrigger -Once -At (Get-Date).AddMinutes(2) ` -RepetitionInterval (New-TimeSpan -Minutes ($EveryHours * 60)) ` -RepetitionDuration (New-TimeSpan -Days 3650) $settings = New-ScheduledTaskSettingsSet -AllowStartIfOnBatteries -DontStopIfGoingOnBatteries ` -StartWhenAvailable -ExecutionTimeLimit $limit -MultipleInstances IgnoreNew Register-ScheduledTask -TaskName $TaskName -Action $action -Trigger $trigger ` -Principal $principal -Settings $settings -Force | Out-Null Write-Output "registered $TaskName (every $EveryHours h, limit=$limit)" Write-Output "reports -> $env:USERPROFILE\lc_mcp\modules\convert_*.json" Write-Output "log -> $env:USERPROFILE\lc_mcp\modules\convert.log"
Commit Changes
Add a Signed-off-by trailer by the committer at the end of the commit log message.
Commit directly to the
codex/local-wip-20261022
branch.
Create a
new branch
for this commit and start a pull request.
Commit Changes
Cancel