https://github.com/hajin-park/infinite-stairs-bot
Infinite Stairs bot on the BlueStacks 5 emulator
https://github.com/hajin-park/infinite-stairs-bot
bot infinite-stairs multi-template-matching opencv python yolov10
Last synced: 4 months ago
JSON representation
Infinite Stairs bot on the BlueStacks 5 emulator
- Host: GitHub
- URL: https://github.com/hajin-park/infinite-stairs-bot
- Owner: hajin-park
- License: gpl-3.0
- Created: 2022-10-11T00:05:50.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-05-31T04:02:55.000Z (over 1 year ago)
- Last Synced: 2025-03-12T03:44:42.197Z (7 months ago)
- Topics: bot, infinite-stairs, multi-template-matching, opencv, python, yolov10
- Language: Python
- Homepage:
- Size: 348 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Infinite Stairs Bot
A bot for the mobile app Infinite Stairs in Python. Two methods of
object-detection can be used; Multi-Template Matching and YOLOv10.
## Requirements
1. Enable virtualization on your device.
[Guide](https://support.bluestacks.com/hc/en-us/articles/360058102252-How-to-enable-Virtualization-VT-on-Windows-10-for-BlueStacks-5?utm_campaign=bgp_product&utm_medium=app_player&utm_source=support#%E2%80%9CB%E2%80%9D)
2. Install BlueStacks 5 (or other emulator).
[Download](https://www.bluestacks.com/download.html)## Usage
1. Install
[conda](https://docs.conda.io/projects/conda/en/latest/user-guide/install/index.html)
or [miniconda](https://docs.anaconda.com/free/miniconda/)
2. Create the environment: _for Multi-Template Matching (Windows):_
```
conda env create -f environment_mtm.yml
```
_for YOLO (Windows):_
```
conda env create -f environment_yolo.yml
```
3. Make sure you can activate the environment: _for Multi-Template Matching
(Windows):_
```
conda activate isb-mtm
```
_for YOLO (Windows):_
```
conda activate isb-yolo
```
4. Run tests [TODO]
```
pytest tests
```
5. Configure settings config.ini for your device's specifications [TODO]
6. Run `main.py` to run the bot. _(more details TBD)_## Design [TODO]
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.#### Screenshots
The portion of the screen containing the game client is captured using the mss
library.#### Processing
1. 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.
2. 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).
3. Fill a queue with `True` (Turn) or `False`(Forward) values based on the path.
4. 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.#### Game Inputs
The game will turn the character on `True` and step forward on `False`. Use
PyDirectInput to send keystrokes to the client.## Acknowledgements
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