SolvedHow-toUpdated

The Farmer Was Replaced: My Solutions for Every Master Achievement, Full Automation, And…

Short answer

This contains the set of scripts I wrote which managed to earn every master achievement, full automation, and additional experimental designs that were built through trial and error.

Steam Community guide by balls.

Notes

I'd imagine these are not the most optimized solutions out there, but are the ones that I managed to figure out after enough trial and error which earned all eight master achievements, plus full automation, so I wanted to share them in case they might be useful to anyone else.
If anyone is interested in using these, I wrote them to be able to both run through main or individually. The utils module is required for all scripts, but if you just want to use one in particular, main is only optional and can be ignored to avoid unnecessary dependencies. This does not apply to the full automation script.
To use the full automation script, while main still isn't needed, utils and all other resource scripts are required for it to run, including weird_substance. It's slightly inconvenient if this is the only achievement you're after due to this, but it'll still work reliably to earn the achievement in a timely run.
The dependencies needed for full automation are utils, hay, wood, carrot, pumpkin, sunflower, cactus, weird_substance, maze, and bone.
Any scripts contained in the experimental section are written and designed under the assumption that all unlocks have been obtained. They might still work with different configurations, but haven't had protections added or testing done for compatibility. You're free to try using them at any stage of the game, but if you experience errors with these and don't have everything unlocked, the non-experimental versions of them should work without any trouble and will be more than sufficient.
For each resource specifically, the highest rates per minute I've seen while using these are:

  • Hay: 709m, 1.12b (experimental version)
  • Wood: 2.08b
  • Carrot: 469m
  • Pumpkin: 31.3m
  • Cactus: 59.7m, 67.1m (experimental version)
  • Bone: 2.3m
  • Power: 42k (no fertilizer), 44.3k (with fertilizer)
  • Gold: 6.02m, 6.16m (experimental version)
    For fastest reset, the best time I've seen with the full automation script shown is:
  • 1h 7m 57.65s
    If you have questions about anything, please let me know.

main

import hay, wood, carrot, pumpkin, sunflower, cactus
import bone, weird_substance, maze
crops = {
Items.Hay: {
"collect": hay.collect,
"ratio": 1,
"ignore": False
},
Items.Wood: {
"collect": wood.collect,
"ratio": 1,
"ignore": False
},
Items.Carrot: {
"collect": carrot.collect,
"ratio": 2,
"ignore": False
},
Items.Pumpkin: {
"collect": pumpkin.collect,
"ratio": 2,
"ignore": False
},
Items.Cactus: {
"collect": cactus.collect,
"ratio": 2,
"ignore": False
},
Items.Bone: {
"collect": bone.collect,
"ratio": 1000,
"ignore": False
},
Items.Weird_Substance: {
"collect": weird_substance.collect,
"ratio": 1000,
"ignore": False
},
Items.Gold: {
"collect": maze.start_maze,
"ratio": 10,
"ignore": False
},
Items.Power: {
"collect": sunflower.collect,
"ratio": 1000,
"ignore": False
}
}
def main():
clear()
while True:
next_crop = None
quantity = None
for crop in crops:
item = crops[crop]
num = num_items(crop) * item["ratio"]
ignore = item["ignore"]
if not ignore:
if not next_crop or num < quantity:
quantity = num
next_crop = crop
crops[next_crop]"collect"
if name == "main":
main()

utils

TILLED = [
Entities.Carrot,
Entities.Pumpkin,
Entities.Cactus,
Entities.Sunflower
]
def harvest_():
if can_harvest():
return harvest()
return False
def basic_grid(size, crop, fertilize=False):
columns = max_drones()
available = [Entities.Grass]
unlocks = {
Unlocks.Plant: Entities.Bush,
Unlocks.Trees: Entities.Tree,
Unlocks.Carrots: Entities.Carrot
}
for unlock in unlocks:
if num_unlocked(unlock) > 0:
available.append(unlocks[unlock])
alternates = []
for entity in available:
if entity != crop:
alternates.append(entity)
if columns > size:
columns = size
def basic_column(size, crop, fertilize):
for _ in range(size):
x, y = get_pos_x(), get_pos_y()
viable = True
if alternates:
viable = (x + y) % 2 == 0
if viable:
if not can_harvest():
water()
harvest_()
plant_(crop)
if fertilize:
use_item(Items.Fertilizer)
else:
idx = (x + y) % len(alternates)
alternate = alternates[idx]
harvest_()
plant_(alternate)
move(North)
if fertilize:
for _ in range(size):
harvest_()
move(North)
for _ in range(size):
if not spawn_drone(basic_column, size, crop, fertilize):
basic_column(size, crop, fertilize)
move(East)
def plant_(crop):
if crop and not is_entity(crop):
till_(crop)
if crop == Entities.Grass:
return True
return plant(crop)
return True
def replant(crop):
if is_entity(crop) and harvest_():
plant_(crop)
def till_(crop=None):
is_soil = get_ground_type() == Grounds.Soil
if crop in TILLED:
if not is_soil:
till()
elif crop == Entities.Grass:
if is_soil:
till()
elif not crop:
if is_soil:
till()
def water(min_level=0.5, max_level=1):
current_level = get_water()
if current_level < min_level:
diff = max_level - current_level
water_count = diff // 0.25
water_count += diff % 0.25 > 0
use_item(Items.Water, water_count)
def check_cost(name):
cost = get_cost(name)
for item in cost:
if num_items(item) < cost[item]:
return False
return True
def is_entity(entity):
return get_entity_type() == entity
def wait(milliseconds):
seconds = milliseconds / 1000
time = get_time() + seconds
while get_time() < time:
pass
def move_pos(x, y):
while x != get_pos_x():
if x > get_pos_x():
if not move(East):
return False
if x < get_pos_x():
if not move(West):
return False
while y != get_pos_y():
if y > get_pos_y():
if not move(North):
return False
if y < get_pos_y():
if not move(South):
return False
return True
def quick_pos(x, y):
world_size = get_world_size()
dx = (x - get_pos_x()) % world_size
dy = (y - get_pos_y()) % world_size
if dx <= world_size // 2:
x_dir = East
x_steps = dx
else:
x_dir = West
x_steps = world_size - dx
if dy <= world_size // 2:
y_dir = North
y_steps = dy
else:
y_dir = South
y_steps = world_size - dy
for _ in range(x_steps):
if not move(x_dir):
return False
for _ in range(y_steps):
if not move(y_dir):
return False
return True
def reverse_dir(dir):
if dir == North:
return South
elif dir == South:
return North
elif dir == East:
return West
elif dir == West:
return East
else:
return None
def random_hat():
hats = list(Hats)
if Hats.Dinosaur_Hat in hats:
hats.remove(Hats.Dinosaur_Hat)
for hat in list(hats):
if not num_unlocked(hat):
hats.remove(hat)
hat = random() * len(hats) // 1
change_hat(hats[hat])

hay

import utils
def main():
if not utils.quick_pos(0, 0):
clear()
laps = None
collect(laps)
def collect(laps=get_world_size()):
world_size = get_world_size()
planting = num_unlocked(Unlocks.Plant) > 0
columns = max_drones()
y = 0
if not planting or max_drones() < 4:
utils.basic_grid(world_size, Entities.Grass)
return
if columns > world_size:
columns = world_size
for x in range(columns):
if not spawn_drone(start_column, world_size, x, y, laps):
start_column(world_size, x, y, laps)
def start_column(world_size, x, y, laps):
companions = {}
utils.quick_pos(x, y)
utils.wait(random() * 100)
if not laps:
laps = None
if x % 4 != 0:
for _ in range(world_size):
plant(Entities.Bush)
move(North)
for _ in range(x % 4):
move(West)
x -= x % 4
while laps or laps == None:
for y in range(world_size):
if utils.is_entity(Entities.Grass):
while not can_harvest():
pass
harvest()
if y in companions:
utils.plant_(companions[y])
companions.pop(y)
else:
if not utils.is_entity(Entities.Grass):
utils.till_(Entities.Grass)
check_companion(x, y, companions)
move(North)
if laps:
laps -= 1
def check_companion(x, y, companions):
companion = get_companion()
if companion:
plant_type, (cx, cy) = companion
if cx == x and cy > y:
if cy not in companions:
companions[cy] = plant_type
if name == "main":
main()

wood

import utils
def main():
if not utils.quick_pos(0, 0):
clear()
laps = None
collect(laps)
def collect(laps=get_world_size()):
world_size = get_world_size()
polyculture = num_unlocked(Unlocks.Polyculture) > 0
columns = max_drones()
y = 0
if not polyculture or max_drones() < 8:
if num_unlocked(Unlocks.Trees) > 0:
crop = Entities.Tree
else:
crop = Entities.Bush
utils.basic_grid(world_size, crop)
return
if columns > world_size:
columns = world_size
for x in range(columns):
if not spawn_drone(start_column, world_size, x, y, laps):
start_column(world_size, x, y, laps)
def start_column(world_size, x, y, laps):
companions = {}
utils.quick_pos(x, y)
if not laps:
laps = None
while laps or laps == None:
for y in range(world_size):
viable = (x + y) % 2 == 0
if viable:
if utils.is_entity(Entities.Tree):
utils.water(0.75)
if not can_harvest():
plant_companion(world_size, x, y)
if can_harvest():
harvest()
if y in companions:
if utils.is_entity(Entities.Bush):
harvest()
utils.plant_(companions[y])
companions.pop(y)
elif viable:
plant(Entities.Tree)
check_companion(x, y, companions)
elif utils.is_entity(None):
plant(Entities.Bush)
move(North)
if laps:
laps -= 1
def plant_companion(world_size, x, y):
companion = get_companion()
if not companion:
return
plant_type, (cx, cy) = companion
if (cx + cy) % 2 != 0:
utils.quick_pos(cx, cy)
if utils.is_entity(Entities.Bush):
harvest()
if not utils.plant_(plant_type):
utils.till_(Entities.Grass)
utils.quick_pos(x, y)
def check_companion(x, y, companions):
companion = get_companion()
if companion:
plant_type, (cx, cy) = companion
if cx == x:
if cy not in companions:
companions[cy] = plant_type
if name == "main":
main()

carrot

import utils
def main():
if not utils.quick_pos(0, 0):
clear()
laps = None
collect(laps)
def collect(laps=get_world_size()):
world_size = get_world_size()
polyculture = num_unlocked(Unlocks.Polyculture) > 0
columns = max_drones()
y = 0
if not polyculture or max_drones() < 8:
utils.basic_grid(world_size, Entities.Carrot)
return
if columns > world_size:
columns = world_size
for x in range(columns):
if not spawn_drone(start_column, world_size, x, y, laps):
start_column(world_size, x, y, laps)
def start_column(world_size, x, y, laps):
companion_list = [
Entities.Grass, Entities.Bush, Entities.Tree
]
companions = {}
utils.quick_pos(x, y)
utils.wait(random() * 100)
if not laps:
laps = None
if x % 4 != 0:
for _ in range(world_size):
if get_entity_type() not in companion_list:
harvest()
utils.till_(Entities.Grass)
move(North)
for _ in range(x % 4):
move(West)
x -= x % 4
while laps or laps == None:
for y in range(world_size):
if utils.is_entity(Entities.Carrot):
utils.water(0.75)
plant_companion(x, y)
while not can_harvest():
if not utils.is_entity(Entities.Carrot):
break
utils.water(0.9)
utils.wait(random() * 100)
harvest()
if y in companions:
utils.plant_(companions[y])
companions.pop(y)
else:
utils.plant_(Entities.Carrot)
check_companion(x, y, companions)
move(North)
if laps:
laps -= 1
def plant_companion(x, y):
companion = get_companion()
if not companion:
return False
plant_type, (cx, cy) = companion
if cx % 4 != 0:
utils.quick_pos(cx, cy)
if not utils.is_entity(plant_type):
harvest()
if not utils.plant_(plant_type):
utils.till_(False)
utils.quick_pos(x, y)
return True
def check_companion(x, y, companions):
companion = get_companion()
if companion:
plant_type, (cx, cy) = companion
if cx == x and cy > y:
if cy not in companions:
companions[cy] = plant_type
if name == "main":
main()

pumpkin

import utils
def main():
if not utils.quick_pos(0, 0):
clear()
section_size = 8
harvest_count = None
collect(section_size, harvest_count)
def collect(section_size=False, harvest_count=1):
world_size = get_world_size()
partition_pumpkins(world_size, section_size, harvest_count)
while num_drones() > 1:
utils.wait(10)
def partition_pumpkins(world_size, section_size, harvest_count):
if not section_size:
section_size = world_size + 1
pumpkin_size = section_size - 1
pumpkins_per_axis = (world_size + 1) // section_size
pumpkins_per_grid = pumpkins_per_axis ** 2
drone_count = max_drones() // pumpkins_per_grid
if drone_count > pumpkin_size:
drone_count = pumpkin_size
for col in range(pumpkins_per_axis):
for row in range(pumpkins_per_axis):
x = row * section_size
y = col * section_size
if col == pumpkins_per_axis - 1 and x == y:
start_pumpkin(x, y, drone_count, pumpkin_size, harvest_count)
else:
while not spawn_drone(
start_pumpkin, x, y, drone_count, pumpkin_size, harvest_count
):
utils.wait(10)
def start_pumpkin(x, y, drone_count, pumpkin_size, harvest_count):
drones = 0
for idx in range(drone_count):
pumpkin_range = pumpkin_size // drone_count
pumpkin_remainder = pumpkin_size % drone_count
if pumpkin_remainder:
if drones < pumpkin_remainder:
pumpkin_range += 1
if idx == drone_count - 1:
harvest_pumpkin(x, y, pumpkin_range, pumpkin_size, harvest_count)
else:
while not spawn_drone(
harvest_pumpkin, x, y, pumpkin_range, pumpkin_size, harvest_count
):
utils.wait(10)
drones += 1
x += pumpkin_range
def harvest_pumpkin(x, y, pumpkin_range, pumpkin_size, harvest_count):
if not harvest_count:
harvest_count = -1
while harvest_count != 0:
tiles = plant_pumpkin(x, y, pumpkin_range, pumpkin_size)
if not tiles:
return
while tiles:
tiles = replant_pumpkin(tiles)
if tiles == False:
return
check_pumpkin(x, y, pumpkin_size)
if harvest_count:
harvest_count -= 1
def plant_pumpkin(x, y, pumpkin_range, pumpkin_size):
forward = North
tiles = []
utils.quick_pos(x, y)
for width in range(pumpkin_range):
for length in range(pumpkin_size):
while not utils.is_entity(Entities.Pumpkin):
if not utils.plant_(Entities.Pumpkin):
harvest()
if not utils.check_cost(Entities.Pumpkin):
return False
y = get_pos_y()
tiles.append((x, y))
if length != pumpkin_size - 1:
move(forward)
forward = reverse_dir(forward)
if width != pumpkin_range - 1:
x += 1
move(East)
return tiles
def replant_pumpkin(tiles):
remaining = []
water_level = 0.6
if len(tiles) <= 8:
water_level = 0.8
if len(tiles) <= 1:
water_level = 1
for x, y in tiles:
utils.quick_pos(x, y)
if utils.is_entity(None):
return []
while not utils.is_entity(Entities.Pumpkin):
if not utils.plant_(Entities.Pumpkin):
harvest()
if not utils.check_cost(Entities.Pumpkin):
return False
if not can_harvest():
utils.water(water_level)
remaining.append((x, y))
return remaining
def check_pumpkin(x, y, pumpkin_size):
utils.quick_pos(x, y)
y_lower, y_upper = y, y + pumpkin_size - 1
y = y_upper
pumpkin_id = None
while measure() != pumpkin_id:
pumpkin_id = measure()
utils.quick_pos(x, y)
if not utils.check_cost(Entities.Pumpkin) or measure() == None:
break
else:
if y == y_lower:
y = y_upper
else:
y = y_lower
harvest()
def reverse_dir(dir):
if dir == North:
return South
elif dir == South:
return North
if name == "main":
main()

sunflower

import utils
MIN_PETALS = 13
MAX_PETALS = 15
def main():
if not utils.quick_pos(0, 0):
clear()
repeat = True
fertilize = False
collect(repeat, fertilize)
def collect(repeat=False, fertilize=False):
world_size = get_world_size()
start_delay = world_size * 0.03
end_delay = world_size * 0.4
start_time = get_time() + start_delay
end_time = start_time + end_delay
y = 0
if max_drones() < world_size // 2 or max_drones() <= 4:
simple_collect(world_size)
return
for x in range(world_size):
if not spawn_drone(
plant_column, x, y, world_size, start_time, end_time, repeat, fertilize
):
plant_column(x, y, world_size, start_time, end_time, repeat, fertilize)
utils.quick_pos(0, 0)
wait_for_drones()
def plant_column(x, y, world_size, start_time, end_time, repeat, fertilize):
utils.quick_pos(x, y)
while get_time() < start_time:
utils.wait(10)
for _ in range(world_size):
utils.till_(Entities.Sunflower)
plant_sunflower(MIN_PETALS, MAX_PETALS, end_time - 1, fertilize)
if get_time() > end_time - 1:
break
move(North)
harvest_size(x, y, MAX_PETALS, get_time(), end_time, repeat, fertilize)
def plant_sunflower(
min_petals=MIN_PETALS, max_petals=MAX_PETALS, end_time=None, fertilize=False
):
water_level = 0.4
utils.water(water_level)
while not valid_sunflower(min_petals, max_petals):
petal_size = measure()
if fertilize:
if petal_size and petal_size > max_petals:
while not can_harvest():
use_item(Items.Fertilizer)
harvest()
if end_time:
if get_time() > end_time:
break
if not utils.plant_(Entities.Sunflower):
if not utils.check_cost(Entities.Sunflower):
return False
def harvest_size(
x, y, petal_size, start_time, end_time=None, repeat=False, fertilize=False
):
world_size = get_world_size()
drones = max_drones()
utils.quick_pos(x, y)
while get_time() < start_time:
utils.wait(10)
for _ in range(world_size):
target = measure()
if target and target >= petal_size:

this doesn't burn through enough fertilizer

to be worth adding a toggle here for it

if not can_harvest():
use_item(Items.Fertilizer)
harvest()
if end_time:
min_petals = MIN_PETALS
max_petals = MAX_PETALS - 1
if get_time() < end_time:
plant_sunflower(min_petals, max_petals, end_time, fertilize)
move(North)
delay = (world_size * 0.11) / 2
start_time += delay
if end_time:
start_time = end_time + delay * 0.5
if petal_size > MIN_PETALS:
petal_size -= 1
end_time = None
harvest_size(x, y, petal_size, start_time, end_time, repeat, fertilize)
elif repeat:
end_time = start_time + world_size * 0.4
plant_column(x, y, world_size, start_time, end_time, repeat, fertilize)
def simple_collect(world_size):
min_petals = 13
max_petals = 15
y = 0
def simple_plant(x, y, world_size, min_petals, max_petals):
utils.quick_pos(x, y)
for _ in range(world_size):
while not valid_sunflower(min_petals, max_petals):
harvest()
if not utils.plant_(Entities.Sunflower):
if not utils.check_cost(Entities.Sunflower):
return
utils.water()
move(North)
simple_harvest(x, y, world_size, max_petals)
def simple_harvest(x, y, world_size, petal_size):
utils.quick_pos(x, y)
for _ in range(world_size):
target = measure()
if target and target >= petal_size:
harvest()
move(North)
for x in range(world_size):
if not spawn_drone(
simple_plant, x, y, world_size, min_petals, max_petals
):
simple_plant(x, y, world_size, min_petals, max_petals)
wait_for_drones()
for petal_size in range(max_petals - 1, min_petals - 1, -1):
for x in range(world_size):
if not spawn_drone(
simple_harvest, x, y, world_size, petal_size
):
simple_harvest(x, y, world_size, petal_size)
utils.quick_pos(0, 0)
wait_for_drones()
def wait_for_drones():
while num_drones() > 1:
utils.wait(10)
def valid_sunflower(min_petals, max_petals):
petal_size = measure()
if not petal_size:
return False
return min_petals <= petal_size <= max_petals
if name == "main":
main()

cactus

import utils
CACTUS_SIZE_RANGE = 10
def main():
if not utils.quick_pos(0, 0):
clear()
while True:
collect()
def collect(world_size=get_world_size()):
set_world_size(world_size)
columns = start_columns(world_size)
start_rows(world_size, columns)
harvest()
def start_columns(world_size):
drones = []
columns = {}
while num_drones() > 1:
utils.wait(10)
for x in range(world_size):
drone = spawn_drone(start_column, world_size, (x, 0))
if drone:
drones.append((x, drone))
else:
columns[x] = start_column(world_size, (x, 0))
utils.quick_pos(0, 0)
for pair in drones:
x, drone = pair
columns[x] = wait_for(drone)
return columns
def start_rows(world_size, columns):
for y in range(world_size):
if not spawn_drone(start_row, world_size, (0, y), columns):
start_row(world_size, (0, y), columns)
utils.quick_pos(0, 0)
while num_drones() > 1:
utils.wait(10)
def populate_sizes():
sizes = {}
for size in range(CACTUS_SIZE_RANGE):
sizes[size] = 0
return sizes
def start_column(world_size, pos):
crop = Entities.Cactus
column = populate_sizes()
biggest_size = 0
last_size = None
x, y = pos
utils.quick_pos(x, y)
for y in range(world_s

Did this work for you?

More for The Farmer Was Replaced

All The Farmer Was Replaced guides →

SolvedHow-to

From Zero to AFK Walkthrough: Starter Scripts + Full Auto Farm

Step-by-step walkthrough for players with no coding experience. Start with tiny paste-and-run scripts to farm hay, wood, and carrots. Unlock the coding basics, then switch to one full AFK main script that buys unlocks and grows into power, dinosaurs, mazes, and multi-drone farming.

SolvedHow-to

RoboCulture 101: Python for Beginners

✨ Updated for Release 1.0 ✨ Goal: To equip beginners with the foundational knowledge to ask informed questions and understand advanced programming tutorials (e.g., on YouTube). About This Guide: This workbook is for individuals new to coding who may face an experience paradox, where you have to…

SolvedHow-to

Unlocking the "Full Automation" Achievement: A Quick Workflow!

Goal: You’re one step away from platining the game—only the Full Automation achievement remains. Challenge: Not sure where to start or feeling unmotivated? No problem. Solution: Use this script as a skeleton to unlock the achievement. It’s compatible with the October 2025 update and can be…

#achievement

SolvedHow-to

Decimalist's Code

Collection of my code. Includes: Parallelization --- Cactus: Shakersort --- Sunflower: Buckets --- Pumpkin: Queue --- Polyculture: random Chain or special-crop --- Maze: Multidrone Cheese