From f15b8dc2ef1f099bb2a9c2924581869c32d7c827 Mon Sep 17 00:00:00 2001 From: templeofshadow Date: Thu, 25 Jun 2026 14:29:14 -0500 Subject: [PATCH] hopefully fix "too long without yielding" error for throttles --- main.lua | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/main.lua b/main.lua index f62bf79..15c2073 100644 --- a/main.lua +++ b/main.lua @@ -175,18 +175,18 @@ function ThrottleInit() print("\nPlease change the input signal for the throttle.") local initialStates = getRelayStates() - - while true do - local currentStates = getRelayStates() - for pname, currentState in pairs(currentStates) do - local initialState = initialStates[pname] - for k, v in pairs(currentState) do - if initialState[k] ~= v then - Throttles[throttleType].name = pname - Throttles[throttleType].side = k - return - end + os.pullEvent("redstone") + + local currentStates = getRelayStates() + + for pname, currentState in pairs(currentStates) do + local initialState = initialStates[pname] + for k, v in pairs(currentState) do + if initialState[k] ~= v then + Throttles[throttleType].name = pname + Throttles[throttleType].side = k + return end end end