Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- blockSlot = 1
- fuelSlot = 16
- args = {...}
- size = tonumber(args[1])
- buildingBlockID = turtle.getItemDetail(1).name
- facing = "north"
- function placeBlockSlot()
- blockSlot = 0
- repeat
- blockSlot = blockSlot + 1
- if turtle.getItemDetail(blockSlot) ~= buildingBlockID then
- turtle.drop()
- if blockSlot > 1 then
- blockSlot = blockSlot - 1
- end
- end
- until(turtle.getItemCount(blockSlot) > 0)
- turtle.select(blockSlot)
- turtle.placeDown()
- end
- function checkRefuel()
- if turtle.getFuelLevel() == 0 then
- turtle.select(fuelSlot)
- if turtle.getItemCount() > 0 then
- turtle.refuel(1)
- else
- fuelSlot = fuelSlot + 1
- turtle.refuel(1)
- running = false
- end
- end
- end
- function layLines(num)
- currentNum = 0
- repeat
- checkRefuel()
- turtle.forward()
- turtle.dig()
- turtle.digDown()
- placeBlockSlot()
- currentNum = currentNum + 1
- until(currentNum >= num)
- --Ends on top of last block
- end
- function layRim(rimSize)
- side = 0
- repeat
- layLines(rimSize)
- turtle.turnRight()
- side = side + 1
- until(side == 4)
- side = 0
- --Ends on bottom left most corner
- turtle.turnRight()
- turtle.forward()
- turtle.turnLeft()
- turtle.forward()
- --Gets to bottom left of next rim.
- repeat
- layLines(rimSize - 2)
- turtle.turnRight()
- side = side + 1
- until(side == 4)
- end
- checkRefuel()
- turtle.digUp()
- turtle.up()
- repeat
- layRim(size)
- size = size - 2
- checkRefuel()
- turtle.digUp()
- turtle.up()
- until(size <= 0)
- placeBlockSlot()
- --pastebin get rTFAD0YE
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement