cc tweaked farming turtle --[[ --- Basic Farm ---- 1. Refuel turtle with at least 8 coal only one time 2. Put any amount of seeds you want in the turtle inventory 3. Put 2 chest behind the turtle one on top of the other (Top chest has coal, bottom chest saves crops) 4. Place water base on the dimension size and clear the area from blocks ( farming turtles cant remove blocks, only flowers/grass/etc ) 5. Run the program [ default args [1]FirstTime = true ] --]] local DIMENSION = {x = 9, y = 9}; local SEEDS = {"minecraft:carrot", "minecraft:potato", "minecraft:wheat_seeds"} -- Put any seed you want cc tweaked farming turtle How to get it? cc tweaked farming turtle -- DO NOT TOUCH local args = {...}; local routes = 1; local firstTime = true; function refuel() local fueled = turtle.getFuelLevel() > 160; if not fueled then turtle.turnRight(); cc tweaked farming turtle How to get it for free? cc tweaked farming turtle turtle.turnRight(); turtle.up(); if turtle.suck(32) then print("Sarching for fuel..."); for i = 2, 16 do turtle.select(i) if turtle.refuel(0) then fueled = true; turtle.refuel(32); break cc tweaked farming turtle PasteShr cc tweaked farming turtle end end end turtle.down(); turtle.turnRight(); turtle.turnRight(); end turtle.select(1); print('Fuel Level -> ' .. turtle.getFuelLevel()); return fueled; cc tweaked farming turtle PasteShr cc tweaked farming turtle end function forceForward() while turtle.detect() do turtle.dig(); end turtle.forward(); end function traversePath(onTraverse) for x = 1, DIMENSION.x do for y = 1, DIMENSION.y do onTraverse(x, y) end cc tweaked farming turtle How to dowload it? cc tweaked farming turtle forceForward(); if (x % 2 == 0) then turtle.turnRight(); forceForward(); turtle.turnRight(); else turtle.turnLeft(); forceForward(); turtle.turnLeft(); end cc tweaked farming turtle PasteShr cc tweaked farming turtle end end function goBackHome() turtle.forward(); if DIMENSION.x % 2 == 0 then turtle.turnRight(); forceForward(); turtle.turnRight(); forceForward(); cc tweaked farming turtle PasteShr cc tweaked farming turtle turtle.turnLeft(); for x = 1, DIMENSION.x - 1 do forceForward(); end else for x = 1, DIMENSION.x do forceForward(); end turtle.turnLeft(); for y = 1, DIMENSION.y do forceForward(); end end turtle.turnLeft(); turtle.down(); end cc tweaked farming turtle PasteShr cc tweaked farming turtle function clearPath() function clear(row, column) forceForward(); if turtle.detectUp() then turtle.digUp(); end end traversePath(clear) goBackHome(); end cc tweaked farming turtle How to dowload it? cc tweaked farming turtle function plantCrops() local planted = false; for i = 1, 16 do local item = turtle.getItemDetail(i); if item ~= nil then for x = 1, #SEEDS do if item.name == SEEDS[x] then turtle.select(i); planted = turtle.placeDown(); end cc tweaked farming turtle How to get it for free? cc tweaked farming turtle end end end return planted; end function checkCrops() print("Checking crops..."); turtle.up(); function check(row, column) cc tweaked farming turtle How to get it? cc tweaked farming turtle forceForward(); local success, item = turtle.inspectDown(); if (success and item.state.age == 7) then turtle.digDown(); plantCrops(); elseif not success then if not plantCrops() then turtle.digDown(); plantCrops(); end cc tweaked farming turtle PasteShr cc tweaked farming turtle end turtle.suckDown(); end traversePath(check) goBackHome(); end function saveCrops() turtle.turnRight(); turtle.turnRight(); cc tweaked farming turtle How to dowload it? cc tweaked farming turtle turtle.select(1); local item = turtle.getItemDetail(1); if item ~= nil then local isSeed = false; for x = 1, #SEEDS do if item.name == SEEDS[x] then isSeed = true; end end if not isSeed then turtle.drop(64) end end cc tweaked farming turtle PasteShr cc tweaked farming turtle for i = 2, 16 do turtle.select(i); item = turtle.getItemDetail(i); if item ~= nil then local amount = turtle.getItemCount(i); for x = 1, #SEEDS do if item.name == SEEDS[x] then turtle.transferTo(1, amount) end end cc tweaked farming turtle PasteShr cc tweaked farming turtle if not turtle.drop(64) then print("Cant drop items.. trying again...") break end end end turtle.turnRight(); turtle.turnRight(); turtle.select(1); end cc tweaked farming turtle How to dowload it? cc tweaked farming turtle if args[1] ~= nil then firstTime = args[1] == "true"; end -- STARTS PROGRAM shell.run('clear') while true do term.setCursorPos(1, 1); print("--Starting farming process number: " .. routes) if refuel() then if firstTime then clearPath(); cc tweaked farming turtle How to get it for free? cc tweaked farming turtle firstTime = false; end checkCrops(); saveCrops(); end textutils.slowPrint('Sleeping for 2 minutes....'); print("--") os.sleep(120); routes = routes + 1; shell.run('clear') cc tweaked farming turtle How to get it for free? cc tweaked farming turtle end cc tweaked farming turtle