farming turtle commands --[[ --- 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 farming turtle commands How to get it for free? farming turtle commands -- DO NOT TOUCH local args = {...}; local routes = 1; local firstTime = true; function refuel() local fueled = turtle.getFuelLevel() > 160; if not fueled then turtle.turnRight(); farming turtle commands How to get it for free? farming turtle commands 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 farming turtle commands How to dowload it? farming turtle commands end end end turtle.down(); turtle.turnRight(); turtle.turnRight(); end turtle.select(1); print('Fuel Level -> ' .. turtle.getFuelLevel()); return fueled; farming turtle commands How to get it? farming turtle commands 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 farming turtle commands How to get it for free? farming turtle commands forceForward(); if (x % 2 == 0) then turtle.turnRight(); forceForward(); turtle.turnRight(); else turtle.turnLeft(); forceForward(); turtle.turnLeft(); end farming turtle commands How to dowload it? farming turtle commands end end function goBackHome() turtle.forward(); if DIMENSION.x % 2 == 0 then turtle.turnRight(); forceForward(); turtle.turnRight(); forceForward(); farming turtle commands How to get it? farming turtle commands 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 farming turtle commands How to get it? farming turtle commands function clearPath() function clear(row, column) forceForward(); if turtle.detectUp() then turtle.digUp(); end end traversePath(clear) goBackHome(); end farming turtle commands How to get it? farming turtle commands 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 farming turtle commands How to get it for free? farming turtle commands end end end return planted; end function checkCrops() print("Checking crops..."); turtle.up(); function check(row, column) farming turtle commands How to get it? farming turtle commands 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 farming turtle commands How to get it? farming turtle commands end turtle.suckDown(); end traversePath(check) goBackHome(); end function saveCrops() turtle.turnRight(); turtle.turnRight(); farming turtle commands PasteShr farming turtle commands 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 farming turtle commands How to use it? farming turtle commands 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 farming turtle commands PasteShr farming turtle commands if not turtle.drop(64) then print("Cant drop items.. trying again...") break end end end turtle.turnRight(); turtle.turnRight(); turtle.select(1); end farming turtle commands How to use it? farming turtle commands 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(); farming turtle commands How to get it? farming turtle commands firstTime = false; end checkCrops(); saveCrops(); end textutils.slowPrint('Sleeping for 2 minutes....'); print("--") os.sleep(120); routes = routes + 1; shell.run('clear') farming turtle commands How to use it? farming turtle commands end farming turtle commands