Advertisement
RyuuzakiJulio

3x3ComputerPistonDoor

Mar 2nd, 2013
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  1.  
  2. --[[
  3. 3x3 Piston Door controled by a computer with budnled cable on top
  4. --]]
  5.  
  6. --close
  7.  
  8. ticks = 0.2
  9.  
  10. function close()
  11. rs.setOutput("bottom",true)
  12. rs.setBundledOutput("top",colors.orange)
  13. sleep(ticks)
  14. rs.setBundledOutput("top",0)
  15. sleep(ticks)
  16. rs.setBundledOutput("top",colors.white)
  17. sleep(ticks)
  18. rs.setBundledOutput("top",colors.white+colors.magenta)
  19. end
  20.  
  21. --open
  22.  
  23. function open()
  24. rs.setBundledOutput("top", colors.white)
  25. sleep(ticks)
  26. rs.setBundledOutput("top", 0)
  27. sleep(ticks)
  28. rs.setBundledOutput("top", colors.orange)
  29. sleep(ticks)
  30. rs.setBundledOutput("top", colors.orange+colors.magenta)
  31. sleep(ticks)
  32. rs.setBundledOutput("top", colors.orange)
  33. sleep(ticks)
  34. rs.setBundledOutput("top", 0)
  35. sleep(ticks)
  36. rs.setBundledOutput("top", colors.magenta)
  37. sleep(ticks)
  38. rs.setBundledOutput("top", 0)
  39. rs.setOutput("bottom",false)
  40. end
  41.  
  42. while true do
  43.  
  44. term.clear()
  45. term.setCursorPos(1,1)
  46.  
  47. print("Automatic Door Control")
  48. print("--------------------------------------------------")
  49. print("")
  50. print("")
  51. print(" Press any key to open")
  52. print("")
  53.  
  54. local evt, prm1 = os.pullEvent("key")
  55.  
  56. open()
  57. sleep(3)
  58. close()
  59.  
  60. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement