Automate Android Game Card Pulls with ADB and Image Recognition
This guide explains how to build an Android automation script that uses ADB screenshots and OpenCV template matching to detect and repeatedly pull cards in a game, handling start, SSR/SR detection, and completion without manual interaction.
Introduction
The official version already provides scripts for automatic soul, awakening, and exploration, so we created a card‑pulling script to let power users obtain many SSRs without manual clicks.
Implementation steps:
Use ADB to capture a screenshot and determine whether the app is on the card‑pull screen.
If so, apply matchTemplate() to locate the “Start Summon” button.
Simulate a tap on the button.
Again use matchTemplate() with templates for SSR and SR icons and tap them.
When the “Ten‑pull” text appears (indicating the draw is finished), tap “Back”.
Key screen regions are identified for start, SSR/SR detection, and finish.
Region for detecting SSR or SR results.
Region for recognizing the end of the draw.
All interactions are performed via ADB, which simulates taps and swipes on the phone (USB debugging must be enabled).
The core of the script resides in /lib/ats.py, allowing the main program to repeatedly screenshot, check for SR/SSR, and determine when the draw ends.
Image‑recognition is the essential technique used throughout.
Note: The original content is sourced from the internet.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Python Programming Learning Circle
A global community of Chinese Python developers offering technical articles, columns, original video tutorials, and problem sets. Topics include web full‑stack development, web scraping, data analysis, natural language processing, image processing, machine learning, automated testing, DevOps automation, and big data.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
