2.5 KiB
2.5 KiB
L2 UI harness — driving the SOTS strategy map from outside the guest
Written for lane L2's multiplayer-combat run on VM141. It is lane W2's C:\SOTS\w2\ui.ps1 plus the
two things that run needed and W2's version could not do.
What is different from W2's ui.ps1
- Real mouse motion.
SetCursorPosalone does not move the game's cursor as far as the starmap is concerned — the move-mode arrow and the destination tooltip never update, and clicks land on stale hit-test state. Everymoveandclickhere warps withSetCursorPosand then emits an actualmouse_event(MOUSEEVENTF_MOVE, …)relative jiggle. Without this you can drive fixed-position buttons (which is all W2 needed) but you cannot drive the map. wheel <x> <y> <notches>— starmap zoom, viamouse_event(MOUSEEVENTF_WHEEL). System banners overlap and hide each other's stars at default zoom; you have to zoom in before you can click a star.rclickanddbl.
Commands, one per line, read from C:\SOTS\l2\cmd.txt:
fg | move X Y | click X Y | rclick X Y | dbl X Y | wheel X Y N | key <SendKeys> | type <text> | sleep ms
The target process id is read from C:\SOTS\l2\pid.txt (or -1 for "do not foreground anything",
which is how a firewall or UAC dialog gets clicked). Run it from an interactive scheduled task
with LogonType=InteractiveToken; a process started straight from an SSH session lands in a
different window station and cannot click anything.
Gotchas that cost this lane a run each
- Move mode does not survive between invocations. "Select fleet → press Move → click the
destination" has to be one
cmd.txt, not three. - The banner is not the star. Banners sit up-left of their star with a short leader stem, and a neighbouring banner will cover the star. Clicking the banner does nothing; so does clicking where the hover tooltip is drawn. Zoom in until they separate, then click the star.
- A modal dialog silently eats an unattended turn loop. Screenshot and check before each blind click; a "plot a sublight course?" dialog swallowed four end-turn cycles without the turn moving.
Files
ui.ps1— the driver. Deploy toC:\SOTS\l2\ui.ps1and register a task pointing at it.socks.ps1— non-perturbing socket-table probe: which SOTS pid holds which UDP/TCP port, now.launch-b.cmd— second-instance launcher; reads its argument line fromC:\SOTS\w2\argsB.txt.C:\SOTS\w2\sotsb.xmlinvokes this path but the file itself is not on the VM140 image.