Advertisement
SummitSummit

dig1

Nov 7th, 2012
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 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.detect() then
  11. digAll()
  12. end
  13. if turtle.detectUp() 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. inch()
  31. inch()
  32. turtle.turnRight()
  33. end
  34. function turnL()
  35. turtle.turnLeft()
  36. inch()
  37. inch()
  38. inch()
  39. turtle.turnLeft()
  40. end
  41. One()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement