Skip to content

Automating Pokemon breeding in Pokemon Sword and Shield by mimicking a controller through an Arduino.

Notifications You must be signed in to change notification settings

jonitram/pokebreederbot

Repository files navigation

Poke Breeder Bot

As long as the in-game preconditions are met before plugging in the device, plugging the Arduino directly into the Switch through a USB Type B to USB Type C cable should enable the bot to start picking up and hatching eggs automatically without any user input

In-Game Information

Preconditions

  • You are not on your bike
  • You are currently at the Nursery in the Wild Area
  • The current weather does not have falling particles (ie. falling rain from raining / snow from snowing / etc). If the weather does have falling particles, change the date to a day that the Wild Area Nursery does not have falling particles. DISCLAIMER More testing needs to be done on which weathers break the bot. YMMV - The bot may work on some weathers with falling particles.
  • There is an egg waiting for you at the Nursery
  • Ensure that when you hit "X" the cursor is on the "Town Map" icon
  • Your party is full of non-egg pokemon (The first pokemon will never be swapped out so it can be a flame body pokemon)
  • None of the pokemon in your party are holding any items (except the first one, since it is never going to be swapped out it is allowed to hold an item)
  • In-Game Options:
    • Text Speed: Fast
    • Send to Boxes: Manual
    • Give Nicknames: Don't Give
    • Vertical Camera Control: Regular
  • It's recommended to direct your box to a series of empty boxes before beginning the automatic breeding process

Breeding Duration Values

  • Disclaimer: All of the breeding duration information including the steps2breedingduration.py script assume a party lead with flame body. If you do not use a flame body lead, then double the values

    Breeding Duration Pokemon Cycles Steps Cycling Time
    2150 (51 seconds) Togepi 10 2.5k 29 seconds
    1850 (44 seconds) Litten 15 3.8k 50 seconds
    2250 (53 seconds) Darumaka 20 5.1k 62 seconds
    2550 (60 seconds) Duskull 25 6.4k 77 seconds
    2900 (69 seconds) Duraludon 30 7.6k 93 seconds
    3500 (83 seconds) Dreepy 40 10.2k 123 seconds
  • To use the steps2breedingduration.py script type:

    ./steps2breedingduration.py <number of steps to hatch the egg>

    Where the number of steps to hatch the egg is the value taken from this link in the far right column of the species of pokemon you are trying to hatch

  • Change the breeding_duration variable at the top of instructions.h to match the value given as a result of running the steps2breedingduration.py script before making and flashing Joystick.hex to the Arduino

Setting up the Arduino

  • Disclaimer: These instructions were written for Mac OSX in the context of an Arduino with an atmega16u2 chip

Dependencies and Compiling

  • Install dfu-programmer through homebrew with:

    brew install dfu-programmer

  • To compile this project you need AVR GCC Compiler and Tools. This can be installed through homebrew with:

    brew tap osx-cross/avr

    followed by

    brew install avr-gcc

  • Download the LUFA library through this link at the bottom of the page, put it in this directory, and rename the folder to LUFA

  • Make sure the LUFA_PATH inside the makefile points to the LUFA subdirectory that you just created inside this directory (should be ./LUFA/LUFA)

  • Ensure that the makefile setting for MCU is set to MCU = atmega16u2 and compile by typing make

Putting the Arduino in DFU Mode

  • Plug the Arduino into a computer

  • Put the Arduino in DFU mode if it is not already by bridging the reset pin with the ground

  • If necessary, ensure the Arduino is in DFU mode by typing:

    sudo dfu-programmer atmega16u2 get ID1

Flashing onto the Arduino

  • Navigate to the folder containing the .hex file you are flashing onto the Arduino

  • In this case, the .hex file to be flashed onto the Arduino is called Joystick.hex generated by the makefile

  • Follow these commands to flash the .hex file:

    sudo dfu-programmer atmega16u2 erase

    sudo dfu-programmer atmega16u2 flash <.hex file>

    sudo dfu-programmer atmega16u2 reset

  • You can also use the flash.sh shell script (either through the command sh flash.sh or ./flash.sh) which makes the code and runs all 3 of the above dfu-programmer commands to flash the code onto the Arduino once it is in DFU mode

  • If you receive this error:

    dfu-programmer: no device present.

    but your Arduino is plugged in and the lights are on then you most likely need to put the Arduino into DFU mode by bridging its reset and ground pins

About

Automating Pokemon breeding in Pokemon Sword and Shield by mimicking a controller through an Arduino.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published