From 5a8c91d4210a482eaf824c863694b00f9128588f Mon Sep 17 00:00:00 2001 From: Lucas Leal Date: Mon, 24 Nov 2025 18:23:10 -0300 Subject: [PATCH 1/2] add a timeout to auto select method --- HenLoader/src/org/bdj/InitXlet.java | 37 +++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/HenLoader/src/org/bdj/InitXlet.java b/HenLoader/src/org/bdj/InitXlet.java index 0ecb3d4..b7277f0 100644 --- a/HenLoader/src/org/bdj/InitXlet.java +++ b/HenLoader/src/org/bdj/InitXlet.java @@ -82,7 +82,7 @@ public void run() console = new PrintStream(new MessagesOutputStream(messages, scene)); //InputStream is = getClass().getResourceAsStream("/program.data.bin"); //CRunTime.init(is); - + console.println("Hen Loader LP v1.0, based on:"); console.println("- GoldHEN 2.4b18.7 by SiSTR0"); console.println("- poops code by theflow0"); @@ -112,11 +112,44 @@ public void run() } else { console.println("* X = Poops"); } - + console.println("(Auto-selecting in 1 second...)"); + + long startTime = System.currentTimeMillis(); + long timeout = 1000; // 1 second + boolean autoSelected = false; + while ((c != BUTTON_O || !lapseSupported) && c != BUTTON_X) { c = pollInput(); + long currentTime = System.currentTimeMillis(); + if (currentTime - startTime >= timeout && c == 0) + { + // Auto-select: lapse when supported, poops for 12.50/12.52 + if (lapseSupported) { + c = BUTTON_X; // Select Lapse + } else { + c = BUTTON_X; // Select Poops (for 12.50/12.52) + } + autoSelected = true; + break; + } + if (c == 0) { + try { + Thread.sleep(10); // Small sleep to avoid busy waiting + } catch (InterruptedException e) { + break; + } + } + } + + if (autoSelected) { + if (lapseSupported) { + console.println("Auto-selected: Lapse"); + } else { + console.println("Auto-selected: Poops"); + } } + if (c == BUTTON_X && lapseSupported) { int result = org.bdj.external.Lapse.main(console); From 9f378d444898b9cd46b8eae41b755d2662d381e5 Mon Sep 17 00:00:00 2001 From: Lucas Leal Date: Tue, 25 Nov 2025 15:59:44 -0300 Subject: [PATCH 2/2] apply @m2k7m suggestion --- HenLoader/src/org/bdj/InitXlet.java | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/HenLoader/src/org/bdj/InitXlet.java b/HenLoader/src/org/bdj/InitXlet.java index b7277f0..dc69a9d 100644 --- a/HenLoader/src/org/bdj/InitXlet.java +++ b/HenLoader/src/org/bdj/InitXlet.java @@ -124,12 +124,7 @@ public void run() long currentTime = System.currentTimeMillis(); if (currentTime - startTime >= timeout && c == 0) { - // Auto-select: lapse when supported, poops for 12.50/12.52 - if (lapseSupported) { - c = BUTTON_X; // Select Lapse - } else { - c = BUTTON_X; // Select Poops (for 12.50/12.52) - } + c = BUTTON_X; autoSelected = true; break; }