Advertisement
C07v0

Elevator, For code compass

Apr 21st, 2013
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.75 KB | None | 0 0
  1. function toTop()
  2.   if rs.testBundledInput("back", colors.black) == true then
  3.     print("Already on top floor, sending back down")
  4.     for i = 1,16 do
  5.       rs.setBundledOutput("back", colors.white)
  6.     end
  7.   else
  8.     for i = 1,16 do
  9.       rs.setBundledOutput("back", colors.orange)
  10.     end
  11.   end
  12. end
  13. function toBottom()
  14.   if not rs.testBundledInput("back", colors.black) then
  15.     print("Already on bottom floor, sending back up")
  16.     for i = 1,16 do
  17.       rs.setBundledOutput("back", colors.orange)
  18.     end
  19.    else
  20.     for i = 1,16 do
  21.       rs.setBundledOutput("back", colors.white)
  22.     end
  23.   end
  24. end
  25. while true do
  26.   if rs.testBundledInput("back", colors.lime) then
  27.     toBottom()
  28.   end
  29.   if rs.testBundledInput("back", colors.grey) then
  30.     toTop()
  31.   end
  32. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement