Advertisement
Guest User

Untitled

a guest
Jan 25th, 2020
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. round = 1
  2. max = 5
  3.  
  4. function pickUp()
  5. for i = 0, 5 do turtle.suck(64) end
  6. for i = 0, 5 do turtle.suckUp(64) end
  7. for i = 0, 5 do turtle.suckDown(64) end
  8. end
  9.  
  10. while (round < max) do
  11. for rot = 0, 3 do
  12. -- First, up
  13. success, data = turtle.detectUp()
  14. if success then
  15. turtle.digUp()
  16. sleep(1)
  17. pickUp()
  18. end
  19.  
  20. -- Next, down
  21. success, data = turtle.detectDown()
  22. if success then
  23. turtle.digDown()
  24. sleep(1)
  25. pickUp()
  26. end
  27.  
  28. -- Last, forward
  29. success, data = turtle.detect()
  30. if success then
  31. turtle.dig()
  32. sleep(1)
  33. pickUp()
  34. end
  35.  
  36. -- Move forward
  37. turtle.forward()
  38. end
  39.  
  40. round = round + 1
  41. turtle.turnLeft()
  42. print("Round", round, "done")
  43. end
  44.  
  45. print("Done!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement