Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local x = 8
- local y = 9
- local z = 4
- local fuel = turtle.getFuelLevel()
- local roomSize = x * y * z
- while fuel < roomSize do
- if not turtle.refuel(1) then
- print("Not enough fuel")
- return
- end
- end
- local direction = true
- for i = 1, z do
- for j = 1, y do
- for k = 1, x do
- turtle.dig()
- while not turtle.forward() do turtle.dig() end
- end
- if j < y then
- if direction then
- turtle.turnRight()
- turtle.dig()
- while not turtle.forward() do turtle.dig() end
- turtle.turnRight()
- direction = false
- else
- turtle.turnLeft()
- turtle.dig()
- while not turtle.forward() do turtle.dig() end
- turtle.turnLeft()
- direction = true
- end
- end
- end
- if i < z then
- turtle.digUp()
- while not turtle.up() do turtle.digUp() end
- turtle.turnRight()
- turtle.turnRight()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment