Last active
February 18, 2026 16:28
-
-
Save 1337dondongo/6cb2506bb1847d1b4490260673aa49c4 to your computer and use it in GitHub Desktop.
The Farmer Was Replaced Maze with Drone and Upgraded Maze
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def create_maze(): | |
| plant(Entities.Bush) | |
| while get_entity_type()==Entities.Bush: | |
| if num_items(Items.Weird_Substance) > get_world_size(): | |
| use_item(Items.Weird_Substance, get_world_size()*2) | |
| return 1 | |
| if can_harvest(): | |
| harvest() | |
| plant(Entities.Bush) | |
| if num_items(Items.Fertilizer)==0: | |
| # I do not have trade unlocked | |
| #trade(Items.Fertilizer) | |
| return 0 | |
| use_item(Items.Fertilizer) | |
| return 1 | |
| def treasure_hunt(): | |
| dir = West | |
| x = get_pos_x() | |
| y = get_pos_y() | |
| while True: | |
| move(dir) | |
| x2 = get_pos_x() | |
| y2 = get_pos_y() | |
| if x==x2 and y==y2: | |
| if dir==West: | |
| dir = North | |
| elif dir==North: | |
| dir = East | |
| elif dir==East: | |
| dir = South | |
| elif dir==South: | |
| dir = West | |
| else: | |
| x = get_pos_x() | |
| y = get_pos_y() | |
| if dir==West: | |
| dir = South | |
| elif dir==North: | |
| dir = West | |
| elif dir==East: | |
| dir = North | |
| elif dir==South: | |
| dir = East | |
| if get_entity_type()==Entities.Treasure: | |
| harvest() | |
| return 1 | |
| if get_entity_type()==Entities.Grass: | |
| harvest() | |
| return 1 | |
| def drone_hunt(): | |
| dir = East | |
| x = get_pos_x() | |
| y = get_pos_y() | |
| while True: | |
| move(dir) | |
| x2 = get_pos_x() | |
| y2 = get_pos_y() | |
| if x==x2 and y==y2: | |
| if dir==West: | |
| dir = South | |
| elif dir==North: | |
| dir = West | |
| elif dir==East: | |
| dir = North | |
| elif dir==South: | |
| dir = East | |
| else: | |
| x = get_pos_x() | |
| y = get_pos_y() | |
| if dir==West: | |
| dir = North | |
| elif dir==North: | |
| dir = East | |
| elif dir==East: | |
| dir = South | |
| elif dir==South: | |
| dir = West | |
| if get_entity_type()==Entities.Treasure: | |
| harvest() | |
| return 1 | |
| while True: | |
| for i in range(8): | |
| spawn_drone(drone_hunt) | |
| move (North) | |
| if create_maze(): | |
| if treasure_hunt(): | |
| continue |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
for spawning drones,
while(max_drones()>num_drones())so i can send in all of my available dronesWithin Drone Hunt I'm using a countdown before the clone moves randomly (seen below) so that spawned drones don't follow each other and to avoid getting drones stuck in a loop.
note: if you're planning a reuse 300 times, I don't recommend setting r to a higher number since hedges vanish, making it more likely for drones to get stuck in loops
I'm also using:
use_item(Items.Weird_Substance, (get_world_size() * 2**(num_unlocked(Unlocks.Mazes) - 1)))to spawn the maze at the same level of world sizeand for the recycling farm achievement, i've adjusted both if treasure to say:
i've successfully done a 32x32 reuse maze 300 times using these adjustments.
Note for room on improvement: change my random movement to an "move closer to chest" to improve runtime