Files
oniagent/scripts/watch.sh
root 0e17e8a6ac feat: complete ONI Agent project with full Mod API, Python toolchain, and development guide
- Implement all Mod API endpoints (buildings, research, geysers, alerts, critters, deconstruct, prioritize, research, schedule, wardrobe)
- Enhance Python tools with comprehensive CLI, analysis (O2/food/power/temp/water), and 7 blueprints (SPOM, toilet, ranch, farm, cooling, bedroom)
- Add utility scripts: auto_repair, auto_analyze, watch mode, setup
- Write Agent-Mod integration constraints and development guide
- Create skills directory with ONI agent skill definition
2026-05-22 08:44:56 +08:00

27 lines
653 B
Bash
Executable File

#!/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