local function scrollTo(itemName) for i = 1, 16 do local item = turtle.getItemDetail(i) if item and item.name == "minecraft:" .. itemName then turtle.select(i) return true end end return false end while true do local bucketAvailable = scrollTo("bucket") if not bucketAvailable then print("No buckets available, sleeping.") os.sleep(60) goto continue -- Skip to the next iteration end local placeSuccess = turtle.place() if placeSuccess then scrollTo("lava_bucket") turtle.dropDown() scrollTo("bucket") end turtle.turnRight() os.sleep(1) ::continue:: end