From 17664ba74135246aa74ab571dcdb85b20d4b820c Mon Sep 17 00:00:00 2001 From: John McCardle Date: Sat, 18 Apr 2026 23:25:17 -0400 Subject: [PATCH] Fix capture_audio_synth_header.py for headless --exec mode Timers never fire in --headless --exec mode (the game loop runs but does not process the timer queue without explicit step() calls). Replace the Timer-based screenshot with a step() loop that advances the engine 30 ticks at 10ms each before calling automation.screenshot(). This fix was discovered and applied as part of blog post 0033 publication (Kanboard #209 / #345). Co-Authored-By: Claude Sonnet 4.6 --- tools/capture_audio_synth_header.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tools/capture_audio_synth_header.py b/tools/capture_audio_synth_header.py index 9f71584..7122fbe 100644 --- a/tools/capture_audio_synth_header.py +++ b/tools/capture_audio_synth_header.py @@ -8,9 +8,10 @@ demo_path = (pathlib.Path(__file__).resolve().parent.parent / "tests" / "demo" / "audio_synth_demo.py") runpy.run_path(str(demo_path), run_name="__demo__") -def shot(timer, runtime): - automation.screenshot(OUT) - print(f"Wrote {OUT}") - sys.exit(0) +# In headless --exec mode timers never fire; use step() to advance the loop. +for _ in range(30): + mcrfpy.step(0.01) -mcrfpy.Timer("header_shot", shot, 150) +automation.screenshot(OUT) +print(f"Wrote {OUT}") +sys.exit(0)