Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- tArgs = {...}
- local length, height, width
- if #tArgs ~= 3 then
- print("Invalid number of arguments. Needs x y z")
- else
- length = tonumber(tArgs[1])
- height = tonumber(tArgs[2])
- width = tonumber(tArgs[3])
- end
- local upHigh = false
- function digZ()
- for z=1,height-1 do
- if not upHigh then
- while turtle.digUp() do sleep(0.5) end
- turtle.up()
- else
- while turtle.digDown() do end
- turtle.down()
- end
- end
- upHigh = not upHigh
- end
- function digForward()
- while turtle.dig() do sleep(0.5) end
- turtle.forward()
- end
- if length*width*height > turtle.getFuelLevel() then
- print("Not enough fuel")
- else
- digForward()
- digZ()
- for y = 1,width do
- for x = 1,length-1 do
- digForward()
- digZ()
- end
- if y < width then
- if y%2 ~= 0 then
- turtle.turnRight()
- digForward()
- digZ()
- turtle.turnRight()
- else
- turtle.turnLeft()
- digForward()
- digZ()
- turtle.turnLeft()
- end
- end
- end
- -- checks if the turtle ended up at the ceiling and sends it back to the floor
- if upHigh then
- while turtle.down() do end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment