ShivaFang

Untitled

Aug 28th, 2013
33
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local dist = 0
  2.  
  3. turtle.select(2)
  4.  
  5. function digLayer()
  6. if turtle.getItemCount(2)<3 then
  7. turtle.select(3)
  8. turtle.transferTo(2)
  9. turtle.select(2)
  10. end
  11. turtle.turnLeft()
  12. turtle.dig()
  13. turtle.place()
  14. turtle.turnRight()
  15. turtle.turnRight()
  16. turtle.dig()
  17. turtle.place()
  18. turtle.turnLeft()
  19. turtle.digUp()
  20. upity()
  21. turtle.placeDown()
  22. dist = dist + 1
  23. end
  24.  
  25. function digEmpty()
  26. turtle.turnLeft()
  27. turtle.dig()
  28. turtle.turnRight()
  29. turtle.turnRight()
  30. turtle.dig()
  31. turtle.turnLeft()
  32. turtle.digUp()
  33. turtle.up()
  34. upity()
  35. dist = dist + 1
  36. end
  37.  
  38. function upity()
  39. if detectUp() then
  40. turtle.digUp()
  41. upity()
  42. else
  43. turtle.up()
  44. end
  45. end
  46.  
  47. function filler()
  48. if turtle.getFuelLevel()<10 then
  49. turtle.select(1)
  50. turtle.refuel(1)
  51. turtle.select(2)
  52. end
  53. end
  54.  
  55. for i = 1,55,1 do
  56. filler()
  57. if dist==5 then
  58. digLayer()
  59. dist=0
  60. end
  61. if dist == 0 then
  62. digLayer()
  63. end
  64. digEmpty()
  65. end
  66.  
  67. run()
Advertisement
Add Comment
Please, Sign In to add comment