Advertisement
mmis1000

Untitled

Feb 2nd, 2021
293
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.89 KB | None | 0 0
  1. local FUEL_BOX = 1
  2. local STONE_BOX = 2
  3. local GLOW_STONE_BOX = 3
  4. local FUEL = 5
  5. local STONE = 6
  6. local GLOW_STONE = 7
  7.  
  8. function addBlockIfRequired()
  9. if turtle.getItemCount(STONE) == 0 then
  10. turtle.select(STONE_BOX)
  11. turtle.placeUp()
  12.  
  13. turtle.select(STONE)
  14. turtle.suckUp(64)
  15.  
  16. turtle.select(STONE_BOX)
  17. turtle.digUp()
  18. end
  19. end
  20.  
  21. function addGlowStoneBlockIfRequired()
  22. if turtle.getItemCount(GLOW_STONE) == 0 then
  23. turtle.select(GLOW_STONE_BOX)
  24. turtle.placeUp()
  25.  
  26. turtle.select(GLOW_STONE)
  27. turtle.suckUp(64)
  28.  
  29. turtle.select(GLOW_STONE_BOX)
  30. turtle.digUp()
  31. end
  32. end
  33.  
  34. function refuelIfRequired()
  35. if turtle.getFuelLevel() < 1280 then
  36. turtle.select(FUEL_BOX)
  37. turtle.placeUp()
  38.  
  39. turtle.select(FUEL)
  40. turtle.suckUp(64)
  41. turtle.refuel(64)
  42.  
  43. turtle.select(FUEL_BOX)
  44. turtle.digUp()
  45. end
  46. end
  47.  
  48. function place()
  49. addBlockIfRequired()
  50. turtle.select(STONE)
  51. turtle.placeDown()
  52. end
  53.  
  54. function placeGlowStone()
  55. addGlowStoneBlockIfRequired()
  56. turtle.select(GLOW_STONE)
  57. turtle.placeDown()
  58. end
  59.  
  60. function moveForward()
  61. refuelIfRequired()
  62. turtle.forward()
  63. end
  64.  
  65. function moveLayerUp()
  66. turtle.up()
  67. turtle.turnRight()
  68. moveForward()
  69. turtle.turnLeft()
  70. moveForward()
  71. end
  72.  
  73. local x = 1
  74.  
  75. place()
  76.  
  77. while true do
  78. moveLayerUp()
  79.  
  80. for i=1,4 do
  81. turtle.turnLeft()
  82. for y=1,(x * 2) do
  83. moveForward()
  84.  
  85. if (y + 1) % 8 < 3 or
  86. (y - (x * 2) + 1) % 8 < 3 then
  87. place()
  88. end
  89.  
  90. if y % 8 == 4 and
  91. (y - x * 2) % 8 == 4 then
  92. placeGlowStone()
  93. end
  94. end
  95. end
  96.  
  97. x = x + 1
  98.  
  99. if x > 18 then
  100. break
  101. end
  102. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement