#!/usr/bin/env bash # lane CB: deploy -> launch -> load -> End Turn -> collect. One click per call, and the # main menu is POLLED for, never slept for: the >60 s startup is on the board four times and it # cost this lane one run before the poller existed. set -e TAG=$1; ROW_Y=$2; NAME=$3 cd /home/alex/sots-re V=re@192.168.10.146 step() { ./dumps/cbstep.sh "$1" >/dev/null 2>&1; sleep "${2:-3}"; } ssh $V "powershell -ExecutionPolicy Bypass -File C:\\SOTS\\cb\\cbdeploy.ps1 -Tag $TAG" | grep -E "^tag:|^build:|launched|NOT RUNNING" step 'key {ESC};;sleep 1500;;key {ESC};;sleep 1500;;key {ESC};;sleep 1500;;key {ESC};;sleep 1500' 2 uv run --with pillow python3 dumps/cbmenu.py 300 | tail -2 step 'fg;;sleep 500;;move 512 536;;sleep 400;;click 512 536;;sleep 2500' 3 step 'click 512 536;;sleep 2500' 3 step 'move 512 290;;sleep 400;;click 512 290;;sleep 1200;;click 512 290;;sleep 2000' 3 step 'move 551 523;;sleep 400;;click 551 523;;sleep 3000' 4 step "move 350 $ROW_Y;;sleep 400;;click 350 $ROW_Y;;sleep 2000" 3 step 'move 682 624;;sleep 400;;click 682 624;;sleep 4000' 5 step 'move 511 663;;sleep 400;;click 511 663;;sleep 3000' 3 echo "waiting for load..." until ssh $V "Select-String -Path C:\\SOTS\\shim.aiorders.txt -Pattern 'aibatch' -Quiet" 2>/dev/null | grep -q True; do sleep 6; done sleep 25 uv run --with pillow python3 tools/vmshot.py --ssh --one 146 | tail -1 step 'move 100 714;;sleep 500;;click 100 714;;sleep 3000' 3 echo "end turn issued, waiting for autosave..." until ssh $V "Test-Path 'C:\\SOTS\\SavedGames\\(Autosave).sav'" 2>/dev/null | grep -q True; do sleep 6; done sleep 20 ssh $V "powershell -ExecutionPolicy Bypass -File C:\\SOTS\\cb\\cbgrab.ps1 -Name $NAME"