Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- terraform flattens land
- ]]--
- X_SIZE = 3
- Z_SIZE = 3
- FUEL_SLOT = 1
- function checkFuel()
- if turtle.getFuelLevel() < 80 then
- print("Refueling...")
- turtle.select(FUEL_SLOT)
- turtle.refuel(1)
- end
- end
- function dig()
- checkFuel()
- while turtle.detect() do
- print("Digging")
- turtle.dig()
- end
- end
- function clearBlock()
- y = 0
- dig()
- turtle.forward()
- while turtle.detectUp() do
- print("Found block above, going up")
- y = y + 1
- turtle.digUp()
- turtle.up()
- end
- print("Coming back down")
- for i = 0, y do
- turtle.down()
- end
- end
- function clearRow()
- for z = 1, Z_SIZE do
- print("Clear row", z)
- clearBlock()
- end
- end
- x = 0
- repeat
- clearRow()
- x = x + 1
- turtle.turnRight()
- clearBlock()
- turtle.turnRight()
- clearRow()
- x = x + 1
- turtle.turnLeft()
- clearBlock()
- turtle.turnLeft()
- until x >= X_SIZE
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement