Skip to content

Usage guide

ercdndrs edited this page Apr 17, 2021 · 8 revisions

If you haven't yet installed all the requisite software as detailed by the Installation Guide, head there now.

Preparing for your first run

Before you run the bot, it needs to know certain things about your hardware setup and about your game. This information needs to be added to a configuration file.

Manual configuration

  1. Open Config.sample.toml in Notepad (or similar text editor).
  2. Click "File" -> "Save As".
  3. Change the name to Config.toml. Ensure that the file is saved as a .toml file (and not a .txt file) by changing "Save as type:" to "All Files (.)".
  4. Following the instructions, modify every value that comes before the ADVANCED section to suit your setup. The bot will hunt the top-most saved legendary path you have by default (although this behaviour can be changed in the ADVANCED section).
  5. If your game language is not in English, change the LANGUAGE value to your game's language. The supported languages are shown in the bottom portion of the file; if you cannot find a section for your language (e.g., [Spanish]) then we do not support your language out of the box. You can manually add your language by copying one of the other language's sections and replacing the values with phrases from your language.

Configuration using the UI (Windows only)

  1. Run AutoMaxLair.exe.
  2. Fill in the fields in the UI with values appropriate for your setup. Check the tooltips for instructions on each field.
  3. Press "Save" to save the configuration file, then close the UI.

Starting your first run

This section details how you should set up your game and computer for your first AutoMaxLair run.

In-game setup

  1. Ensure your text speed is set to "Fast".
  2. Ensure the setting for sending Pokemon to a box automatically is on.
  3. Stock up on balls. The bot catches every rental Pokemon so it will spend a lot of the BASE_BALL especially. We recommend you have at least one Poke ball in your inventory as well, even if you are not using it for any of your catches.
  4. Sort your ball bag by first favouriting your BASE_BALL and LEGENDARY_BALL, then sorting "By type", then sorting by "Favorites first". This sequence should place your chosen balls at the top of your bag with Poke balls directly underneath.
  5. Go to the Max Lair and stop in front of the scientist, then disconnect any wireless controllers and plug the Switch into the dock.

Running the bot

We recommend running AutoMaxLair for the first time in IDLE (or another Python IDE) so any errors are easily noted in the console.

  1. Open the main script in IDLE by right-clicking auto_max_lair.py and selecting "Edit in IDLE". If that option does not appear, start IDLE and then click "File" -> "Open", then navigate to auto_max_lair.py and select it.
  2. Select the script window and press F5 on the keyboard to run it.
  3. Make note of the messages shown in the Python Shell. Don't be discouraged if an error (indicated by red text) appears! Most users will miss something on their first try.

If everything was configured correctly, the bot will run until it finds a shiny legendary or until it runs out of resources. Depending on the boss, it should take a day or two on average if you have the shiny charm (15 minutes per run, variable success rate but usually above 50%, 1/100 shiny chance for the legendary with the Shiny Charm). It will also keep any other shiny Pokemon it finds but will continue running after (when using the default mode).

If you want to quit the program prematurely, press exit button or the Q key while the focus is on the Output window. The program will quit before the next scheduled action. It is not possible to restart the program mid-way through a run; you will have to finish the run manually or reset your game before starting the bot again. If you do reset the game, note that you must talk to the scientist to clear her dialogue about quitting mid Dynamax Adventure before starting the bot again.

Troubleshooting

In general, any error or warning shown in the log or in the console should be taken seriously. Errors are often descriptive so please take the time to read and attempt to understand an error before seeking external help in solving it. Some common errors are tabulated in Table 1; if you are still unsure what is wrong, please submit an issue on GitHub or reach out on our Discord.

Table 1: Frequently encountered errors when trying to run AutoMaxLair for the first time and their resolutions.

Error Resolution
"No module named xyz" One or more of the additional Python modules was not installed. Revisit the Installation Guide.
"[Errno 2] No such file or directory: 'Config.toml'" Ensure the config file is saved as Config.toml and not Config.sample.toml or Config.toml.txt.
"serial.serialutil.SerialException: could not open port X" The COM port indicated in Config.toml is likely incorrect. For Windows users, the port name should be "COMX" where X is a number that depends on your machine. The number can be found by finding the serial device in the Device Manager.
"AssertionError: XYZ" An internal error raised by the program, usually because of an invalid input. Read the error for the specific issue.
The program starts but video from your webcam is shown. Change the VIDEO_INDEX in Config.toml.
The program starts but no button presses are registered. Repeated warnings appear in the log: "Received "X" instead of sent "Y"." If X is b'', your wires between the UART device and microcontroller may be configured incorrectly, or the wrong hex file may be loaded on the microcontroller. If X is the Y from the previous message, one of the serial buffers may have become desynchronized. Close the program, the completely unplug the UART device and microcontroller from both the Switch and your computer. Plug everything back in and try again.
The program starts but no button presses are registered. No warnings appear in the log. Check that no wireless controllers are connected to the Switch and that it is properly seated in the dock. We recommend starting in the "Change grip/order" screen to avoid this issue altogether.
The program starts and joins a Dynamax adventure, but crashes when choosing a rental Pokemon. The Tesseract path is likely incorrect in Config.toml. Ensure it points to the location where you installed Tesseract. Alternatively, if you specified a non-English language, the corresponding X.traineddata file may not be downloaded or placed in the appropriate folder.
The program runs, but no coloured boxes appear on the screen. The boxes are not necessary for the bot to run. If you would still like to see them, set ENABLE_DEBUG_LOGS to true in Config.toml.
The program starts, but gets stuck in a certain spot (e.g., on the "Fight" menu) with the video playing but no actions being performed. If there is a black border all the way around the game video, the Switch's Screen Size needs to be changed to 100%. See Nintendo's guide for instructions on this step.
When checking the caught Pokemon for shininess, the small red rectangle partially overlaps with the grey Galar symbol. This behaviour is normal; the Galar symbol will be shifted to the right in the case of a shiny.

Advanced operation

In addition to the standard mode which always finishes the Dynamax Adventure without resetting the game, four additional modes can be implemented by updating the appropriate field in Config.ini. These modes are summarized in Table 2.

Table 2: Summary of the benefits and drawbacks of using the different operation modes.

Mode Benefits Drawbacks
Default Accumulates Dynite Ore. Lower win rate, especially against difficult bosses. Wastes balls used to catch the legendary.
Strong Boss Higher win rate. Wastes fewer balls used to catch the legendary. Can consume Dynite Ore*
Ball Saver Higher win rate. Wastes no balls used to catch the legendary. Can rapidly consume Dynite Ore. Ignores non-legendary shiny Pokemon.
Keep Path Highest win rate if you find a good seed beforehand. Wastes no balls used to catch the legendary. Rapidly consumes Dynite Ore. Ignores non-legendary shiny Pokemon.
Find Path Useful for finding a path to use "Keep Path" mode on. Utility mode that is not needed for general use.

*The strong boss and ball saver modes can be made Dynite Ore-neutral (i.e., neither produces nor consumes) by setting the amount of starting Dynite Ore to zero in Config.ini. Difficult bosses may also cause the bot to lose and break a reset streak, causing ore to accumulate but at a reduced rate.

Clone this wiki locally