Advertisement
s3ptum

stairs control bundleed

May 30th, 2022 (edited)
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.41 KB | None | 0 0
  1. --program start set all signals off
  2. --topOn(), StairsOff(), bottomOn()
  3. --if grey the check toggle if 1 then 0 iof 0 then 1
  4. --
  5. --
  6. --Variables
  7. local toggleVar = true
  8. local sSide = "back"
  9.  
  10. --Color Aliases
  11. w = colors.white
  12. o = colors.orange
  13. bl = colors.blue
  14. y = colors.yellow
  15. p = colors.pink
  16. br = colors.brown
  17. g = colors.green
  18. gr = colors.gray
  19. blk = colors.black
  20.  
  21.  
  22.  
  23.  
  24.  
  25. --Functions
  26. function open()
  27. topOff()
  28. bottomOff()
  29. stairsOn()
  30. end
  31.  
  32. function close()
  33. stairsOff()
  34. topOn()
  35. bottomOn()
  36. end
  37.  
  38. function topOn()
  39. rs.setBundledOutput(sSide,colors.combine(rs.getBundledOutput(sSide),p))
  40. sleep(.5)
  41. rs.setBundledOutput(sSide,colors.combine(rs.getBundledOutput(sSide),br))
  42. sleep(.5)
  43. rs.setBundledOutput(sSide,colors.combine(rs.getBundledOutput(sSide),g))
  44. sleep(.5)
  45. end
  46.  
  47. function topOff()
  48. rs.setBundledOutput(sSide,colors.subtract(redstone.getBundledOutput(sSide),g))
  49. sleep(.5)
  50. rs.setBundledOutput(sSide,colors.subtract(redstone.getBundledOutput(sSide),br))
  51. sleep(.5)
  52. rs.setBundledOutput(sSide,colors.subtract(redstone.getBundledOutput(sSide),p))
  53. sleep(.5)
  54. end
  55.  
  56. function stairsOn()
  57. rs.setBundledOutput(sSide,colors.combine(rs.getBundledOutput(sSide),w))
  58. sleep(.5)
  59. rs.setBundledOutput(sSide,colors.combine(rs.getBundledOutput(sSide),o))
  60. sleep(.5)
  61. rs.setBundledOutput(sSide,colors.combine(rs.getBundledOutput(sSide),bl))
  62. sleep(.5)
  63. rs.setBundledOutput(sSide,colors.combine(rs.getBundledOutput(sSide),y))
  64. sleep(.5)
  65. end
  66.  
  67. function stairsOff()
  68. rs.setBundledOutput(sSide,colors.subtract(redstone.getBundledOutput(sSide),y))
  69. sleep(.5)
  70. rs.setBundledOutput(sSide,colors.subtract(redstone.getBundledOutput(sSide),bl))
  71. sleep(.5)
  72. rs.setBundledOutput(sSide,colors.subtract(redstone.getBundledOutput(sSide),o))
  73. sleep(.5)
  74. rs.setBundledOutput(sSide,colors.subtract(redstone.getBundledOutput(sSide),w))
  75. sleep(.5)
  76. end
  77.  
  78. function bottomOn()
  79. rs.setBundledOutput(sSide,colors.combine(rs.getBundledOutput(sSide),blk))
  80. sleep(.5)
  81. end
  82.  
  83. function bottomOff()
  84. rs.setBundledOutput(sSide,colors.subtract(redstone.getBundledOutput(sSide),blk))
  85. sleep(.5)
  86. end
  87.  
  88.  
  89.  
  90.  
  91. --Pathetic Attempt At Code
  92.  
  93.  
  94. while true do
  95. close()
  96. --os.pullEvent("redstone")
  97.  
  98. term.clear()
  99. term.setCursorPos(1,1)
  100. print("Please enter password:")
  101. input = read("*")
  102.  
  103.  
  104.  
  105. if input == "password" or if
  106. rs.testBundledInput(sSide, colors.gray) then
  107. open()
  108. sleep(10) else
  109. close()
  110. end
  111. end
  112.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement