WARNING: This depends on the unmerged code in Baekalfen/PyBoy#233
If you have any questions, or just want to chat, join us on Discord.
This is a very simple example of creating a plugin for PyBoy. It contains the boilerplate code necessary to create, build and register the plugin.
Steps to create a plugin:
- Fork this repo, or copy the files.
- Rename the
auto_pause.py
/.pxd
file to your plugin name. - Rename the AutoPause class in the
.py
and.pxd
files to your plugin class. - Add your plugin code. You can see the available methods to override in the PyBoyPlugin class. Or subclass from one of the other plugin types.
- Build the code with Cython:
python3 setup.py build_ext sdist bdist_wheel
or without Cython:python3 setup.py sdist
- Install the package:
python3 -m pip install dist/*.whl
orpython3 -m pip install dist/*.tar.gz
- Run PyBoy:
pyboy ... --autopause
If you don't want to build the plugin with Cython, you can remove the .pxd
file and set CYTHONIZE_FILES = []
in the setup.py
file.