Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Script made by Oysi
- local args = {...}
- local x = tonumber(args[1]) or 1
- local y = tonumber(args[2]) or 1
- local z = tonumber(args[3]) or 1
- function mineForward()
- if turtle.detect() then
- turtle.dig()
- end
- if not turtle.forward() then
- sleep(0.1)
- mineForward()
- return true
- end
- end
- function mineUp()
- if turtle.detectUp() then
- turtle.digUp()
- end
- if not turtle.up() then
- sleep(0.1)
- mineUp()
- return true
- end
- end
- function mineUpAndDown()
- local i = 0
- for k = 1, y - 1 do
- i = k
- if mineUp() then
- break
- end
- end
- for k = 1, i do
- turtle.down()
- end
- end
- function mineForwardProblem()
- local problem = mineForward()
- if not problem then
- mineUpAndDown()
- end
- end
- function turnLeft()
- repeat until turtle.turnLeft()
- end
- function turnRight()
- repeat until turtle.turnRight()
- end
- mineUpAndDown()
- for i = 1, x do
- for j = 1, z - 1 do
- mineForwardProblem()
- end
- local f = i%2 == 0 and turnLeft or turnRight
- if i < x then
- f()
- mineForwardProblem()
- f()
- end
- end
- if x % 2 == 0 then
- turnRight()
- for i = 1, x - 1 do
- mineForward()
- end
- turnRight()
- else
- turnLeft()
- for i = 1, x - 1 do
- mineForward()
- end
- turnLeft()
- for i = 1, z - 1 do
- mineForward()
- end
- turnLeft()
- turnLeft()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement