Advertisement
100Toby1

Untitled

Apr 24th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 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. blocks = blocks - 1
  23. end
  24. end
  25.  
  26. while cols > 0 do
  27. digRow()
  28. if dir == 0 then
  29. turtle.turnLeft()
  30. turtle.forward()
  31. turtle.turnLeft()
  32. turtle.forward()
  33. dir = 1
  34. elseif dir == 1 then
  35. turtle.turnRight()
  36. turtle.forward()
  37. turtle.turnRight()
  38. dir = 0
  39. end
  40. rows = rows - 1
  41. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement