Autotest: load through the Spielen screen

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
khallaandClaude Opus 5.5 committed 2026-10-25 18:24:29 +01:00
1 parent 401e20b1f2
commit 10c97f75e1
3 files changed
+19 -13

No files matched your search

+8 -10
View File
@@ -1,18 +1,18 @@
# Automated smoke test: start the game, load a save game (-Save: its row in
# the list, 1 = the first, selected by default), take
# Automated smoke test: start the game, load a character's last world (-Save:
# its row in the Spielen screen's character list, 1 = the first), take
# screenshots in-game and with the ESC menu open, then stop the game.
#
# .\tools\autotest-load.ps1 -Name ws_on # current sacredK.ini
# .\tools\autotest-load.ps1 -Name ws_off -Ini "[widescreen]`r`nEnabled=0"
#
# -Ini temporarily appends settings to build\x86-debug\sacredK.ini.
# Click positions are for the classic (menu) layout scaled onto a 3440x1440
# Click positions are for the menu screens (2026-10-25) on a 3440x1440
# monitor; adjust for other monitors. Don't touch mouse/keyboard while it runs.
param(
[string]$Name = "autotest",
[string]$Ini = "",
[int]$LoadTimeoutSeconds = 60,
# Row of the save game in the load screen's list (1-3 visible rows).
# Row of the character in the Spielen screen's list (its last world loads).
[int]$Save = 1,
# Runs in-game after loading, before the screenshots (e.g. clicks).
[scriptblock]$InGame = $null
@@ -28,12 +28,10 @@ if ($Ini) { Set-Content $iniPath ($iniBackup + "`r`n" + $Ini + "`r`n") -Encoding
$game = $null
try {
$game = Start-Sacred
Click-At 1720 779 -AfterMs 1500 # main menu: "Spiel laden"
if ($Save -gt 1) {
Click-At 1342 (609 + ($Save - 1) * 254) -AfterMs 800 # load screen: the save's name (rows 254 px apart)
}
Click-At 2382 568 -AfterMs 2000 # load screen: "Laden"
Click-At 1551 826 -AfterMs 0 # confirm: "Ok"
Click-At 1717 538 -AfterMs 2000 # main menu: "Spielen"
Click-At 817 (509 + ($Save - 1) * 105) -AfterMs 1000 # character list row (105 px apart)
Click-At 2714 1347 -AfterMs 1500 # "Spielen": the character's last world
Click-At 1548 824 -AfterMs 0 # "Spielstand laden?": "Ok"
Wait-Log "cEngine End and exit constructor" -TimeoutSeconds $LoadTimeoutSeconds -AfterMs 1500 -Game $game
if ($InGame) { & $InGame }
Save-Screen "screenshots\${Name}_ingame.png" | Out-Null