接入你的測試
沒有客戶端庫:運行 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. 1 | Be.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-BeDDRaw | bot.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-BeDDMod | BeDD.exe mod install、mod uninstall <instance> |
Set-BeDDMode、-Mode | BeDD.exe mod config <instance> --world-mode <mode> |
Set-WorldSinglePlayer | BeDD.exe world singleplayer <worldDir> |
Start-BeDDGame.ps1、Start-Game;Stop-Game | BeDD.exe launch [--slot N] [--label …] --json;stop <pid> |
$script:ExclusiveSignaling = $true | launch --exclusive-signaling |
clone-instance.ps1、New-BeDDClone、Initialize-BeDD.ps1、Initialize-BeDDInstance | BeDD.exe instance clone --slot N(新電腦) |
Get-BeDDInstance、Initialize-BeDDServer、Get-BeDDServer | BeDD.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、managerScript | wsPort、wsMaxClients、manager |
BEDD_PIPE、BEDD_MANAGER_PIPE;BEDD_VERSIONS_DIR、BEDD_LAUNCHER_DATA、BEDD_LIP | run\<pid>.json;BEDD_LEVILAUNCHER、BEDD_INSTANCE |
Be.D.D. 1 的測試框架:BeetrootSkin、 AlleviatedBackpacks。