Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- emptyInv = function()
- while(1) do
- if not turtle.detectUp() then
- turtle.up()
- else
- local steps = 0
- turtle.turnRight()
- turtle.turnRight()
- while(1) do
- if not turtle.detect() then
- turtle.forward()
- steps = steps + 1
- else
- for i = 1,16,1 do
- turtle.select(i)
- turtle.dropUp()
- end
- break
- end
- end
- turtle.turnRight()
- turtle.turnRight()
- for j = 1,(steps+1),1 do
- turtle.forward()
- end
- break
- end
- end
- end
- local arg = {...}
- emptyInv()
- for i = 1,arg[1],1 do
- while(1) do
- turtle.select(1)
- if turtle.detectDown() and turtle.digDown() then
- elseif not turtle.detectDown() then
- else
- emptyInv()
- break
- end
- if turtle.getItemCount(16) > 0 then
- emptyInv()
- end
- turtle.down()
- end
- while turtle.detect() do
- turtle.dig()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement