AdriaGual / marvel-snap-bot

A computer vision bot made with OpenCV and ADB.
106 stars 27 forks source link
adb android automation opencv python3


Markdownify
Marvel Snap Bot

A computer vision bot made with OpenCV and ADB.

Python

Key FeaturesHow To UseImprovements

Animation

Capture

Key Features

How To Use

To clone and run this application, you'll need Git, OpenCV, Bluestacks and Python 3. From your command line:

# 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

Card images structure folder

Remember that this cards need its values entered manually on the cp_list.py file

image

Images structure folder

image

# 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:

License

MIT