Skip to content

This Python script searches for specific images on the screen and clicks on them if found. It can be useful for automating tasks where specific images need to be located and interacted with on the screen, such as in game automation or UI testing.

License

Notifications You must be signed in to change notification settings

2cz5/Python-Image-Clicker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 

Repository files navigation

Image Search and Click Automation

(If you enjoy this scipt, download it, or find it interesting in any way please conisder giving the repo a star. It will help more people find it, and help the community in improving it.)

Changelog

Added

  • Killswitch functionality to stop the script execution by pressing a specified key.
  • Error handling for minimizing the command prompt window.
  • Improved code readability and organization.

Changed

  • Refactored the minimize_cmd_window function to minimize just the command prompt.
  • Enhanced the search_and_click function to handle a large number of image paths efficiently.

Fixed

  • Resolved issues with the killswitch not working properly.
  • Fixed bugs related to image path validation and error reporting.

[1.2] - 5-8-24 3:33 PM CDT


Example|showcase:

2024-05-08.17-36-29.mp4

Description

This Python script searches for specific images on the screen and clicks on them if found. It can be useful for automating tasks where specific images need to be located and interacted with on the screen, such as in game automation or UI testing.

IMPORTANT NOTE:This Python code is compatible with the Windows operating system. This is because it relies on the win32gui and win32con modules, which are specific to Windows. Additionally, it utilizes the pyautogui library, which is compatible with Windows, macOS, and Linux, but the specific functionality used in this code (screen capturing and clicking) is primarily intended for Windows. Therefore, while the script may technically run on other operating systems, its functionality may be limited or behave differently on non-Windows platforms.

Requirements

  • Python 3.x
  • OpenCV (cv2)
  • NumPy (numpy)
  • PyAutoGUI (pyautogui)
  • Keyboard (keyboard)
  • Win32gui (win32gui)
  • Win32con (win32con)

Usage

  1. Clone the repository to your local machine. (Or click on code, then download zip.)
  2. Ensure you have all the required libraries installed. You can install them using pip: pip install opencv-python numpy pyautogui keyboard pywin32
  3. Replace the paths in the image_paths list with the paths to your actual images.
  4. Run the script using command prompt
  5. Press the 'q' key to stop the script at any time.

Notes

  • Make sure the images you want to search for are available in the specified paths.
  • Adjust the threshold value as needed for accurate template matching.
  • This script may require adjustments based on the specific requirements of your task.

Contributing:

Contributions are welcome! Feel free to open an issue or submit a pull request.

Author:

Made by 2cz5. For any questions or suggestions, you can reach out to me on Discord:2cz5

About

This Python script searches for specific images on the screen and clicks on them if found. It can be useful for automating tasks where specific images need to be located and interacted with on the screen, such as in game automation or UI testing.

Topics

Resources

License

Stars

Watchers

Forks

Languages