Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- inputSide = "bottom"
- outputSide = "right"
- rs.setOutput(outputSide, false)
- IsEnable = false
- --
- function Update()
- --something
- signal = rs.getAnalogInput(inputSide)
- if IsEnable then
- --Reactor is enabled
- if signal >= 14 then
- IsEnable = false
- end
- else
- --Reactor is disabled
- if signal < 7 then
- IsEnable = true
- end
- end
- rs.setOutput(outputSide, IsEnable)
- end
- --initialize
- Update()
- --Loop
- repeat
- local myTimer = os.startTimer(1)
- event, p1, p2, p3 = os.pullEvent()
- if event == "timer" then
- Update()
- end
- until event == "char" and p1==("q")
Add Comment
Please, Sign In to add comment