Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/adriagual/marvel-snap-bot
A computer vision bot made with OpenCV and ADB.
https://github.com/adriagual/marvel-snap-bot
adb android automation opencv python3
Last synced: about 22 hours ago
JSON representation
A computer vision bot made with OpenCV and ADB.
- Host: GitHub
- URL: https://github.com/adriagual/marvel-snap-bot
- Owner: AdriaGual
- Created: 2022-12-31T18:08:10.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2023-02-26T10:05:52.000Z (over 1 year ago)
- Last Synced: 2023-03-08T12:24:19.431Z (over 1 year ago)
- Topics: adb, android, automation, opencv, python3
- Language: Python
- Homepage:
- Size: 15.5 MB
- Stars: 58
- Watchers: 9
- Forks: 18
- Open Issues: 19
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Marvel Snap Bot
A computer vision bot made with OpenCV and ADB.
Key Features •
How To Use •
Improvements![Animation](https://user-images.githubusercontent.com/25803231/210187037-1d01c383-95ff-481a-99e3-566fe0e93715.gif)
![Capture](https://user-images.githubusercontent.com/25803231/210183326-e543da5a-ef14-44e5-8cd5-770eec453c02.PNG)
## Key Features
- Card detection
- Detect player cards on live time
- Automate the decision making
- Mana consumption tracked
- Fields with different priorities and constraints
- ADB Support (Bluestacks, any version)
- Global utils to apply for other computer vision bots
- Calculate the power of the cards
- Farm missions
- Farm season pass
- Play kazoo decks with applied logic
- Quick usage## How To Use
To clone and run this application, you'll need [Git](https://git-scm.com), [OpenCV](https://opencv.org/), [Bluestacks](https://www.bluestacks.com/es/index.html) and [Python 3](https://www.python.org/).
From your command line:```bash
# Clone this repository
$ git clone https://github.com/AdriaGual/marvel-snap-bot# Go into the repository
$ cd marvel-snap-bot# Install dependencies
$ pip install -r requirements.txt# Edit the config.py file
adb_path: Absolute path to where you can execute ADB
project_path: Absolute path to the project
images_folder: Absolute path to the images folder
fields_folder: Absolute path to the fields images folder
mana_folder: Absolute path to the mana images folder
turns_folder: Absolute path to the turns folder
data_folder: Absolute path to the card images folder
tmp_path: Absolute path to a tmp folder# Make sure that Bluestacks has the ADB enabled
Settings -> Advanced -> Android Debug Bridge (ADB)# Check if you have the correct resolution
The script is made to work on 1600x900 resolution
```
## Add the images to the each folder
You can grab them from the emulator, there is an option on the script to get the info in real time. Just change the False parameter from the functions get_my_hands_cards and get_fields.
![image](https://user-images.githubusercontent.com/25803231/211024589-c4545e4b-523c-40f0-b1c1-3302bf1ed83b.png)## Card images structure folder
Remember that this cards need its values entered manually on the cp_list.py file![image](https://user-images.githubusercontent.com/25803231/211023744-f587976f-be89-41a8-a798-619c8209d29e.png)
## Images structure folder
![image](https://user-images.githubusercontent.com/25803231/211023945-26312bae-9ac6-437e-82f8-18c1d9140d94.png)```bash
# Run the bot
$ python start.py
```> **Note**
> In order to see the bot start, you must install the game (Marvel Snap Bot) on Bluestacks and start it.## Improvements
There are plenty of improvements still, here's a bunch of:
- Fields should be detected automatically
- The points of each field is not tracked, it can be done with pytesseract
- The cards on the player field don't show the power
- Detect the enemy cards on the field
- Keep track of the winrate of a session## License
MIT
---