[Python] Looking for a more precise image recognition compared to pyautogui. (Clash of Clans -...

Discussão em 'Python' iniciado por Stack, Abril 27, 2025.

  1. Stack

    Stack Membro Participativo

    just the usual Python idea I guess. Wanted to create a bot that looks for a base on its own until one matching the required minimum is found (did this using pyautogui and pytesseract, screenshotting the gold and elixir and comparing its total sum to a hard-coded integer).

    Now, I did not just want to make the attack start randomly - I wanted to identify all air-defenses the base has and then hit them with my lightning spells (for non-COC-players, air defenses are highlighted here in RED): [​IMG]

    Now, I thought, I could just use the pyautogui image recognition with a lower confidence and it would find those air defenses and give me the coords - well, thought wrong. No matter the settings (greyscale, confidence, the amount of zoom), it still is not able to compare those two images:

    [​IMG][​IMG]

    without absolutely pointing out the wrong coordinates on the screen. I looked for alternatives already, but besides paid AI's I had no luck. Any idea, or do I have to finish it sloppy without being able to take out Air Defenses before deploying the troops (which will be the easy part)?

    Thanks in advance ^^

    Continue reading...

Compartilhe esta Página