A bot for the mobile app Infinite Stairs in Python. Two methods of object-detection can be used; Multi-Template Matching and YOLOv10.
- Install conda or miniconda
- Create the environment: for Multi-Template Matching (Windows):
for YOLO (Windows):
conda env create -f environment_mtm.yml
conda env create -f environment_yolo.yml
- Make sure you can activate the environment: for Multi-Template Matching
(Windows):
for YOLO (Windows):
conda activate isb-mtm
conda activate isb-yolo
- Run tests [TODO]
pytest tests
- Configure settings config.ini for your device's specifications [TODO]
- Run
main.py
to run the bot. (more details TBD)
The bot operates using three main components: screenshots, processing, and game inputs. Each component is run in parallel using multiprocessing since the processing step is by far the largest speed bottleneck.
The portion of the screen containing the game client is captured using the mss library.
- Screenshots are processed using either Multi-Template Matching or a YOLO model (subject to change, new models come out every several months :\) to detect stair and other miscellaneous objects.
- A path-tracing algorithm fills in any empty spaces missed by the previous step (max two consecutive stairs can be filled due to logical constraints).
- Fill a queue with
True
(Turn) orFalse
(Forward) values based on the path. - Keep track of a "current" queue state and "new" queue state. If their intersection is "valid" then queue new values from the "new" state into the "current" state. If the "current" queue is empty, use the "new" state as the "current" state.
The game will turn the character on True
and step forward on False
. Use
PyDirectInput to send keystrokes to the client.
Thomas, L.S.V., Gehrig, J. Multi-template matching: a versatile tool for object-localization in microscopy images BMC Bioinformatics 21, 44 (2020). https://doi.org/10.1186/s12859-020-3363-7