- Windows
- MacOS
- Linux, tested and confirmed working on the following distros:
- Ubuntu 24.04
- Debian 12
- Pop!_OS 22.04 LTS
- Arch Linux
- Python 3.12 Windows installer 64-bit
- Tick
Add Python to PATH
when installing Python
- Tick
- Python 3.12 macOS 64-bit universal2 installer or
brew install [email protected]
- mGBA 0.10.x
brew install mgba
Note: brew
requires Homebrew to be installed.
- Python 3.12 or
sudo apt install python3.12
- Install the following packages with
apt
or appropriate package manager:sudo apt install python3-distutils python3-tk libmgba0.10 portaudio19-dev
- If
libmgba0.10
is not available on your distro, you can manually install the mGBA 0.10.x .deb package which includeslibmgba0.10
Visit the releases page for the latest stable releases, download the pokebot-DATE.zip file.
The bot has an auto-updater that will check for new stable releases, once a day.
Expand
To download the latest dev releases, go to the top of the repo page > click the green Code button > Download ZIP.
Alternatively, if you'd like to be able to easily pull the latest dev releases, use git:
- Install GitHub Desktop (you don't need an account)
- Click Clone a repository from the Internet...
- Use repository URL
https://github.com/40Cakes/pokebot-gen3.git
and choose a save location on your PC - Click Clone
- Any time there's a new update, you can pull the latest changes by clicking Fetch origin, then Pull origin
- Windows Terminal - recommended for full 🌈colour🌈 and ✨emoji support✨ in the console output
- Notepad++ - recommended for syntax highlighting while editing
.yml
config files
Expand
If you're using Python for any other projects, it is **highly recommended** to use a virtual environment (`venv`) to isolate these packages from your base environment.Once Python is installed, set up a venv
, open a shell in the bot directory and enter the following command:
python -m venv .
A venv
may be “activated” using a script in its binary directory (bin
on POSIX; Scripts
on Windows). This will prepend that directory to your PATH, so that running python will invoke the environment’s Python interpreter and you can run installed scripts without having to use their full path. The invocation of the activation script is platform-specific (<venv>
must be replaced by the path to the directory containing the virtual environment):
Platform | Shell | Command to activate virtual environment |
---|---|---|
POSIX | bash/zsh fish csh/tcsh PowerShell |
$ source <venv>/bin/activate $ source <venv>/bin/activate.fish $ source <venv>/bin/activate.csh $ <venv>/bin/Activate.ps1 |
Windows | cmd.exe PowerShell |
C:\> <venv>\Scripts\activate.bat PS C:\> <venv>\Scripts\Activate.ps1 |
Once activated, run the bot (your shell should show (venv)
if activated correctly):
(venv)$ python ./pokebot.py
(POSIX)
(venv) PS C:\> python ./pokebot.py
(Windows)
- Place some official Pokémon .gba ROMs into the
./roms/
folder - Double click
pokebot.py
or runpython pokebot.py
in a terminal and follow the on-screen steps to create and/or select a profile
The bot ships with the default mGBA input mapping, see here for the default mapping, or customise them to your preference.
You must ensure you are able to escape battle 100% of the time, otherwise the bot will get stuck. If you have a save from mGBA that you'd like to import and use with the bot, then you will need to import the save state.
This bot is still in development, as such, functionality is subject to change - always make sure you back up your ./profiles/
folder before updating your bot!
- In mGBA (standalone), run a game and load into the save file
- File > Save State File... > Save
- Double click
pokebot.py
or runpython pokebot.py
in a terminal > type a profile name > click Load Existing Save - Open the save state file you just saved
- A new bot profile will be created in the
./profiles/
folder, and launched
Expand
The bot supports auto-starting a profile and can also be launched into a "debug" mode which will open an extra pane next to the emulator to aid bot development.
The debug tabs includes information such as currently running game tasks and callbacks, emulator inputs, as well as information about recent battles, player status, current map, daycare and event flags.
positional arguments:
profile Profile to initialize. Otherwise, the profile selection menu will appear.
options:
-h, --help show this help message and exit
-m {MODE_NAME}, --bot-mode {MODE_NAME}
Initial bot mode (default: Manual)
-s {0,1,2,3,4,8,16,32}, --emulation-speed {0,1,2,3,4,8,16,32}
Initial emulation speed (0 for unthrottled; default: 1)
-nv, --no-video Turn off video output by default
-na, --no-audio Turn off audio output by default
-t, --always-on-top Keep the bot window always on top of other windows
-d, --debug Enable extra debug options and a debug menu
Use environment variable POKEBOT_UNTHEMED=1
with debug mode as ttkthemes
causes major lag with complex UIs.