Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mon1 = peripheral.wrap("top")
- mon2 = peripheral.wrap("monitor_48")
- mon3 = peripheral.wrap("monitor_")
- --Setup
- function clear()
- mon1.clear()
- mon2.clear()
- mon3.clear()
- mon1.setCursorPos(1,1)
- mon1.write("Elevator")
- mon2.setCursorPos(1,1)
- mon2.write("Elevator")
- mon2.setCursorPos(2,2)
- mon2.write("[UP] [CALL]")
- mon2.setCursorPos(2,3)
- mon2.write("Designed By Scorp")
- mon3.setCursorPos(1,1)
- mon3.write("Elevator")
- mon3.setCursorPos(2,2)
- mon3.write("[CALL] [DOWN]")
- mon3.setCursorPos(1,3)
- mon3.write("Designed By Scorp")
- clear()
- --Elevator
- function up()
- rs.setBundledOutput("left", colors.combine(rs.getBundledOutput("left"), colors.orange))
- sleep(1)
- rs.setBundledOutput("left", colors.subtract(rs.getBundledOutput("left"), colors.orange))
- sleep(1)
- rs.setBundledOutput("left", colors.combine(rs.getBundledOutput("left"), colors.orange))
- sleep(1)
- rs.setBundledOutput("left", colors.subtract(rs.getBundledOutput("left"), colors.orange))
- sleep(1)
- rs.setBundledOutput("left", colors.combine(rs.getBundledOutput("left"), colors.orange))
- sleep(1)
- rs.setBundledOutput("left", colors.subtract(rs.getBundledOutput("left"), colors.orange))
- sleep(1)
- rs.setBundledOutput("left", colors.combine(rs.getBundledOutput("left"), colors.orange))
- sleep(1)
- rs.setBundledOutput("left", colors.subtract(rs.getBundledOutput("left"), colors.orange))
- sleep(1)
- rs.setBundledOutput("left", colors.combine(rs.getBundledOutput("left"), colors.orange))
- sleep(1)
- rs.setBundledOutput("left", colors.subtract(rs.getBundledOutput("left"), colors.orange))
- sleep(1)
- rs.setBundledOutput("left", colors.combine(rs.getBundledOutput("left"), colors.orange))
- sleep(1)
- rs.setBundledOutput("left", colors.subtract(rs.getBundledOutput("left"), colors.orange))
- sleep(1)
- rs.setBundledOutput("left", colors.combine(rs.getBundledOutput("left"), colors.orange))
- sleep(1)
- rs.setBundledOutput("left", colors.subtract(rs.getBundledOutput("left"), colors.orange))
- sleep(1)
- rs.setBundledOutput("left", colors.combine(rs.getBundledOutput("left"), colors.orange))
- sleep(1)
- rs.setBundledOutput("left", colors.subtract(rs.getBundledOutput("left"), colors.orange))
- sleep(1)
- end
- function down()
- rs.setBundledOutput("left", colors.combine(rs.getBundledOutput("left"), colors.white))
- sleep(1)
- rs.setBundledOutput("left", colors.subtract(rs.getBundledOutput("left"), colors.white))
- sleep(1)
- rs.setBundledOutput("left", colors.combine(rs.getBundledOutput("left"), colors.white))
- sleep(1)
- rs.setBundledOutput("left", colors.subtract(rs.getBundledOutput("left"), colors.white))
- sleep(1)
- rs.setBundledOutput("left", colors.combine(rs.getBundledOutput("left"), colors.white))
- sleep(1)
- rs.setBundledOutput("left", colors.subtract(rs.getBundledOutput("left"), colors.white))
- sleep(1)
- rs.setBundledOutput("left", colors.combine(rs.getBundledOutput("left"), colors.white))
- sleep(1)
- rs.setBundledOutput("left", colors.subtract(rs.getBundledOutput("left"), colors.white))
- sleep(1)
- rs.setBundledOutput("left", colors.combine(rs.getBundledOutput("left"), colors.white))
- sleep(1)
- rs.setBundledOutput("left", colors.subtract(rs.getBundledOutput("left"), colors.white))
- sleep(1)
- rs.setBundledOutput("left", colors.combine(rs.getBundledOutput("left"), colors.white))
- sleep(1)
- rs.setBundledOutput("left", colors.subtract(rs.getBundledOutput("left"), colors.white))
- sleep(1)
- rs.setBundledOutput("left", colors.combine(rs.getBundledOutput("left"), colors.white))
- sleep(1)
- rs.setBundledOutput("left", colors.subtract(rs.getBundledOutput("left"), colors.white))
- sleep(1)
- rs.setBundledOutput("left", colors.combine(rs.getBundledOutput("left"), colors.white))
- sleep(1)
- rs.setBundledOutput("left", colors.subtract(rs.getBundledOutput("left"), colors.white))
- sleep(1)
- end
- while true do
- local event, x, y = os.pullEvent()
- if (event == "monitor_touch") then
- if x > 2 and x < 6 and y == 2 then
- up()
- end
- if x > 8 and x < 12 and y == 2 then
- down()
- end
- sleep(0.5)
- end
Advertisement
Add Comment
Please, Sign In to add comment