Play/Replay Button: a Raspberry Pi Pico Automation Tool for Anything

by crackd engie in Circuits > Microcontrollers

453 Views, 5 Favorites, 0 Comments

Play/Replay Button: a Raspberry Pi Pico Automation Tool for Anything

PlayReplay.gif

I was watching a youtube video of a guy grinding the same mission on Dying Light to max out his skills before the end of the first assignment, it was just a silly challenge that he made but then, while watching that, I had one of those moments where you feel the lightbulb turn on, full blinding power.

He was repeating the same mission over and over and over again, exactly the same thing for an insane amount of time and I thought "damn this is terrible, if only...there was a way to record your input, store it and replay it instead of being forced to do all of that and waste a massive amount of hours" and here we are!

My project needs a small python script to capture the position of mouse and keyboard and then it translates it to usable instructions for a RP2040 microcontroller. My goal here was to build THE smallest footprint device possible that can stay next to you even in a cluttered desk but that has enough built-in memory for, hypotetically, at least half an hour of recordable inputs and a max of HOURS.

I also tried to make this project as minimalistic as possible, you won't need much and I promise that the usecases are near infinite.

Supplies

vcc_gnd_yd_rp2040-1838945647.jpg
cherry_key_switch_module_mx_rgb_blue_large-782487692.jpg
photo_2026-09-17_09-40-34.jpg
photo_2026-09-17_09-40-49.jpg

As said in the intro, you don't really need much at all:

  1. 1x VCC GND YD-RP2040, specifically the one with 16MB of memory (this is my favourite board btw).
  2. 2x Cherry MX Blue keyboard switches, the clicky ones (or any type of Cherry MX switch).
  3. Unspecified amount of wires to connect the switches.
  4. The 3D printed case.
  5. A soldering station, for obvious reasons. Technically you could just use female to female single dupont cables and not need to solder it but I wouldn't do that.

That's literally it. The case uses tight tolerances and lips designed for pressure fitting so no need to buy screws or get the hot glue gun pipin' hot.

Print Everything

photo_2026-09-17_09-50-42.jpg

Depending on how precise your printer is you might want to consider printing every piece singularly. I'm lazy so I decided to do everything at once (the picture is me testing out a looser tolerance bottom part).

This project only uses friction and tight tolerances to fit together!!!

If everything is too tight consider scaling this model by 1% or 2% in your slicer, I didn't need to do this.

I used 20% cubic infill and black PETG for that shiny glossy finish but realistically speaking you can use whatever rocks your boat. You'll need support material for the top part of the case.

Assembly

photo_2026-09-18_19-39-01.jpg
photo_2026-09-18_19-39-08.jpg
photo_2026-09-18_19-39-12.jpg
photo_2026-09-18_19-39-17.jpg
photo_2026-09-23_17-53-40.jpg

This part is critical so listen carefully, ok?

  1. Solder the wires to the switches BEFORE putting them into the top part. You do not want to melt the plastic by assembling everything and then trying to solder things together. Do not be silly, aight?
  2. Put the switches in the slots, cut the wires accordingly to how short you think they should be.
  3. Now BEFORE putting the board in the bottom part solder the wires to pin 22 and 15, they are safe since they don't do anything other than being standard IO pins, I discovered the hard way what happens when you use an ADC pin by accident... Use any ground pin you want, that really doesn't matter.
  4. Put the board in the bottom part, be careful though, it's gonna be tight and you might want to file it down a bit with sandpaper if you're not confident in the amount of pressure you're putting on the board.
  5. (Optional) Add a little bit of tape between the top and the bottom to prevent any short circuit.

And that's it, the assembly is D-O-N-E! This will probably take you no longer than 1 hour but take your time.

Flash the Board

Screenshot 2026-09-17 115541.png

Use any kind of software you see fit to do this. You'll find the code at my GitHub repo for this project, here's the link -> https://github.com/Lupix111/Play-RePlay-Button

I always use the Arduino IDE, the configs in the Tools section that I use are in the screenshot. You need to flash the Play_RePlay.ino file, DO NOT FORGET to put the flash size to 16mb, the "Sketch 1MB; FS 15MB". It's very important.

Here's the .ino in case you just want to take a look at it.

Downloads

Get the Python Script

The same as before, go to my GitHub repo and get the script, everything is explained also over there in a more nerdy and complicated way if you feelin' fancy like that. The python script runs in the background so it does not interfere with games and other apps. You can get it from the Releases section. To make things simpler I compiled the python script into an .exe file but you can also compile it on your own if you don't trust me.

And if you don't want to go to GitHub here's the code, to build it from scratch just remember to download the appropriate libraries to run it.

Downloads

Start Playing!

PlayReplay.gif
photo_2026-09-22_21-33-31.jpg

That's it, you're done. Now you can make this thing do your boring and repetitive game tasks to farm XP or anything else. Remember, this is very important: the mouse is relative so to make a good loop you need to find a place where to point the mouse at the beginning and at the end!!


I'll post a video in the future to show a little example of what you can do with this, so keep an eye out on my channel if you're interested in a demo: https://www.youtube.com/@crackd-engie


If you liked this instructable leave me a dollar on my Ko-Fi, pretty please? I still need to feed my demonic cats and they are learning to climb my clothes to bite me! They are very cute and small for now so I need to buy a suit of armor for when they'll get huge and even more evil!