function depo() turtle.digUp() chestslot = find("minecraft:chest") if chestslot == false then print("out of chests!!!") end turtle.select(chestslot) turtle.placeUp() for slot = 1,16 do turtle.select(slot) item = turtle.getItemDetail(slot) if item then if item.name == "minecraft:chest" then elseif item.name == "minecraft:coal" then turtle.refuel() turtle.dropUp() else turtle.dropUp() end end end end function findslot(name,skipg) skipg = skipg or false 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 turtle.getFuelLevel() < 200 function refuel() print(turtle.getFuelLevel()) if true then found = find("minecraft:coal") if found then turtle.select(found) turtle.refuel() 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.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() itemsuc,item = turtle.inspectUp() if itemsuc then --print(item["name"]) slot = findslot(item["name"]) if slot then turtle.select(slot) turtle.digUp() else depo() end end itemsuc,item = turtle.inspectDown() if itemsuc then slot = findslot(item["name"]) if slot then turtle.select(slot) turtle.digDown() else depo() turtle.digDown() end end itemsuc,item = turtle.inspect() --print(item) if itemsuc then slot = findslot(item["name"]) if slot then turtle.select(slot) turtle.dig() else depo() turtle.dig() end end suc = turtle.forward() return suc end xl = 2 yl = 4 de = 3 function walk (len) x = 0 while x < len do if mine() then x = x + 1 end end end for zw = 0,de 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.digDown() turtle.down() turtle.digDown() turtle.down() turtle.digDown() turtle.down() turtle.turnRight() end end end end