Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function find(item, count)
- count = count or 1
- i =0
- while i ~= 16 do
- i = i+1
- turtle.select(i)
- local data = turtle.getItemDetail()
- if data then
- if(data.name == item and data.count >= count) then
- return true
- end
- end
- end
- return false;
- end
- leftBlocks = 0
- while true do
- local success, data = turtle.inspect()
- if success then
- turtle.dig()
- turtle.digDown()
- if leftBlocks % 10 == 0 then
- if find("minecraft:torch") then
- turtle.placeDown()
- end
- if find("minecraft:cobblestone",64) then
- turtle.drop()
- end
- end
- end
- if turtle.getFuelLevel() < 2 then
- find("minecraft:coal_block")
- turtle.refuel()
- end
- turtle.forward()
- leftBlocks = leftBlocks +1
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement