Advertisement
Guest User

startup

a guest
Jan 18th, 2017
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.49 KB | None | 0 0
  1. p = peripheral.wrap("right") -- wrap modem
  2. p.open(1) -- open
  3. p.open(2) -- close
  4. p.open(4) -- continue
  5. while true do
  6.   local event, modemSide, senderChannel, replyChannel = os.pullEvent("modem_message")
  7.   if senderChannel == 1 then
  8.     print("opening")  
  9.     turtle.digUp()
  10.     turtle.suckUp()
  11.     turtle.forward()
  12.   end
  13.   if senderChannel == 2 then
  14.     print("closing")
  15.     turtle.back()
  16.     os.pullEvent("modem_message") -- pause for sync
  17.     turtle.placeUp()
  18.   end      
  19. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement