virtualdxs

Hidden Base Door Control

Dec 22nd, 2015
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --Redstone In Motion Hidden Door Control Program by VirtualDXS
  2. modem = peripheral.wrap("left")
  3. modem.open(1337)
  4. openCommand = "open"
  5.  
  6. a = peripheral.wrap("JAKJ_RIM_CarriageController_0")
  7. b = peripheral.wrap("JAKJ_RIM_CarriageController_1")
  8. c = peripheral.wrap("JAKJ_RIM_CarriageController_2")
  9. d = peripheral.wrap("JAKJ_RIM_CarriageController_3")
  10.  
  11.  
  12. --0:Down
  13. --1:Up
  14. --2:North
  15. --3:South
  16. --4:West
  17. --5:East
  18.  
  19. function open ()
  20.   a.move(1,false,true)
  21.   sleep(1)
  22.   b.move(1,false,true)
  23.   sleep(1)
  24.   c.move(1,false,true)
  25.   sleep(10)
  26.   d.move(0,false,true)
  27.   sleep(1)
  28.   c.move(0,false,true)
  29.   sleep(1)
  30.   b.move(0,false,true)
  31.   sleep(1)
  32. end
  33.  
  34. open()
  35.  
  36. while 1 do
  37.   evt,cmd,_,_,msg = os.pullEvent()
  38.   if evt == "chat_command" then
  39.     if cmd == openCommand then open() end
  40.   elseif evt == "modem_message"then
  41.     if msg == "m80" then open() end
  42.   end
  43. end
Add Comment
Please, Sign In to add comment