r/ComputerCraft • u/BartyB • Nov 11 '16
Code question
I am assuming I can post help about code here since I don't see any rules against it. I am trying to write a program that will keep executing after it is done. My current code is.
redstone.setOutput("right",true)
while true do
os.pullEvent("redstone")
if rs.getInput("left") then
break
end
end
redstone.setOutput("right"),false)
os.sleep(2)
redstone.setOutput("back",true)
os.sleep(5)
redstone.setOutput("back",false)
os.sleep(2)
redstone.setOutput("right"true)so the code works perfectly but after that last line and it turns the right side back on. I want it to continue looking for a redstone input from the left side and execute again.. repeat. But right now the code just stops and nothing happens when redstone pulses the left side.
1
Upvotes
0
u/[deleted] Nov 11 '16
[deleted]