Advertisement
norm3000

3placev

Apr 24th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1. function clearInv()
  2. turtle.digDown()
  3. local slot=2
  4. while slot <= 16 do
  5. if turtle.getItemCount(slot) > 0 then
  6. turtle.select(slot)
  7. turtle.dropDown()
  8. end
  9. slot = slot + 1
  10. end
  11. turtle.select(2)
  12. end
  13.  
  14. function forward()
  15. if turtle.forward() then
  16. return
  17. else
  18. turtle.dig()
  19. forward()
  20. end
  21. end
  22.  
  23. function up()
  24. if turtle.up() then
  25. return
  26. else
  27. turtle.digUp()
  28. up()
  29. end
  30. end
  31.  
  32. function down()
  33. if turtle.down() then
  34. return
  35. else
  36. turtle.digDown()
  37. down()
  38. end
  39. end
  40.  
  41. function refuel()
  42. turtle.select(1)
  43. turtle.refuel()
  44. turtle.select(2)
  45. end
  46.  
  47. function place_down()
  48. local slot=offset
  49. while slot <= offset + 3 do
  50. if turtle.getItemCount(slot) > 0 then
  51. turtle.select(slot)
  52. turtle.placeDown()
  53. return
  54. end
  55. slot = slot + 1
  56. end
  57. end
  58.  
  59. function place_up()
  60. local slot=offset
  61. while slot <= offset + 3 do
  62. if turtle.getItemCount(slot) > 0 then
  63. turtle.select(slot)
  64. turtle.placeUp()
  65. return
  66. end
  67. slot = slot + 1
  68. end
  69. end
  70.  
  71. local bottom=10
  72. local top=70
  73. offset=5
  74. local y=10
  75. refuel()
  76.  
  77. while y <= top do
  78. print(turtle.getFuelLevel())
  79. place_down()
  80. up()
  81. y = y+1
  82. end
  83. forward()
  84. offset=9
  85. while y >= bottom do
  86. down()
  87. place_up()
  88. y=y-1
  89. end
  90.  
  91. forward()
  92. offset=13
  93. while y <= top do
  94. place_down()
  95. up()
  96. y=y+1
  97. end
  98.  
  99. forward()
  100. while y >= bottom do
  101. down()
  102. y=y-1
  103. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement