Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local args = {...}
- if #args < 3 then
- print("Usage: cubeMine <width> <depth> <height>")
- return
- end
- local width = tonumber(args[1])
- local depth = tonumber(args[2])
- local height = tonumber(args[3])
- local function mineRow(steps)
- for i = 1, steps do
- while turtle.detect() do
- turtle.dig()
- end
- turtle.forward()
- end
- end
- local function mineCube(width, depth, height)
- for j = 1, height do
- for i = 1, width do
- mineRow(depth - 1)
- if i ~= width then
- if i % 2 == 1 then
- turtle.turnLeft()
- mineRow(1)
- turtle.turnLeft()
- else
- turtle.turnRight()
- mineRow(1)
- turtle.turnRight()
- end
- end
- end
- if j ~= height then
- turtle.digDown()
- turtle.down()
- turtle.turnRight()
- turtle.turnRight()
- end
- end
- end
- mineCube(width, depth, height)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement