How to make advanced image recognition bots using python

Kian Brose · 1.5M views · 2020 · 15:01

Open on YouTube

Python, Ruby & scripting languagesComputer vision, speech & NLPTesting, debugging & developer toolstutorialdated

Why Stack Overflow recommends it

Stack Overflow users link it when answering or describing screen-automation tasks that rely on pyautogui's locateOnScreen, and askers cite it as the tutorial they followed when their bot code misbehaves.

Recommended by 1 people across 1 different months, 2021 to 2023.

What it is

A 15-minute tutorial by Kian Brose on building game bots that find images on screen with Python. It covers the basics of PyAutoGUI and win32api, using screen image matching to trigger mouse clicks, with code on GitHub.

What people said

Recommends Abdullah Osama · 2021-01 · Stack Overflow · on “open my.exe file and insert text from my.txt”

you can use libraries like pyautogui or pynupt to control the mouse to click on the checkbox and you can use the locateOnScreen() function available in pyautogui to find the coordination of the text field and the button take care that they may take over your device XD Here is an insight Video That will give you details of how to Create such bots How to make advanced image recognition bots using python [this video]

Cites Rable · 2021-02 · Stack Overflow · on “file ending in .py considered .txt file and not launching with python idle”

im trying to follow this tutorial [this video] first i tried with python 3.9.2 but the comments suggested using 3.7.9 so i uninstalled 3.9.2 and i installed 3.7.9 with shell (im a complete newbie in this i have no clue what any of this means) and re did the commands inputed into the console in 3.7.9 after that i created the project folder inside of it i created the txt file and called it bot.py how ever it was still considered a TxT file the tutorial said to open the file with idle but when i tried to do that the option did no appear so i tried to directly make it open following this C:\Users\me\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Python 3.7 and after that the bot.py file did no

Cites icegalaxy1223 · 2023-11 · Stack Overflow · on “Error with python image recognition script”

from pyautogui import * import pyautogui import time import keyboard import random import win32api, win32con while 1: if pyautogui.locateOnScreen('orange shape.png', confidence=0.8) != None: print ("I can see it") time.sleep(0.5) else: print("I am unable to see it") time.sleep(0.5)` I watched this video here: [this video] I did everything the guy in the video said to, I wrote the code exactly the same as him, but whenever the code can't see the image, it gives me an error instead of saying "I am unable to see it". But it works fine when it can see the image And this is the error: Traceback (most recent call last): File "C:\Users\Stupid Idiot\AppData\Local\Programs\Python\Python37\lib\site-package