跳到正文
本頁目錄

接入你的測試

沒有客戶端庫:運行 BeDD.exe,再驅動 WebSocket,先用 bedboo (順序)。

powershell
BeDD.exe instance clone --slot 2                   # then copy your mod into (BeDD.exe instance path 1.26.60.05-2)\mods
BeDD.exe world singleplayer <worldDir>             # after restoring your test world
BeDD.exe launch --slot 2 --label my-mod --json     # pid, url, token
BeDD.exe stop <pid>
js
const bot = bedboo.createBot({ transport: 'bedd', bedd: { url: game.url, token: game.token } });
  • stdout 只有結果;--json 輸出一個文檔,-q 輸出標識符,-v 在 stderr 輸出細節。出錯:error: … + hint:({"error":{code,message,hint}})。
  • 退出碼:0 成功,1 失敗,2 用法錯誤,4 找不到,5 衝突(如槽位正在使用),10 被拒絕。
  • 每個並行運行一個槽位;無需清理。
  • 你自己構建的 BeDD:mod install <instance> --from <dir>(固定來源)。
  • BeDD.exe dev:開發模組的常用步驟(--help)。

PowerShell:[System.Net.WebSockets.ClientWebSocket],每個操作一條 UTF-8 文本消息,讀到 EndOfMessage 為止。 Focus-Game、Assert-GameForeground:空操作。

從 PowerShell 客戶端遷移

模塊、墊片和命名管道都沒有了;操作不變。克隆從 LeviLauncher 的 versions\<base>-hi<slot> 移到 instances\<gameVersion>-<slot>。

Be.D.D. 1Be.D.D. 2
Connect-BeDD [-PipeName p]BeDD.exe ps --json 或 run\<pid>.json;打開 url?token=…
Invoke-BeDD @{ op = … }通過 WebSocket 發同樣的 JSON
Get-BeDDState、Get-BeDDWorld、Set-BeDDLook、Set-BeDDInput、Set-BeDDSlot、Invoke-BeDDAction、Set-BeDDButton、Send-BeDDPacket、Send-BeDDStack、Get-/Set-BeDDTimeScale、Join-BeDDServer、Send-BeDDKey、Clear-BeDDInput、Set-BeDDWindow操作 state、world、look、input、slot、action、button、send、stack、timescale、join、key、release、window
Send-BeDDText、Send-BeDDMouse、Send-BeDDRawbot.chat / 對 ref 的 ui click / look;否則操作 text / mouse / raw
Save-BeDDScreenshot、Get-BeDDBitmap操作 screenshot
tap 管道 <pipeName>-tap操作 tap action:'subscribe'(二進制消息)
harness-shim.ps1(Click、Press-Key、Type-Text、Move-Mouse、Scroll、Get-ClientBitmap 等)你自己基於 WebSocket 的函數;優先用 bedboo 和 ui
Register-BeDDNative讓輸入類改走 WebSocket,而不是 SendInput
Install-BeDDMod、Uninstall-BeDDModBeDD.exe mod install、mod uninstall <instance>
Set-BeDDMode、-ModeBeDD.exe mod config <instance> --world-mode <mode>
Set-WorldSinglePlayerBeDD.exe world singleplayer <worldDir>
Start-BeDDGame.ps1、Start-Game;Stop-GameBeDD.exe launch [--slot N] [--label …] --json;stop <pid>
$script:ExclusiveSignaling = $truelaunch --exclusive-signaling
clone-instance.ps1、New-BeDDClone、Initialize-BeDD.ps1、Initialize-BeDDInstanceBeDD.exe instance clone --slot N(新電腦)
Get-BeDDInstance、Initialize-BeDDServer、Get-BeDDServerBeDD.exe instance show、server init、server list
Start-BeDDServer.ps1(-Stop、-Command)server start / server stop;服務器上的 command 操作
BeDDManager.ps1(-List、-Game <pid> -Action close、-Shutdown)BeDD.exe(窗口)、ps、stop <pid>、manager stop
配置 pipeName、pipeInstances、managerScriptwsPort、wsMaxClients、manager
BEDD_PIPE、BEDD_MANAGER_PIPE;BEDD_VERSIONS_DIR、BEDD_LAUNCHER_DATA、BEDD_LIPrun\<pid>.json;BEDD_LEVILAUNCHER、BEDD_INSTANCE

Be.D.D. 1 的測試框架:BeetrootSkin、 AlleviatedBackpacks。