Easy DIY $7 Anti Afk Kicker for (almost) All Situations

by 188579 in Circuits > Raspberry Pi

121 Views, 1 Favorites, 0 Comments

Easy DIY $7 Anti Afk Kicker for (almost) All Situations

image_2023-03-30_131956078.png

Have you ever been kicked from a game or chat room for being inactive or "AFK" (Away From Keyboard) for too long? It's a frustrating experience to come back to your computer and find that you've been automatically disconnected. But fear not, because in this tutorial, we will be showing you how to make an anti-AFK kicker using a Raspberry Pi Pico - a small and affordable microcontroller that costs only $7!

With this project, you'll be able to send keystrokes to your computer every x seconds to simulate activity, preventing you from being kicked out of games or chat rooms due to inactivity. It's an easy-to-follow tutorial that anyone can do, regardless of experience with coding or electronics. Even if you're a beginner, you'll be able to complete this project in no time!

Supplies

image_2023-03-28_112821617.png

--a pc/laptop running mac windows or linux

--a raspberry pi pico https://bit.ly/3MeO8sX (Not an affiliate link, just the cheapest I could find.)

Prepare Your Pi and Your Pc

image_2023-03-28_114543602.png

The Raspberry Pi Pico is a small computer board that you can use to create your own electronic projects. It has a tiny computer chip on it that you can program to do different things. In this step, we will connect the Pi to your PC and set everything up so that it is able to run programs. It's already 75% of the entire project! Don't worry about programming – it's not hard, and I will provide an example script.

First, let's set up the Raspberry Pi:

  1. Download the newest Cuircuitpython firmware version here.
  2. Insert one end of the cable into your PC (but don't connect it to your Pico yet!).
  3. Press and hold the "BOOTSEL" button (shown in the image).
  4. Insert the other end of the cable into your Raspberry Pi (you can release the button after inserting the cable).
  5. The Raspberry Pi should now show up as a USB drive.
  6. Drag and drop the downloaded firmware file into the USB drive.
  7. Congratulations! Your Raspberry Pi is now ready to be programmed.

Now, let's set up your PC:

  1. Download and install Thonny from https://thonny.org.
  2. Open Thonny and click on "Tools" in the top bar.
  3. Click "Options."
  4. Open the "Interpreter" tab.
  5. In the drop-down menu, select "Cuircuitpython (generic)."
  6. Your PC should now be connected to your Raspberry Pi.

Start Programming

image_2023-03-28_120249699.png

Let's program our anti-AFK kicker!

  1. Go to Thonny and click "View" to enable "Files." You should now see all files stored on your Pico. If it doesn't work, click the red button at the top to reset your connection. It should now look something like the image.
  2. Now, we will install the keyboard library, which is an app that helps the Pico send fake keyboard input. Download the drive from here: (https://github.com/adafruit/Adafruit_CircuitPython_HID)
  3. Extract the ZIP file and navigate to the "adafruit_hid" folder. Copy and paste the file to the "lib" folder on the Pico.
  4. Next, copy the script from here: (https://pastebin.com/MKPRMfnL) and paste it in the empty space in the middle of the Thonny editor.
  5. adjust the number at the first line to change the timeout
  6. Press the green button to run the script. It will ask you where to save the script. Select "CircuitPython device" and name the file "main.py."
  7. Congratulations, you have just made your anti-AFK kicker!