Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- t = turtle
- function check()
- if (t.getItemCount(16) > 0) then
- return true
- else
- return false
- end
- end
- function clear()
- if (t.detectDown()) then t.digDown() end
- t.select(1)
- t.placeDown()
- for i = 2, 16, 1 do
- t.select(i)
- t.dropDown()
- end
- end
- function digging()
- while (t.detect()) do
- t.dig()
- sleep(0.5)
- end
- if (check()) then clear() end
- t.forward()
- while (t.detectUp()) do
- t.digUp()
- sleep(0.5)
- end
- if (check()) then clear() end
- if (t.detectDown()) then t.digDown() end
- if (check()) then clear() end
- end
- print ('Length?')
- distance = tonumber(read())
- for i = 1, distance, 1 do
- digging()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement