Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- 3x3 Piston Door controled by a computer with budnled cable on top
- --]]
- --close
- ticks = 0.2
- function close()
- rs.setOutput("bottom",true)
- rs.setBundledOutput("top",colors.orange)
- sleep(ticks)
- rs.setBundledOutput("top",0)
- sleep(ticks)
- rs.setBundledOutput("top",colors.white)
- sleep(ticks)
- rs.setBundledOutput("top",colors.white+colors.magenta)
- end
- --open
- function open()
- rs.setBundledOutput("top", colors.white)
- sleep(ticks)
- rs.setBundledOutput("top", 0)
- sleep(ticks)
- rs.setBundledOutput("top", colors.orange)
- sleep(ticks)
- rs.setBundledOutput("top", colors.orange+colors.magenta)
- sleep(ticks)
- rs.setBundledOutput("top", colors.orange)
- sleep(ticks)
- rs.setBundledOutput("top", 0)
- sleep(ticks)
- rs.setBundledOutput("top", colors.magenta)
- sleep(ticks)
- rs.setBundledOutput("top", 0)
- rs.setOutput("bottom",false)
- end
- while true do
- term.clear()
- term.setCursorPos(1,1)
- print("Automatic Door Control")
- print("--------------------------------------------------")
- print("")
- print("")
- print(" Press any key to open")
- print("")
- local evt, prm1 = os.pullEvent("key")
- open()
- sleep(3)
- close()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement