#!/usr/bin/env bash # Run N sessions back to back and collect the resulting run records. # The bot handles menu/character-select navigation itself, so no setup is needed. set -u # Fail fast if the bot cannot start a run (e.g. a pending Timeline epoch). if ! python3 run.py --steps 1 >/tmp/preflight.log 2>&1; then cat /tmp/preflight.log exit 2 fi SESSIONS="${1:-4}" STEPS="${2:-600}" for i in $(seq 1 "$SESSIONS"); do echo "=== session $i/$SESSIONS ===" python3 run.py --steps "$STEPS" --pause 0.3 > "/tmp/eval_${i}.log" 2>&1 echo " exit=$? takes=$(grep -c 'select_card_reward' "/tmp/eval_${i}.log") skips=$(grep -c 'skip_card_reward' "/tmp/eval_${i}.log")" python3 - <<'PY' import sts2 try: d = sts2.state(); p = d.get('player') or {} print(f" now: {d.get('state_type')} run={d.get('run')} hp={p.get('hp')}/{p.get('max_hp')}") except Exception as e: print(f" state read failed: {e}") PY done