SummitSummit

CC turtle dig down

Nov 7th, 2012
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. local blocks = 0
  2. term.write("How many blocks down? :")
  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. end
  14. function One()
  15. for i = 1, blocks do
  16. inch()
  17. end
  18. end
  19. function inch()
  20. digAll()
  21. gravel()
  22. turtle.forward()
  23. digAll()
  24. gravel()
  25. turtle.down()
  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()
Advertisement
Add Comment
Please, Sign In to add comment