Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function up()
- req - cur = uu
- uu * 9 = u
- for i=1,u do
- rs.setBundledOutput("left", colors.white)
- sleep(0.75)
- rs.setBundledOutput("left", 0)
- sleep(0.06)
- end
- main()
- end
- function down()
- cur - req = dd
- dd * 9 = d
- for i=1,d do
- rs.setBundledOutput("left", colors.black)
- sleep(0.75)
- rs.setBundledOutput("left", 0)
- sleep(0.06)
- end
- main()
- end
- function elevator()
- if rs.testBundledInput("left", colors.blue) then
- req = 1
- elseif rs.testBundledInput("left", colors.red) then
- req = 2
- elseif rs.testBundledInput("left", colors.green) then
- req = 3
- elseif rs.testBundledInput("left", colors.purple) then
- req = 4
- elseif rs.testBundledInput("left", colors.orange) then
- req = 5
- elseif rs.testBundledInput("left", colors.gray) then
- req = 6
- elseif rs.testBundledInput("left", colors.brown) then
- req = 7
- end
- if rs.testBundledInput("left", colors.lightblue) then
- cur = 1
- elseif rs.testBundledInput("left", colors.pink) then
- cur = 2
- elseif rs.testBundledInput("left", colors.lime) then
- cur = 3
- elseif rs.testBundledInput("left", colors.magenta) then
- cur = 4
- elseif rs.testBundledInput("left", colors.yellow) then
- cur = 5
- elseif rs.testBundledInput("left", colors.lightgray) then
- cur = 6
- elseif rs.testBundledInput("left", colors.cyan) then
- cur = 7
- end
- if cur < req then
- up()
- elseif cur > req then
- down()
- end
- main()
- end
- function main()
- while true do
- os.pullEvent("redstone")
- elevator()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment