- Capture device screen, crop game board
- Use image matching to detect tile classes
- calculate the best move
chrome_S2vuL8rA44.mp4
There are 3 versions of the bot
- run.py - uses ADB for communication, it is slow because of getting a screenshot delay
- run_pyautogui.py - uses only autoguipy, much faster, because no adb connection is required, just a stream of your device (f.e scrcpy)
- run_combo.py - combination of both ADB and AutoGuiPy, AGP used for screenshots and ADB for swipe input (I couldn't get swipes properly functioning using AGP), it is very fast and the version that's shown in the showcase video
I switched to culebra from ADB shell, because adb shell has a huge (1s +) delay You can follow CulebraTester2 setup guide here https://github.com/dtmilano/CulebraTester2-public
You'll have to find your own grid size and tile size as these are hardcoded
You can do so by enabling Pointer location
in android developer settings and then getting x, y values from each grid corner and from tile corners.
- Capture full device screen
- Crop it to the grid's size
- Convert the RGB images to greyscale and apply histogram equalization
- Use OpenCV to match given template assets with the game board items
- Use brute force to find the best move (this should be improved)
TODO:
- Somehow avoid hardcoded sizes and coordinates
- Improve match finding algo