Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if #arg == 0 then
- arg = { ... }
- end
- local xSize, ySize, zSize = tonumber(arg[1]), tonumber(arg[2]), tonumber(arg[3])
- local function forward()
- repeat
- turtle.dig()
- until turtle.forward()
- end
- local function mineX()
- for _ = 1, xSize do
- turtle.digUp()
- turtle.digDown()
- forward()
- end
- turtle.digUp()
- turtle.digDown()
- end
- local function mineZ(y)
- for z = 1, zSize do
- mineX()
- if z == zSize then
- break
- end
- local d = 0
- -- only alternate if even z size
- if zSize % 2 == 0 then
- d = y - 1
- end
- if z % 2 ~= d then
- turtle.turnRight()
- forward()
- turtle.turnRight()
- else
- turtle.turnLeft()
- forward()
- turtle.turnLeft()
- end
- end
- end
- for y = 1, math.abs(ySize) do
- mineZ(y)
- turtle.turnRight()
- turtle.turnRight()
- if y == math.abs(ySize) then
- break
- end
- if ySize < 0 then
- for _ = 1, 3 do
- turtle.digDown()
- turtle.down()
- end
- else
- for _ = 1, 3 do
- turtle.digUp()
- turtle.up()
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement