Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- inp = 0
- local main = 1
- if turtle.getItemCount(16) == 0 then
- print("No chest in slot 16")
- else
- print("Chest detected")
- chest = turtle.getItemDetail(16)["name"]
- end
- local function aboutface()
- turtle.turnLeft()
- turtle.turnLeft()
- end
- local function placetorch(fag)
- if turtle.getItemCount(fag) > 0 then
- turtle.select(fag)
- turtle.placeDown()
- turtle.select(1)
- else
- print("No torches")
- end
- end
- local function itemdump(iter)
- if turtle.getItemCount(14) > 0 or main == 0 then
- turtle.back()
- if (iter%2) == 1
- turtle.turnRight()
- else
- turtle.turnLeft()
- end
- end
- local b, t =turtle.inspectDown()
- while t.name ~= chest do
- if t.name ~= chest then
- turtle.forward()
- end
- b,t = turtle.inspectDown()
- end
- for x=1,14 do
- turtle.select(x)
- turtle.dropDown()
- end
- turtle.select(1)
- if main > 0 then
- aboutface()
- while turtle.inspect() == false do
- turtle.forward()
- end
- firstiter(iter)
- end
- end
- end
- local function digcheck()
- if turtle.inspect() then
- turtle.dig()
- digcheck()
- else
- turtle.forward()
- end
- end
- local function dig()
- digcheck()
- turtle.digUp()
- turtle.digDown()
- end
- local function FirstIter(iter)
- turtle.up()
- if iter == 1 then
- placetorch(16)
- end
- dig()
- turtle.turnRight()
- dig()
- end
- local function digwall(iter)
- if iter == 1 then
- FirstIter(iter)
- else
- if (iter%2) == 0 then
- turtle.turnLeft()
- dig()
- turtle.turnLeft()
- for x = 1,2 do
- dig()
- end
- else
- turtle.turnRight()
- dig()
- turtle.turnRight()
- for x = 1,2 do
- dig()
- end
- end
- end
- end
- inp = io.read()
- for x = 1,inp do
- digwall(x)
- print(x)
- if (x%7) == 0 then
- placetorch(15)
- end
- itemdump(x)
- end
- main = 0
- itemdump(x)
- print("Mining done")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement