Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- hi = 25
- dep = 25
- wid = 25
- whi = hi
- wdep = dep
- wwid = wid
- if turtle.dig() then
- end
- turtle.forward()
- turtle.turnLeft()
- secnd = 0
- stopdig = 0
- secndlk = 0
- if hi / 2 == math.floor(hi / 2) then
- turdigleft = 1
- elseif hi / 2 ~= math.floor(hi / 2) then
- turdigleft = 0
- end
- local function mantudir()
- secndlk = 0
- if secnd == 1 then
- if hi / 2 ~= math.floor(hi / 2) then
- if turdigleft == 1 then
- turdigleft = 0
- else
- turdigleft = 1
- end
- end
- secnd = 0
- secndlk = 1
- end
- if secndlk == 0 then
- secnd = 1
- end
- end
- local hidone = 0
- local function redrawdig()
- term.clear()
- term.setCursorBlink(false)
- term.setCursorPos(1,1)
- print("Depth: "..wdep)
- term.setCursorPos(1,2)
- print("Hight: "..whi)
- term.setCursorPos(1,3)
- print("Width: "..wwid)
- end
- redrawdig()
- local function turncurdig()
- if turdigleft == 0 then
- turtle.turnRight()
- mantudir()
- else
- turtle.turnLeft()
- mantudir()
- end
- end
- tddown = 1
- local function turndig()
- local i = hi
- while i > 1 do
- if turtle.detectDown() then
- turtle.digDown()
- end
- if turtle.down() then
- i = i - 1
- if i < 2 then
- tddown = 1
- end
- end
- end
- turncurdig()
- while turtle.detect() do
- turtle.dig()
- end
- turtle.forward()
- turncurdig()
- end
- while wdep > 0 do
- if stopdig == 0 then
- while whi > 0 do
- while wwid > 1 do
- while turtle.detect() do
- turtle.dig()
- end
- if turtle.forward() then
- wwid = wwid - 1
- end
- redrawdig()
- end
- if whi > 1 then
- while turtle.detectUp() do
- turtle.digUp()
- end
- if turtle.up() then
- hidone = hidone + 1
- end
- if turtle.turnLeft() then
- hidone = hidone + 1
- end
- if turtle.turnLeft() then
- hidone = hidone + 1
- end
- end
- wwid = wid
- if hidone > 2 or whi < 2 then
- whi = whi - 1
- else
- term.clear()
- term.setCursorPos(1,1)
- print("Error")
- shell.exit()
- end
- hidone = 0
- redrawdig()
- end
- end
- if wdep > 1 then
- turndig()
- end
- if tddown > 0 or wdep < 2 then
- wdep = wdep - 1
- tddown = 0
- end
- if wdep < 1 then
- stopdig = 1
- break
- end
- whi = hi
- redrawdig()
- end
Advertisement
Add Comment
Please, Sign In to add comment