Skip to content

Chess bot to play on whatever website using Python, OpenCV & PyAutoGUI

Notifications You must be signed in to change notification settings

maksimKorzh/opencv-chess-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 

Repository files navigation

OpenCV Chess Bot

a proof of concept implementation of visual chessboard recognition
and automated move making on the screen using Python, OpenCV and PyAutoGUI

Demo video

IMAGE ALT TEXT HERE

How it works

  1. Makes a board screenshot
  2. Detects chess pieces and stores it's coordinates
  3. Generates FEN string based on piece coordinates
  4. Passes FEN to the UCI engine
  5. Converts best move to square coordinates on screen
  6. Moves a mouse to coordinates associated with the source square then mimics a click,
    moves a mouse to coordinates associated with the target square then mimics a click
  7. Repeats until the game is over

Disclaimer

Because of a cheating being a big issue nowadays
I didn't put any effort to adapt this project to be
easily used out of the box by end users, e.g. chess cheaters.
This project is intended for programmers with a tinkering purposes in mind.
Before asking any questions or opening issues make sure to follow
the tutorials below - they are short and full of the timestamps
so you can watch only those parts you're interested in

How to use it - YouTube tutorials

IMAGE ALT TEXT HERE

About

Chess bot to play on whatever website using Python, OpenCV & PyAutoGUI

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages