ONI Agent Bridge - initial mod implementation

This commit is contained in:
JianFeeeee
2026-05-30 11:00:36 +08:00
commit 1f25d3d879
95 changed files with 50686 additions and 0 deletions

26
scripts/watch.sh Normal file
View File

@ -0,0 +1,26 @@
#!/usr/bin/env bash
# ONI Agent - Watch Mode
# Continuously polls game state and runs analysis on a timer.
set -euo pipefail
SCRIPT_DIR="$(dirname "$0")"
TOOLS_DIR="$SCRIPT_DIR/../tools"
INTERVAL=${1:-60}
if ! [[ "$INTERVAL" =~ ^[0-9]+$ ]] || [ "$INTERVAL" -lt 10 ]; then
echo "Usage: watch.sh [interval_seconds] (minimum 10)"
exit 1
fi
echo "[ONI Agent] Watch mode started (interval: ${INTERVAL}s)"
echo "Press Ctrl+C to stop."
echo ""
while true; do
clear 2>/dev/null || true
output=$(python3 "$TOOLS_DIR/oni_analyzer.py" 2>&1)
echo "$output"
echo ""
echo "[Next update in ${INTERVAL}s...]"
sleep "$INTERVAL"
done