Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local FUEL_BOX = 1
- local STONE_BOX = 2
- local GLOW_STONE_BOX = 3
- local FUEL = 5
- local STONE = 6
- local GLOW_STONE = 7
- function addBlockIfRequired()
- if turtle.getItemCount(STONE) == 0 then
- turtle.select(STONE_BOX)
- turtle.placeUp()
- turtle.select(STONE)
- turtle.suckUp(64)
- turtle.select(STONE_BOX)
- turtle.digUp()
- end
- end
- function addGlowStoneBlockIfRequired()
- if turtle.getItemCount(GLOW_STONE) == 0 then
- turtle.select(GLOW_STONE_BOX)
- turtle.placeUp()
- turtle.select(GLOW_STONE)
- turtle.suckUp(64)
- turtle.select(GLOW_STONE_BOX)
- turtle.digUp()
- end
- end
- function refuelIfRequired()
- if turtle.getFuelLevel() < 1280 then
- turtle.select(FUEL_BOX)
- turtle.placeUp()
- turtle.select(FUEL)
- turtle.suckUp(64)
- turtle.refuel(64)
- turtle.select(FUEL_BOX)
- turtle.digUp()
- end
- end
- function place()
- addBlockIfRequired()
- turtle.select(STONE)
- turtle.placeDown()
- end
- function placeGlowStone()
- addGlowStoneBlockIfRequired()
- turtle.select(GLOW_STONE)
- turtle.placeDown()
- end
- function moveForward()
- refuelIfRequired()
- turtle.forward()
- end
- function moveLayerUp()
- turtle.up()
- turtle.turnRight()
- moveForward()
- turtle.turnLeft()
- moveForward()
- end
- local x = 1
- place()
- while true do
- moveLayerUp()
- for i=1,4 do
- turtle.turnLeft()
- for y=1,(x * 2) do
- moveForward()
- if (y + 1) % 8 < 3 or
- (y - (x * 2) + 1) % 8 < 3 then
- place()
- end
- if y % 8 == 4 and
- (y - x * 2) % 8 == 4 then
- placeGlowStone()
- end
- end
- end
- x = x + 1
- if x > 18 then
- break
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement