taylojl

Untitled

Dec 10th, 2013
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. rednet.open("right")
  2.  
  3. while true do
  4. id,message = rednet.receive()
  5. if id == 62 then
  6. print ("Command Received")
  7. if message ~= nil then
  8. command = message[1]
  9. value = message[2]
  10.  
  11. print("Command: " .. command)
  12.  
  13. if command == "a" then
  14. turtle.turnLeft()
  15. end
  16. if command == "d" then
  17. turtle.turnRight()
  18. end
  19. if command == "q" then
  20. turtle.up()
  21. end
  22. if command == "e" then
  23. turtle.down()
  24. end
  25. if command == "w" then
  26. turtle.forward()
  27. end
  28. if command == "s" then
  29. turtle.back()
  30. end
  31. if command == "tunnel" then
  32. shell.run("tunnel " .. value)
  33. if value ~= 1 then
  34. for i=1,value - 1 do
  35. turtle.back()
  36. end
  37. end
  38. end
  39. end
  40. end
  41. end
Advertisement
Add Comment
Please, Sign In to add comment