Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local arg = { ... }
- local width = tonumber(arg[1])
- local height = tonumber(arg[2])
- local length = tonumber(arg[3])
- function handleFuel()
- if turtle.getFuelLevel() == 0 then
- while not turtle.refuel(1) do
- print('insert fuel in slot 1')
- end
- end
- end
- function moveForward()
- handleFuel()
- turtle.forward()
- end
- function moveUp()
- handleFuel()
- turtle.up()
- end
- function digArea()
- turtle.dig()
- moveForward()
- for y = 1, height do
- for x = 1, width do
- for z = 1, length-1 do
- turtle.dig()
- moveForward()
- end
- if x < width then
- if x % 2 == 1 then
- turtle.turnRight()
- turtle.dig()
- moveForward()
- turtle.turnRight()
- else
- turtle.turnLeft()
- turtle.dig()
- moveForward()
- turtle.turnLeft()
- end
- end
- end
- if y < height then
- turtle.digUp()
- moveUp()
- turtle.turnRight()
- turtle.turnRight()
- end
- end
- end
- digArea()
Add Comment
Please, Sign In to add comment