stalker-soc-test-looplisted
Install: claude install-skill webpnk/stalker-soc-skills
# SoC in-game test loop
Tools (in `scripts\`, copied into `<root>\src\tools\` by `stalker-soc-project-setup`; they locate the
workspace as two folders up from themselves):
| Script | What |
|---|---|
| `game.ps1` | the one entry point: `start [-Load save] [-NoFocus]`, `shot`, `cmd "<lua>"`, `keys`, `click`, `log`, `stop` |
| `run_interactive.ps1` | run any exe in the user's desktop session (scheduled-task trick) |
| `capture_game.ps1` | PrintWindow capture (DPI-aware), works while occluded |
| `focus_game.ps1` / `keep_focus.ps1` | force the game window to the foreground (once / every 2 s) |
| `sendkeys.ps1` | DirectInput-compatible scan-code keys; `w:3000` holds W for 3 s; `_` pauses |
| `mouse_move.ps1` | relative mouse deltas in small steps (camera look, UI cursor) |
| `click_game.ps1` | closed-loop UI click: finds SoC's yellow cursor in a capture and corrects |
Lua side: `templates\moddev.script` -> `src\mod\scripts\moddev.script`, enabled by
`[moddev] enabled = true` in the mod's system include, called from the actor binder
(`moddev.on_spawn()` in net_spawn, `moddev.update(time_global())` every update - the
`stalker-soc-lua` main-script template does this). `fsgame.ltx` needs
`$mod_ipc$ = true| true| $app_data_root$| mod_ipc\`.
## Why it works this way (facts verified by testing)
- Claude's shell is **Session 0**: the game crashes creating its input device there, and windows
can't be captured/focused. `run_interactive.ps1` registers a one-off scheduled task
(`Log