hopefully fix "too long without yielding" error for throttles
This commit is contained in:
22
main.lua
22
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
|
||||
|
||||
Reference in New Issue
Block a user