Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- inp = 0
- local main = 1
- if turtle.getItemDetail(16) == false 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()
- if turtle.getItemCount(15) > 0 then
- aboutface()
- turtle.select(15)
- turtle.place()
- aboutface()
- turtle.select(1)
- else
- print("No torches")
- end
- end
- local function itemdump()
- if turtle.getItemCount(14) > 0 or main == 0 then
- turtle.up()
- aboutface()
- 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
- turtle.digDown()
- turtle.down()
- end
- end
- end
- local function digcheck()
- if turtle.inspect() then
- turtle.dig()
- digcheck()
- end
- end
- local function digsides()
- turtle.turnRight()
- digcheck()
- aboutface()
- digcheck()
- turtle.turnRight()
- end
- local function digwall()
- for x=1,2 do
- turtle.up()
- end
- digcheck()
- turtle.forward()
- digsides()
- for x = 1, 2 do
- turtle.digDown()
- turtle.down()
- digsides()
- end
- end
- inp = io.read()
- for x = 1,inp do
- digwall()
- print(x)
- if (x%7) == 0 then
- placetorch()
- else if x == 1 then
- aboutface()
- turtle.select(16)
- turtle.place()
- aboutface()
- end
- itemdump()
- end
- main = 0
- itemdump()
- print("Mining done")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement