DrFair

elevator

Jan 20th, 2013
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.54 KB | None | 0 0
  1. up = true
  2. rednet.open("left")
  3. function activate()
  4.     if up then
  5.         for i=1,17 do
  6.             redstone.setOutput("right",true)
  7.             os.sleep(0.5)
  8.             redstone.setOutput("right",false)
  9.             os.sleep(0.25)
  10.         end
  11.         up = false
  12.     else
  13.         for i=1,17 do
  14.             redstone.setOutput("bottom",true)
  15.             os.sleep(0.5)
  16.             redstone.setOutput("bottom",false)
  17.             os.sleep(0.25)
  18.         end
  19.         up = true
  20.     end
  21. end
  22.  
  23. while true do
  24.     event, id, message = os.pullEvent()
  25.     if event == "rednet_message" and message == "elevatoractivate" then
  26.         activate()
  27.         print("Activated.")
  28.     end
  29. end
Advertisement
Add Comment
Please, Sign In to add comment