100Toby1

Untitled

Apr 24th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. local rows = 10
  2. local cols = 30
  3. local dir = 0
  4.  
  5. function digRow()
  6. local blocks = rows
  7. while blocks > 0 do
  8. turtle.dig()
  9. turtle.forward()
  10.  
  11. local upTime = 0
  12. while turtle.detectUp() do
  13. turtle.digUp()
  14. turtle.up()
  15. upTime = upTime + 1
  16. end
  17. while upTime > 0 do
  18. turtle.down()
  19. upTime = upTime - 1
  20. end
  21.  
  22. if not turtle.detectDown then
  23. turtle.placeDown()
  24. end
  25. blocks = blocks - 1
  26. end
  27. end
  28.  
  29. while cols > 0 do
  30. digRow()
  31. if dir == 0 then
  32. turtle.turnLeft()
  33. turtle.forward()
  34. turtle.turnLeft()
  35. turtle.forward()
  36. dir = 1
  37. elseif dir == 1 then
  38. turtle.turnRight()
  39. turtle.forward()
  40. turtle.turnRight()
  41. dir = 0
  42. end
  43. rows = rows - 1
  44. end
Advertisement
Add Comment
Please, Sign In to add comment