SummitSummit

Dig4

Jun 12th, 2013
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. local blocks = 0
  2. term.write("How many blocks forward? :")
  3. blocks = read()
  4. function digAll()
  5. turtle.digUp()
  6. turtle.dig()
  7. turtle.digDown()
  8. end
  9. function gravel()
  10. if turtle.detectUp() then
  11. digAll()
  12. end
  13. if turtle.detect() then
  14. digAll()
  15. end
  16. end
  17. function One()
  18. for i = 1, blocks do
  19. inch()
  20. end
  21. end
  22. function inch()
  23. digAll()
  24. gravel()
  25. turtle.forward()
  26. end
  27. function turnR()
  28. turtle.turnRight()
  29. inch()
  30. turtle.turnRight()
  31. end
  32. function turnL()
  33. turtle.turnLeft()
  34. inch()
  35. turtle.turnLeft()
  36. end
  37. One()
  38. turnR()
  39. One()
  40. turnL()
  41. One()
  42. turnR()
  43. One()
Advertisement
Add Comment
Please, Sign In to add comment