function depo() throw_shit() refuel() end function findslot(name,skipg) skipg = skipg or false if name == "minecraft:grass_block" then name = "minecraft:dirt" end if name == "minecraft:coal_ore" then name = "minecraft:coal" end if name == "minecraft:redstone_ore" then name = "minecraft:redstone" end if name == "minecraft:lapis_ore" then name = "minecraft:lapis_lazuli" end if name == "minecraft:emerald_ore" then name = "minecraft:emerald" end if name == "minecraft:diamond_ore" then name = "minecraft:diamond" end if name == "minecraft:stone" then name = "minecraft:cobblestone" end if name == "minecraft:cobweb" then name = "minecraft:string" end if name == "minecraft:gravel" then return 1 end if name then firstempty = false for i = 1,16 do slotitem = turtle.getItemDetail(i) if slotitem then if name == slotitem.name then if slotitem.count < 64 then return i end end else if not firstempty then firstempty = i end end end if firstempty then return firstempty end return false end return 1 end function tablelength(T) local count = 0 for _ in pairs(T) do count = count + 1 end return count end -- vvv fuel limit removed, replace true with function refuel() print(turtle.getFuelLevel()) if turtle.getFuelLevel() < 60 then found = find("minecraft:coal") if found then turtle.select(found) turtle.refuel(1) end end end intebajs = {'minecraft:diamond', 'minecraft:iron_ore', 'minecraft:gold_ore', 'minecraft:emerald', 'minecraft:obsidian', 'minecraft:coal'} function in_list (tab, val) for index, value in ipairs(tab) do if value == val then return true end end return false end function throw_shit() for i = 1,16 do sname = turtle.getItemDetail(i) if sname then if not in_list(intebajs,sname.name) then turtle.select(i) turtle.dropDown() end end end end function find(name) for i = 1,16 do sname = turtle.getItemDetail(i) if sname then sname = sname.name if name == sname then return i end end end return false end function findnextslot() for i = 1,16 do if turtle.getItemCount(i) ~= 0 then return i end end end function mine() refuel() itemsuc,item = turtle.inspectUp() if item["name"] == "minecraft:bedrock" then turtle.back() turtle.up() turtle.up() turtle.up() turtle.up() turtle.up() turtle.up() turtle.up() turtle.up() os.reboot() end if itemsuc then --print(item["name"]) slot = findslot(item["name"]) if slot then turtle.select(slot) turtle.digUp() else depo() turtle.select(1) turtle.digUp() end end itemsuc,item = turtle.inspectDown() if item["name"] == "minecraft:bedrock" then turtle.up() turtle.up() turtle.up() turtle.up() turtle.up() turtle.up() turtle.up() turtle.up() os.reboot() end if itemsuc then slot = findslot(item["name"]) if slot then turtle.select(slot) turtle.digDown() else depo() turtle.select(1) turtle.digDown() end end itemsuc,item = turtle.inspect() if item["name"] == "minecraft:bedrock" then turtle.up() turtle.up() turtle.up() turtle.up() turtle.up() turtle.up() turtle.up() turtle.up() os.reboot() end --print(item) if itemsuc then slot = findslot(item["name"]) if slot then turtle.select(slot) turtle.dig() else depo() turtle.select(1) turtle.dig() end end suc = turtle.forward() return suc end function digd(x) if x < 3 then for i = 0,x do turtle.digDown() turtle.down() end return 0 else for i = 0,3 do turtle.digDown() turtle.down() end return x - 3 end end xl = 2 yl = 12 de = 3 function walk (len) x = 0 while x < len do if mine() then x = x + 1 end end end while de ~= 0 do for xw = 1,xl do refuel() for yw = 1,yl-1 do walk(1) end turtle.turnRight() walk(1) turtle.turnRight() for yw = 1,yl-1 do walk(1) end if xw ~= xl then turtle.turnLeft() walk(1) turtle.turnLeft() else if zw ~= de then turtle.digUp() turtle.turnRight() for bajs = 0,(xl*2)-1 do turtle.forward() end turtle.turnRight() de = digd() end end end end