dark mode light mode Search Menu

Auto-Code in Stardew Valley

Joe Strout

Stardew Valley is an engaging video game in which you can farm, craft things, fish, and make friends with other local residents. As your garden grows, all that farming can be time-consuming. Wouldn’t it be great if you could use your computer skills to automate some work? You can, with the Farmtronics mod.

To start, install SMAPIa free program that supports mods (additional or customized features) in any desktop version of Stardew Valley. Detailed instructions for installing SMAPI are available on the web at https://stardewvalleywiki.com/Modding:Player_Guide/Getting_Started.

Next, download Farmtronics (https://github.com/JoeStrout/Farmtronics), and unzip it into your Mods folder as described in the SMAPI instructions. Then launch Stardew Valley, and click on the TV in your cabin—the same place you go for a weather report or to watch the fortune teller. If everything has gone correctly, you’ll now see a new option: “Farmtronics Home Computer”. Click that, and the home computer opens up, with a blinking cursor ready for your commands.

If you’ve followed the Mini Micro projects in recent issues, the Farmtronics computer will feel very familiar. It uses the same MiniScript language, and even includes some of the same demos. Start with the help Command.

That will lead you to the very important toDo command.

The toDo command shows you a list of programming tasks, from simple to complex.

Each one has some notes about how to approach it, and a checkbox that indicates when the task is complete. Work your way through these tasks one by one, reading the instructions carefully. If you get stuck, ask someone to work with you, or find help online (https://miniscript.org).

The reward for completing all seven tasks is well worth it: your very own robot. You’ll receive this in the mail the next morning after completing the tasks. You can carry this robot around with you, and place it down somewhere in your farm.

Then right-click it, and the bot console will open up. The bot console is just like the home computer, except that you also have access to item inventory so you can give the bot items, or take things it has gathered.

Also, the bot console has access to commands that start with bot. When you get to this point, try it. Right-click your robot, then enter bot.forward. The bot immediately rolls forward one map square if it can. (If your screen is big enough, you can click and drag just outside the bot console to move it aside, so that you can see the console and the bot at the same time. Otherwise, you’ll have to dismiss the bot console by clicking OK in order to see what the bot has done.) Other bot commands make the robot turn, use tools, and sense what is in front of it. By this point, you will know how to edit and save your own programs, so you can write code to make the robot do sophisticated tasks for you, like water and harvest your whole garden.

You can find more details about the available commands in the Farmtronics wiki (https://github.com/JoeStrout/Farmtronics/wiki/).

As you develop your own robot programs, be patient with yourself. Take them one step at a time, testing as you go, and don’t worry if it takes multiple tries to get it right. Programming is a superpower, but like any skill, it takes practice. In time your robot will be a trusty companion and a hard-working member of your Stardew Valley family.

Learn More

What is Autocoding


Stardew Valley


Stardew Valley on STEAM


Stardew Valley Wiki?


Stardew Valley Trailer


Stardew Valley




How to Install SMAPI and Mods


Launch SMAPI Using Steam for Stardew Valley