Posted 08 September 2012 - 04:48 PM
Please delete
Edited on 27 December 2013 - 03:44 PM
while true do
if rs.getInput("top") then
rs.setOutput("bottom",true)
else
rs.setOutput("bottom",false)
end
end
[CODE]
It should work.
while true do
rs.setOutput("bottom", rs.getInput("top"))
os.pullEvent("redstone") -- waits for a redstone change
end
local nPulseDuration = 1 -- duration of the pulse in seconds
local sInputSide = "top"
local sOutputSide = "bottom"
local bPulseOn = rs.getInput(sInputSide)
local timer
if bPulseOn then
rs.setOutput(sOutputSide, true)
timer = os.startTimer(nPulseDuration)
end
while true do
local evt, arg = os.pullEvent()
if evt == "timer" then
if bPulseOn then
rs.setOutput(sOutputSide, not rs.getOutput(sOutputSide))
timer = os.startTimer(nPulseDuration)
end
elseif evt == "redstone" then
local input = rs.getInput("top")
if input ~= bPulseOn then
bPulseOn = input
if bPulseOn then
timer = os.startTimer(nPulseDuration)
else
rs.setOutput(sOutputSide, false)
end
end
end
end
Not tested, but it should work.