MinoCraft72

P4 Turtle

Jan 2nd, 2015
315
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.47 KB | None | 0 0
  1. --Config:
  2.  
  3.  channel = 2 -- Used channel 2 to 8
  4.  
  5. --Prog:
  6.  
  7. local modem = peripheral.wrap("right")
  8. modem.open(channel)
  9.  
  10. while true do
  11.  
  12.  sleep(0)
  13.  local event, modemSide,senderChannel, replyChannel, message, senderDistance = os.pullEvent("modem_message")
  14.  print(message)
  15.  
  16.   if message == "yellow" then
  17.    turtle.select(1)
  18.    sleep(0.15)
  19.    turtle.placeDown()
  20.   end
  21.  
  22.   if message == "red" then
  23.    turtle.select(2)
  24.    sleep(0.15)
  25.    turtle.placeDown()
  26.   end
  27. end
Advertisement
Add Comment
Please, Sign In to add comment