Giter Club home page Giter Club logo

chessbotcom's Introduction

After some research, watching how others failed to create this, I made the evilest online chess automatic player, lulz. This reads the browser board via screenshot, periodically, comparing each square on the image with a previously saved initial board's squares, where the pieces are known. Then trades info with a running chess engine. Don't just load stockfish on it, this is dumb. It's meant to test experimental chess engines, know how well they're doing. Methods like javascript injection to automate chess playing on websites like chess.com or lichess most likely fail, as the page admins will know if this kind of stuff is happening, as reported by some who tried.
A safe approach... the downside is that a non perfect screen positioning will screw the rest of the match. Also piece position recognition may fail.. game lost.

Requires: [python modules] imagehash, python-chess, pyautogui
[executables] imagemagick, xdotool

Usage:
-> Open the online chess website, showing the board on the starting position (white bottom).
-> Set 'WhiteSquareColor' variable @./keyConstants.py. Corresponds to the color of white chess squares on the screenboard.
RGB tuple values: 'WhiteSquareColor = (240,217,181)'
-> Setup the screen and run '$./runGame.py --reference' (@ first run, redo whenever you change screen positioning/configs for whatever reason.)
-> Start the game, quickly run '$./runGame.py'
-> Don't move the screen away from the referenced position, don't zoom.
-> Game window needs to be on foreground. Clicking has to be done.
-> Avoid alt-tabbing from the browser window. This will screw your mouse operations while it runs, so just watch.

chessbotcom's People

Contributors

gab0 avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.