下载客户端

我使用的所有代码

2026-02-18 22:00:36
发布在编程农场
转载

AI智能总结导读

这是玩家分享的游戏《The Farmer Was Replaced》的各类脚本代码,包含干草、木材、胡萝卜、向日葵等作物农场脚本,还有仙人掌排序、恐龙关卡、迷宫探索等成就相关脚本,大多为收集修改而来,部分脚本因更新已失效,可助力玩家完成多数游戏成就。

My script list that enabled me to complete most of the achievements. /! Guide not up to date since the last update. It appears that some scripts have become broken. Intro Most of the codes below were not written by me. I just modified/improved them (except for 1-2, which I didn't touch at all). I just did a lot of research throughout my epic journey on The Farmer Was Replaced (Discord, YouTube, Web, Steam, AI). I don't take credit for the codes below, even though I spent time on them. But I'm sharing them with you in the hope that they will help you as much as they helped me. I can't credit each script to each person because I picked them up from all over the place, but if you're sure one of yours is there, let me know and I'll mention you. Hay hay farm with polyculture and multiple drones clear() world_size = get_world_size() change_hat(Hats.Brown_Hat) companion_mapping = {} hay_mapping = {} def track_companion(curr_x, curr_y): global companion_mapping global hay_mapping result = get_companion() if result == None: return False target_entity, (target_x, target_y) = result if (target_x, target_y) not in companion_mapping: companion_mapping[(target_x, target_y)] = target_entity hay_mapping[(curr_x, curr_y)] = (target_x, target_y) return True return False def drone_hay_task(): global world_size global companion_mapping global hay_mapping while True: for j in range(world_size): curr_x = get_pos_x() curr_y = get_pos_y() harvest() if get_ground_type() == Grounds.Soil: till() if (curr_x, curr_y) in companion_mapping: target_entity = companion_mapping[(curr_x, curr_y)] if target_entity == Entities.Carrot: if get_ground_type() != Grounds.Soil: till() plant(Entities.Carrot) elif target_entity != Entities.Grass: plant(target_entity) else: if (curr_x, curr_y) in hay_mapping: companion_pos = hay_mapping.pop((curr_x, curr_y)) if companion_pos in companion_mapping: companion_mapping.pop(companion_pos) track_companion(curr_x, curr_y) move(North) NUM_DRONES_TO_SPAWN = world_size - 1 for i in range(NUM_DRONES_TO_SPAWN): while num_drones() >= max_drones(): pass spawn_drone(drone_hay_task) move(East) drone_hay_task()Or hay farm with only one drone (for leaderboard maybe) companion_mapping = {} hay_mapping = {} def track_companion(): global companion_mapping global hay_mapping target_entity, (target_x, target_y) = get_companion() while target_entity == Entities.Carrot and num_items(Items.Wood) < 1: harvest() target_entity, (target_x, target_y) = get_companion() if (target_x, target_y) not in companion_mapping: companion_mapping[(target_x, target_y)] = target_entity hay_mapping[(x_curr, y_curr)] = (target_x, target_y) while True: if num_items(Items.Hay) >= 1000000000000: break x_curr = get_pos_x() y_curr = get_pos_y() if get_entity_type() == Entities.Grass: if can_harvest(): harvest() if (x_curr, y_curr) in hay_mapping: # Had a companion that was already planted companion_pos = hay_mapping[(x_curr, y_curr)] hay_mapping.pop((x_curr, y_curr)) companion_mapping.pop(companion_pos) if (x_curr, y_curr) in companion_mapping: # Plant a companion target_entity = companion_mapping[(x_curr, y_curr)] if target_entity not in [Entities.Bush, Entities.Tree]: till() plant(target_entity) else: # Only when current position is growing grass track_companion() else: # Entity is not grass AKA it is / was a companion if (x_curr, y_curr) not in companion_mapping: # Companion has served its purpose # Reset land back to grassland if get_ground_type() != Grounds.Grassland: till() else: harvest() track_companion() if y_curr == get_world_size() - 1: move(East) move(North) Wood Wood farm with polyculture and multiple drones clear() world_size = get_world_size() change_hat(Hats.Brown_Hat) companion_mapping = {} tree_mapping = {} def tree_tile(curr_x, curr_y): return curr_x % 2 == curr_y % 2 def track_companion(curr_x, curr_y): global companion_mapping global tree_mapping result = get_companion() if result == None: return False target_entity, (target_x, target_y) = result if (target_x, target_y) not in companion_mapping: companion_mapping[(target_x, target_y)] = target_entity tree_mapping[(curr_x, curr_y)] = (target_x, target_y) return True return False def drone_tree_task(): global world_size global companion_mapping global tree_mapping while True: for j in range(world_size): curr_x = get_pos_x() curr_y = get_pos_y() if tree_tile(curr_x, curr_y): if can_harvest(): harvest() plant(Entities.Tree) else: pass if (curr_x, curr_y) in tree_mapping: companion_pos = tree_mapping.pop((curr_x, curr_y)) if companion_pos in companion_mapping: companion_mapping.pop(companion_pos) track_companion(curr_x, curr_y) if get_water() < 0.40: use_item(Items.Water) elif (curr_x, curr_y) in companion_mapping: target_entity = companion_mapping[(curr_x, curr_y)] harvest() if target_entity == Entities.Grass: if get_ground_type() != Grounds.Grassland: till() elif target_entity == Entities.Carrot: if get_ground_type() != Grounds.Soil: till() plant(target_entity) else: harvest() plant(Entities.Bush) move(North) NUM_DRONES_TO_SPAWN = 31 for i in range(NUM_DRONES_TO_SPAWN): while num_drones() >= max_drones(): pass spawn_drone(drone_tree_task) move(East) drone_tree_task()and wood farm with polyculture and only one drone world_size = get_world_size() target_num = 10000000000 companion_mapping = {} tree_mapping = {} def track_companion(curr_x, curr_y): global companion_mapping global hay_mapping target_entity, (target_x, target_y) = get_companion() if not tree_tile(target_x, target_y) and (target_x, target_y) not in companion_mapping: companion_mapping[(target_x, target_y)] = target_entity tree_mapping[(curr_x, curr_y)] = (target_x, target_y) return True return False def tree_tile(curr_x, curr_y): return curr_x % 2 == curr_y % 2 while True: curr_x = get_pos_x() curr_y = get_pos_y() if tree_tile(curr_x, curr_y): if (curr_x, curr_y) in tree_mapping: while not can_harvest(): use_item(Items.Fertilizer) harvest() plant(Entities.Tree) if (curr_x, curr_y) in tree_mapping: # Had a companion that was already planted companion_pos = tree_mapping[(curr_x, curr_y)] tree_mapping.pop((curr_x, curr_y)) companion_mapping.pop(companion_pos) if track_companion(curr_x, curr_y) and get_water() < 0.10: use_item(Items.Water) elif (curr_x, curr_y) in companion_mapping: target_entity = companion_mapping[(curr_x, curr_y)] curr_entity = get_entity_type() harvest() if target_entity == Entities.Grass: if get_ground_type() != Grounds.Grassland: # Grass that needs tilling. Grass never needs any planting though. till() elif target_entity == Entities.Carrot and get_ground_type() != Grounds.Soil: # Carrot that needs tilling till() plant(target_entity) else: # Not grass, but does not need any tilling. plant(target_entity) else: # not a tree tile, but is not a companion harvest() plant(Entities.Bush) if num_items(Items.Wood) >= target_num: break move(North) curr_y = get_pos_y() if curr_y == world_size - 1: move(East) Carrots Farm with polyculture and multiple drones clear() world_size = get_world_size() change_hat(Hats.Brown_Hat) companion_mapping = {} carrot_mapping = {} def track_companion(curr_x, curr_y): global companion_mapping global carrot_mapping result = get_companion() if result == None: return False target_entity, (target_x, target_y) = result if (target_x, target_y) not in companion_mapping: companion_mapping[(target_x, target_y)] = target_entity carrot_mapping[(curr_x, curr_y)] = (target_x, target_y) return True return False def prepare_and_plant(entity_type): if entity_type in (Entities.Carrot, Entities.Bush, Entities.Tree) and get_ground_type() != Grounds.Soil: till() plant(entity_type) def drone_carrot_task(): global world_size global companion_mapping global carrot_mapping while True: for j in range(world_size): curr_x = get_pos_x() curr_y = get_pos_y() harvest() if (curr_x, curr_y) in companion_mapping: target_entity = companion_mapping[(curr_x, curr_y)] prepare_and_plant(target_entity) if target_entity == Entities.Carrot and get_water() < 0.10: use_item(Items.Water) elif (curr_x, curr_y) in carrot_mapping: prepare_and_plant(Entities.Carrot) if get_water() < 0.10: use_item(Items.Water) companion_pos = carrot_mapping.pop((curr_x, curr_y)) if companion_pos in companion_mapping: companion_mapping.pop(companion_pos) track_companion(curr_x, curr_y) else: prepare_and_plant(Entities.Carrot) if get_water() < 0.10: use_item(Items.Water) track_companion(curr_x, curr_y) move(North) NUM_DRONES_TO_SPAWN = world_size - 1 for i in range(NUM_DRONES_TO_SPAWN): while num_drones() >= max_drones(): pass spawn_drone(drone_carrot_task) move(East) drone_carrot_task() Just a mix between woods and carrots clear() set_world_size(max_drones() - 1) change_hat(Hats.Brown_Hat) hats = [Hats.Green_Hat, Hats.Purple_Hat] world_size = get_world_size() def plant_crop(i, j): if (i + j) % 2 == 0: plant(Entities.Tree) else: plant(Entities.Carrot) if get_water() < 0.5: use_item(Items.Water) def run_drone(): global hats change_hat(hats[get_pos_x() % 2]) for j in range(get_world_size()): if get_ground_type() != Grounds.Soil: till() plant_crop(get_pos_x(), j) if can_harvest(): harvest() plant_crop(get_pos_x(), j) move(North) def run_carrots_trees(): global world_size for i in range(world_size): spawn_drone(run_drone) while num_drones() >= max_drones(): pass move(East) while True: run_carrots_trees() Sunflowers Replaces the previous code to unlock the "Sunflower master" achievement. clear() def harvest_column(): while True: if get_pos_y() != 0: move_to(get_pos_x(), 0) for _ in range(get_world_size()): if get_ground_type() != Grounds.Soil: till() if get_water() < 0.75: use_item(Items.Water) if can_harvest(): harvest() if get_entity_type() == None: plant(Entities.Sunflower) move(North) def main_loop(): world_size = get_world_size() for i in range(world_size - 1): if spawn_drone(harvest_column): move(East) harvest_column() while True: main_loop() Pumpkins There is certainly room for improvement, but it does the job. This code is not sufficient to achieve 20M in 1 minute, but there are now other players who have shared their excellent codes for this, so I invite you to visit them if you need to! clear() change_hat(Hats.Brown_Hat) world_size = get_world_size() first_pass = True def check_pumpkin(): if get_pos_x() != 0: move(East) left_id = measure() move(West) right_id = measure() move(East) return left_id == right_id def wait_for_drones(drones): for drone in drones: wait_for(drone) def plant_column(): global world_size global first_pass for j in range(world_size): if get_entity_type() != Entities.Pumpkin: if get_ground_type() != Grounds.Soil: till() plant(Entities.Pumpkin) if not first_pass: while not can_harvest(): if get_entity_type() == Entities.Dead_Pumpkin: plant(Entities.Pumpkin) use_item(Items.Fertilizer) move(North) if not first_pass: for j in range(world_size): if get_entity_type() == Entities.Dead_Pumpkin: plant(Entities.Pumpkin) move(North) def plant_pumpkins(): global world_size global first_pass drones = [] if get_pos_x() != 0: move(East) for i in range(world_size - 1): drones.append(spawn_drone(plant_column)) move(East) plant_column() wait_for_drones(drones) while True: plant_pumpkins() first_pass = False if check_pumpkin(): harvest() first_pass = True move(West)But you can try this code for the pumpkin achievement. Submitted by Arthradax in the comments section ! (Thanks!) 引用自 Arthradax:For anyone having issues: run the sunflower code to stockpile on power (around 10k should be enough), as it will double the execution speed. Also, make sure to have a lot of fertilizer; can't tell how much is enough - I used a little under 10k simulating on a fixed seed, but a little over 4k when running it for real clear() change_hat(Hats.Brown_Hat) world_size = get_world_size() needs_till=True def check_pumpkin(): if get_pos_x() != 0: move(East) left_id = measure() move(West) right_id = measure() move(East) return left_id == right_id def wait_for_drones(drones): for drone in drones: wait_for(drone) def till_column(): for _ in range(world_size): till() move(North) def plant_first_batch(): for _ in range(world_size): plant(Entities.Pumpkin) move(North) def plant_nth_batch(): for _ in range(world_size): while not can_harvest(): if get_entity_type() == Entities.Dead_Pumpkin: plant(Entities.Pumpkin) use_item(Items.Fertilizer) move(North) def check_done(): return measure()==measure(South) def drone_plant_loop(): if needs_till: till_column() plant_first_batch() while not check_done(): plant_nth_batch() def plant_pumpkins(): for _ in range(world_size-1): spawn_drone(drone_plant_loop) move(East) drone_plant_loop() while num_drones()>1: pass harvest() move(East) while True: plant_pumpkins() needs_till=False Cactus clear() hats = [Hats.Green_Hat, Hats.Purple_Hat] world_size = get_world_size() def _shortest_delta(curr, dest): size = world_size d = (dest - curr) % size if d > size / 2: d -= size return d def move_to_x_pos(x_target): x_curr = get_pos_x() moves_needed = _shortest_delta(x_curr, x_target) if moves_needed > 0: dir = East else: dir = West for i in range(abs(moves_needed)): move(dir) def move_to_y_pos(y_target): y_curr = get_pos_y() moves_needed = _shortest_delta(y_curr, y_target) if moves_needed > 0: dir = North else: dir = South for i in range(abs(moves_needed)): move(dir) def wait_for_drones(drones): for drone in drones: wait_for(drone) def drone_action_plant_cacti(): global world_size change_hat(hats[get_pos_x() % 2]) for j in range(world_size): if get_ground_type() != Grounds.Soil: till() plant(Entities.Cactus) move(North) def plant_cacti(): global world_size move_to_x_pos(0) move_to_y_pos(0) drones = [] for i in range(world_size - 1): drones.append(spawn_drone(drone_action_plant_cacti)) move(East) drone_action_plant_cacti() move(East) move(North) wait_for_drones(drones) def shake_row(): global world_size change_hat(hats[get_pos_y() % 2]) left = 0 right = world_size - 1 while left < right: move_to_x_pos(left) loc_last_swap = left x_curr = get_pos_x() while x_curr < right: if measure() > measure(East): swap(East) loc_last_swap = x_curr move(East) x_curr += 1 right = loc_last_swap if left >= right: break move_to_x_pos(right) loc_last_swap = right x_curr = get_pos_x() while x_curr > left: if measure(West) > measure(): swap(West) loc_last_swap = x_curr move(West) x_curr -= 1 left = loc_last_swap def shake_col(): global world_size change_hat(hats[get_pos_x() % 2]) left = 0 right = world_size - 1 while left < right: move_to_y_pos(left) loc_last_swap = left y_curr = get_pos_y() while y_curr < right: if measure() > measure(North): swap(North) loc_last_swap = y_curr move(North) y_curr += 1 right = loc_last_swap if left >= right: break move_to_y_pos(right) loc_last_swap = right y_curr = get_pos_y() while y_curr > left: if measure(South) > measure(): swap(South) loc_last_swap = y_curr move(South) y_curr -= 1 left = loc_last_swap def sort_columns(): global world_size move_to_x_pos(0) move_to_y_pos(0) drones = [] for i in range(world_size - 1): drones.append(spawn_drone(shake_col)) move(East) shake_col() move(East) move(North) wait_for_drones(drones) def sort_rows(): global world_size move_to_x_pos(0) move_to_y_pos(0) drones = [] for i in range(world_size - 1): drones.append(spawn_drone(shake_row)) move(North) shake_row() move(North) wait_for_drones(drones) while True: plant_cacti() sort_columns() sort_rows() harvest()For the "Wrong Order" achievement clear() hats = [Hats.Green_Hat, Hats.Purple_Hat] set_world_size(6) world_size = get_world_size() def _shortest_delta(curr, dest): size = world_size d = (dest - curr) % size if d > size / 2: d -= size return d def move_to_x_pos(x_target): x_curr = get_pos_x() moves_needed = _shortest_delta(x_curr, x_target) if moves_needed > 0: dir = East else: dir = West for i in range(abs(moves_needed)): move(dir) def move_to_y_pos(y_target): y_curr = get_pos_y() moves_needed = _shortest_delta(y_curr, y_target) if moves_needed > 0: dir = North else: dir = South for i in range(abs(moves_needed)): move(dir) def wait_for_drones(drones): for drone in drones: wait_for(drone) def drone_action_plant_cacti(): global world_size change_hat(hats[get_pos_x() % 2]) for j in range(world_size): if get_ground_type() != Grounds.Soil: till() plant(Entities.Cactus) move(North) def plant_cacti(): global world_size move_to_x_pos(0) move_to_y_pos(0) drones = [] for i in range(world_size - 1): drones.append(spawn_drone(drone_action_plant_cacti)) move(East) drone_action_plant_cacti() move(East) move(North) wait_for_drones(drones) def shake_row(): global world_size change_hat(hats[get_pos_y() % 2]) left = 0 right = world_size - 1 while left < right: move_to_x_pos(left) loc_last_swap = left x_curr = get_pos_x() while x_curr < right: # Condition inversée pour le passage Est/droite : # Si l'élément courant est PLUS PETIT que le suivant, on échange. if measure() < measure(East): swap(East) loc_last_swap = x_curr move(East) x_curr += 1 right = loc_last_swap if left >= right: break move_to_x_pos(right) loc_last_swap = right x_curr = get_pos_x() while x_curr > left: # Condition inversée pour le passage Ouest/gauche : # Si l'élément précédent est PLUS GRAND que le courant, on échange. if measure(West) > measure(): swap(West) loc_last_swap = x_curr move(West) x_curr -= 1 left = loc_last_swap def shake_col(): global world_size change_hat(hats[get_pos_x() % 2]) left = 0 right = world_size - 1 while left < right: move_to_y_pos(left) loc_last_swap = left y_curr = get_pos_y() while y_curr < right: # Condition inversée pour le passage Nord/haut : # Si l'élément courant est PLUS PETIT que le suivant, on échange. if measure() < measure(North): swap(North) loc_last_swap = y_curr move(North) y_curr += 1 right = loc_last_swap if left >= right: break move_to_y_pos(right) loc_last_swap = right y_curr = get_pos_y() while y_curr > left: # Condition inversée pour le passage Sud/bas : # Si l'élément précédent est PLUS GRAND que le courant, on échange. if measure(South) > measure(): swap(South) loc_last_swap = y_curr move(South) y_curr -= 1 left = loc_last_swap def sort_columns(): global world_size move_to_x_pos(0) move_to_y_pos(0) drones = [] for i in range(world_size - 1): drones.append(spawn_drone(shake_col)) move(East) shake_col() move(East) move(North) wait_for_drones(drones) def sort_rows(): global world_size move_to_x_pos(0) move_to_y_pos(0) drones = [] for i in range(world_size - 1): drones.append(spawn_drone(shake_row)) move(North) shake_row() move(North) wait_for_drones(drones) while True: plant_cacti() sort_columns() sort_rows() harvest() Dino world_size = get_world_size() world_size_minus_one = world_size - 1 edge_positions = [0, world_size_minus_one] offlimit_columns_stage1 = { } offlimit_columns_stage2 = { } clear() change_hat(Hats.Dinosaur_Hat) apple_pos = measure() squares_occupied = 1 game_complete = False aggressive_stage = True def measure_apple(): global apple_pos global squares_occupied global apple_pos_queue apple_pos = measure() squares_occupied += 1 def move_and_check_apple(direction): global apple_pos if not move(direction): return False if (get_pos_x(), get_pos_y()) == apple_pos: measure_apple() return True def move_to_col(target_x_pos, do_measure=True): global world_size global apple_pos curr_x = get_pos_x() direction = West if curr_x < target_x_pos: direction = East for x in range(abs(target_x_pos - curr_x)): this_check = move if do_measure: this_check = move_and_check_apple if not this_check(direction): return False return True def move_to_row(target_y_pos, do_measure=True): global world_size global apple_pos curr_y = get_pos_y() direction = South if curr_y < target_y_pos: direction = North for y in range(abs(target_y_pos - curr_y)): this_check = move if do_measure: this_check = move_and_check_apple if not this_check(direction): return False return True def transition_to_stage_2(): global offlimit_columns_stage1 global world_size global world_size_minus_one move_to_col(world_size_minus_one) move_to_row(0) offlimit_columns_stage1 = { } return False def transition_to_stage_1(): global offlimit_columns_stage2 global world_size global world_size_minus_one move_to_col(0) move_to_row(world_size_minus_one) offlimit_columns_stage2 = { } return False def stage_1_apple_collect(): global apple_pos global world_size global offlimit_columns_stage1 global offlimit_columns_stage2 global world_size_minus_one apple_pos_x, apple_pos_y = apple_pos if apple_pos_y == 0 or apple_pos_x in edge_positions or (apple_pos_x in offlimit_columns_stage1 and apple_pos_y <= offlimit_columns_stage1[apple_pos_x]): return transition_to_stage_2() else: apple_x_odd = apple_pos_x % 2 target_x_pos = apple_pos_x if not apple_x_odd: target_x_pos = apple_pos_x - 1 if target_x_pos <= get_pos_x(): return transition_to_stage_2() else: move_to_col(target_x_pos) move_to_row(apple_pos_y) offlimit_columns_stage2[target_x_pos] = apple_pos_y offlimit_columns_stage2[target_x_pos + 1] = apple_pos_y move_and_check_apple(East) move_to_row(world_size_minus_one) return True def stage_2_apple_collect(): global apple_pos global world_size global offlimit_columns_stage1 global offlimit_columns_stage2 global world_size_minus_one apple_pos_x, apple_pos_y = apple_pos if apple_pos_y == world_size_minus_one or apple_pos_x in edge_positions or (apple_pos_x in offlimit_columns_stage2 and apple_pos_y >= offlimit_columns_stage2[apple_pos_x]): return transition_to_stage_1() else: apple_x_odd = apple_pos_x % 2 target_x_pos = apple_pos_x if apple_x_odd: target_x_pos = apple_pos_x + 1 if target_x_pos >= get_pos_x(): return transition_to_stage_1() else: move_to_col(target_x_pos) move_to_row(apple_pos_y) offlimit_columns_stage1[target_x_pos] = apple_pos_y offlimit_columns_stage1[target_x_pos - 1] = apple_pos_y move_and_check_apple(West) move_to_row(0) return True def move_to_right_col_wavy(): global world_size global world_size_minus_one global offlimit_columns_stage1 # Assume curr x is zero for x in range(world_size): if x % 2: target_y = 1 if x in offlimit_columns_stage1: target_y = offlimit_columns_stage1[x] + 1 while get_pos_y() != target_y: move(South) move(East) else: # x is even, go up to top row, then move right while get_pos_y() != world_size_minus_one: move(North) move(East) def find_top_left(): global world_size_minus_one while get_pos_x() > 0: move(West) while get_pos_y() < world_size_minus_one: move(North) def transition_to_route(): find_top_left() move_to_right_col_wavy() while get_pos_y() != 0: move(South) while get_pos_x() != 0: move(West) # STAGE 1 move_to_row(world_size_minus_one) while aggressive_stage: while stage_1_apple_collect() and get_pos_x() < world_size_minus_one: pass while stage_2_apple_collect() and get_pos_x() > 0: pass if squares_occupied > (world_size_minus_one) * 4 - 4: break transition_to_route() while True: for i in range(world_size / 2): game_complete = not move_to_row(world_size_minus_one, False) game_complete = game_complete or not move(East) game_complete = game_complete or not move_to_row(1, False) if i != world_size / 2 - 1: game_complete = game_complete or not move(East) if game_complete: break game_complete = game_complete or not move_to_row(0, False) game_complete = game_complete or not move_to_col(0,) if game_complete: break change_hat(Hats.Straw_Hat) Maze ALL_DIRECTIONS = [North, South, East, West] def opposite_direction(direction): if direction == North: return South elif direction == East: return West elif direction == South: return North elif direction == West: return East def explore_option_iterative(start_direction): global ALL_DIRECTIONS if not move(start_direction): return False path_stack = [(start_direction, 0)] while path_stack and num_items(Items.Gold) < 9863168000000: if get_entity_type() == Entities.Treasure: harvest() start_maze() return True last_move_direction, next_dir_index = path_stack[-1] while next_dir_index < len(ALL_DIRECTIONS): explore_direction = ALL_DIRECTIONS[next_dir_index] path_stack[-1] = (last_move_direction, next_dir_index + 1) if opposite_direction(explore_direction) != last_move_direction: if move(explore_direction): path_stack.append((explore_direction, 0)) break next_dir_index += 1 if next_dir_index == len(ALL_DIRECTIONS): path_stack.pop() move(opposite_direction(last_move_direction)) move(opposite_direction(start_direction)) return False def start_maze(): plant(Entities.Bush) substance = get_world_size() * 2**(num_unlocked(Unlocks.Mazes) - 1) use_item(Items.Weird_Substance, substance) def search(): global drone_id global ALL_DIRECTIONS for _ in range(drone_id): do_a_flip() if drone_id % 2: ALL_DIRECTIONS = ALL_DIRECTIONS[::-1] if drone_id % 3: ALL_DIRECTIONS[0], ALL_DIRECTIONS[1] = (ALL_DIRECTIONS[1], ALL_DIRECTIONS[0]) if drone_id % 5: ALL_DIRECTIONS[1], ALL_DIRECTIONS[3] = (ALL_DIRECTIONS[3], ALL_DIRECTIONS[1]) while True: for direction in ALL_DIRECTIONS: if explore_option_iterative(direction): break drone_id = 0 start_maze() for i in range(max_drones()): drone_id = i spawn_drone(search) drone_id = 0 search() For the "Recycling" and "Big Gold Farmer" achievements def generate_maze(): plant(Entities.Bush) substance = get_world_size() * 2**(num_unlocked(Unlocks.Mazes) - 1) use_item(Items.Weird_Substance, substance) def maze(): while True: if num_drones() == 25: if get_entity_type() == Entities.Treasure: harvest() generate_maze() clear() set_world_size(5) list = [] while num_drones() < 26: pos_x = get_pos_x() pos_y = get_pos_y() current = (pos_x, pos_y) if current not in list: list.append(current) spawn_drone(maze) move(North) else: move(East) For some, this code did not work for the ‘Recycling’ achievement. Here are two codes to do this, which were shared in the comments section : By Arthradax set_world_size(5) times_reused=0 substance = get_world_size() * 2**(num_unlocked(Unlocks.Mazes) - 1) def generate_maze(): plant(Entities.Bush) use_item(Items.Weird_Substance, substance) def maze(): global times_reused while True: if num_drones() == 25: if get_entity_type() == Entities.Treasure: if times_reused>=300: times_reused=0 harvest() generate_maze() else: use_item(Items.Weird_Substance, substance) times_reused+=1 clear() list = [] while num_drones() < 26: pos_x = get_pos_x() pos_y = get_pos_y() current = (pos_x, pos_y) if current not in list: list.append(current) spawn_drone(maze) move(North) else: move(East) generate_maze() And by ᴛᴀᴛᴀʀᴏᴄʜᴋᴀ def generate_maze(): plant(Entities.Bush) substance = get_world_size() * 2**(num_unlocked(Unlocks.Mazes) - 1) use_item(Items.Weird_Substance, substance) def maze(): i = 0 end = 300 while True: if num_drones() == 25: if get_entity_type() == Entities.Treasure and (i == end): harvest() i = 0 elif get_entity_type() == Entities.Treasure: substance = get_world_size() * 2**(num_unlocked(Unlocks.Mazes) - 1) use_item(Items.Weird_Substance, substance) i += 1 generate_maze() clear() set_world_size(5) list = [] while num_drones() < 26: pos_x = get_pos_x() pos_y = get_pos_y() current = (pos_x, pos_y) if current not in list: list.append(current) spawn_drone(maze) move(North) else: move(East) Thanks to them!

评论

共0条评论
face
inputImg
相关阅读
最新更新

生活品质更新与排行榜调整

大家好,正如承诺的那样,本次更新对排行榜进行了平衡调整,并引入了玩家们热切期盼的便利性功能,例如在游戏开始时即可启用所有语言功能的选项。 首先是一些常规改进: …

2026-02-13 09:000赞 · 0评论

俄语翻译

很遗憾,这款游戏没有被翻译成所有语言,因为像这种实用的、教授编程的游戏应该面向所有人,包括那些英语掌握不够熟练的人。有一种观点认为,如果从事编程工作,就应该懂英…

2026-02-20 16:000赞 · 0评论

泰伯利亚黎明触发器机制详解 - 它们的真实运作方式

Anyone who has messed with scripting in Tiberian Dawn, and has done some slightl…

2026-02-16 01:000赞 · 0评论

天天炫斗 天天炫斗科技合集

-

2025-12-27 12:270赞 · 0评论

生活记录 【主观锐评】二重螺旋脚本想开就开 管好自己 拒绝玩家内斗

骂我我就骂你 烂完了社区

2025-10-21 19:240赞 · 0评论

BUG 我充你妈的月卡 直接改 无限重置签到无限速战

-

2025-08-29 09:400赞 · 0评论

GG GG修改 猛鬼宿舍 脚本 无限道具

-

2025-08-25 13:510赞 · 0评论

精灵宝可梦 口袋觉醒:榭上花火如何利用脚本,1把15000分拿满所有奖励,附脚本操作相关细节

-

2025-08-16 02:080赞 · 0评论

原创 斗罗大陆h5GM后台在线发助力

-

2025-08-05 18:140赞 · 0评论

哪里获取脚本和资源

TGC商店! TGC商店与你已购买GameGuru的Steam账户相关联。你可以购买资源、脚本以及各种你没时间或没能力制作的素材,然后将它们用于你自己的作品中,…

2026-04-04 19:000赞 · 0评论
暂无更多

最新更新

  • Recycling Achievement — 轻松获取重复使用同一迷宫300次成就的提示与方法 获取【Recycling】成就的方法: 要获得【Recycling】成就,你需要重复使用同一个迷宫300次。 …
  • 使用嵌套函数解决迷宫问题 — 一个用于解决迷宫的极简嵌套函数方案。 其工作原理: 一个用于解决迷宫的极简嵌套函数方案。 定义执行分支(起点): 若获取实体类型()等于实体.宝藏: 收获() …
  • 俄语翻译 — 很遗憾,这款游戏没有被翻译成所有语言,因为像这种实用的、教授编程的游戏应该面向所有人,包括那些英语掌握不够熟练的人。有一种观点认为,如果从事编程工作,就应该懂英…
  • 解锁成本 — 自动化 farming 的终极挑战是尽可能快速地自动完成游戏流程。以下是游戏自动化相关的解锁内容概述: 解锁树 本指南包含游戏 1.0 版本前的解锁成本信息。
  • 《仙人掌农场》(2025) — It's the cactus farm, with explanations inside the code as comments. You can jus…
  • 编程初学者的代码 — *DUE TO STILL GOING THROUGH THE GAME, THIS IS A WIP. * I have never created, lea…
  • 成就解锁器.exe — # 奖杯自动化 解锁(成就) 循环导入和栈溢出 此成就需要2个脚本:f0和f1 循环导入f0: import f1 f1: import f0
  • 解开迷宫 — The maze levels are very different than the remainder of the game. It's possible…
  • 大多数成就代码 — Title is self explaining I want to say something First of all im not a native sp…
  • 《编程农场》全成就指南 — 这是一篇关于《编程农场》全成就达成思路的指南。 请注意:本篇内容并不包含实现代码,而只是成就达成思路的提示。 介绍与提示 首先需要注意的是:本篇内容并不包含实现…