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