worldbox-observer-mod/scripts/verify-nml.sh
2026-07-14 12:58:19 -05:00

45 lines
1.8 KiB
Bash
Executable file

#!/usr/bin/env bash
# Verify IdleSpectator Phase 1 load after Experimental Mode is enabled.
set -euo pipefail
GAME="/home/dazed/.local/share/Steam/steamapps/common/worldbox"
LOG="/home/dazed/.config/unity3d/mkarpenko/WorldBox/Player.log"
NML="$GAME/worldbox_Data/StreamingAssets/mods/NeoModLoader.dll"
MOD="$GAME/Mods/IdleSpectator"
echo "== Preflight =="
[[ -f "$NML" ]] && echo "OK NeoModLoader.dll" || { echo "MISSING NML"; exit 1; }
[[ -e "$MOD/mod.json" ]] && echo "OK IdleSpectator mod.json" || { echo "MISSING mod"; exit 1; }
[[ -e "$MOD/Main.cs" ]] && echo "OK IdleSpectator Main.cs" || { echo "MISSING Main.cs"; exit 1; }
echo
echo "Enable Experimental Mode in WorldBox Settings (bottom of the list),"
echo "then fully restart the game. This script waits for the Hello World log."
echo
if [[ ! -f "$LOG" ]]; then
echo "Waiting for Player.log (launch the game)..."
fi
deadline=$((SECONDS + 300))
while (( SECONDS < deadline )); do
if [[ -f "$LOG" ]] && rg -q "IdleSpectator.*Hello World|\\[IdleSpectator\\]: Hello World" "$LOG"; then
echo
echo "SUCCESS: Hello World found in Player.log"
rg -i "IdleSpectator|NeoModLoader|Experimental mode is enabled|Hello World" "$LOG" | tail -40
exit 0
fi
if [[ -f "$LOG" ]] && rg -q "Experimental mode is enabled|Attempting to load.*NeoModLoader" "$LOG"; then
echo "NML activity detected; still waiting for IdleSpectator Hello World..."
rg -i "NeoModLoader|IdleSpectator|Experimental|Attempting to load|error|exception" "$LOG" | tail -20
fi
sleep 2
done
echo "TIMEOUT: no Hello World within 5 minutes."
echo "Check: Experimental Mode on, then full restart."
if [[ -f "$LOG" ]]; then
echo "--- recent log matches ---"
rg -i "mod|experimental|NML|IdleSpectator|error" "$LOG" | tail -40 || true
fi
exit 1