Chess bot can play automatically as white or black on lichess.com, chess.com and any website using drag and drop to move pieces

Related tags

MiscellaneousChessBot
Overview

Chessbot

"Why create another chessbot ?" The explanation is simple : I did not find a free bot I liked online : all the bots I saw on internet are parsing the html of the different websites to find the positions. But it creates a big limitation : if there is a new website, or a new html organisation, nothing will work. On the other hand my bot just looks at the screen and work with it to find the chessboard and the pieces. It is much more robust !

This chess bot can play automatically as white or black on lichess.com, chess.com, chess24.com and theoretically any website using drag and drop to move pieces. It uses stockfish engine to process moves, mss to do fast screenshots, pyautogui to move the mouse, chess to store and test the moves, and opencv to detect the chessboard. It has been written only with python.

About the bot level, it beats easily chess.com computer on level 8/10 (around 2000 ELO) when taking 1.2 second per move and crushes every human opponent on any time format longer than 1 minute.

This bot has been developped on iOS, but all the librairies it is using are compatible on Linux and Windows too.

Getting Started

Prerequisites

Stockfish:

This bot uses stockfish to calculate the next best move. Here is the procedure to make it work :

  • Download stockfish for your OS (https://stockfishchess.org/download/), the macOS stockfish I used is already commited.
  • Add it to your path with : export PATH=$PATH:$(pwd)
  • Test that stockfish is working well by running the command stockfish in your terminal. It should output something like this: Stockfish 120218 64 by T. Romstad, M. Costalba, J. Kiiski, G. Linscott

Python:

This bot requires python 3 to run

Using the bot:

The bot runs very easily:

  • go in the folder that contains the source code
  • Run the command python3 main.py

Limitations:

This project is far from perfect yet, it has a few limitations :

  • Because of the computer vision algorithm used to detect the chessboard, the square colors should be with plain colors, without having wierd textures.
  • The GUI is still quite basic
  • One small deviation during a game (the board moved, the user touched the mouse...) and the bot will not work at all.
  • It is not possible to stop the chessbot without closing the window
  • This project has been tested only on a Mac

Please feel free to help me improve it

Author

Stanislas Heili - Initial work - myGit

Owner
Dhimas Bagus Prayoga
👑 Leader and Owner @Komodo-OS-Rom @Kry9toN-Project 🤓 Noob Development 👨‍💻 Pentesting
Dhimas Bagus Prayoga
Python library for the analysis of dynamic measurements

Python library for the analysis of dynamic measurements The goal of this library is to provide a starting point for users in metrology and related are

Physikalisch-Technische Bundesanstalt - Department 9.4 'Metrology for the digital Transformation' 18 Dec 21, 2022
Reconhecimento de voz, em português, com python

Speech_recognizer Reconhecimento de voz, em português, com python O ato de falar nada mais é que criar vibrações no ar. Por meio de um conversor analó

Marcus Vinícius Ribeiro Andrade 1 Dec 14, 2021
Code repo for the book "Feature Engineering for Machine Learning," by Alice Zheng and Amanda Casari, O'Reilly 2018

feature-engineering-book This repo accompanies "Feature Engineering for Machine Learning," by Alice Zheng and Amanda Casari. O'Reilly, 2018. The repo

Alice Zheng 1.3k Dec 30, 2022
KUIZ is a web application quiz where you can create/take a quiz for learning and sharing knowledge from various subjects, questions and answers.

KUIZ KUIZ is a web application quiz where you can create/take a quiz for learning and sharing knowledge from various subjects, questions and answers.

Thanatibordee Sihaboonthong 3 Sep 12, 2022
Repls goes to sleep due to inactivity, but to keep it awake, simply host a webserver and ping it.

Repls goes to sleep due to inactivity, but to keep it awake, simply host a webserver and ping it. This repo will help you make a webserver with a bit of console controls.

2 Mar 01, 2022
Incident Response Process and Playbooks | Goal: Playbooks to be Mapped to MITRE Attack Techniques

PURPOSE OF PROJECT That this project will be created by the SOC/Incident Response Community Develop a Catalog of Incident Response Playbook for every

Austin Songer 987 Jan 02, 2023
This suite consists of two different scripts, made to automate attacks against NoSQL databases.

NoSQL-Attack-Suite This suite consists of two different scripts, made to automate attacks against NoSQL databases. The first one looks for a NoSQL Aut

16 Dec 26, 2022
Capture screen and download off Roku based devices

rokuview Capture screen and download off Roku based devices Tested on Hisense TV with Roku OS built-in No guarantee this will work with all Roku model

3 May 27, 2021
Programming labs for 6.S060 (Foundations of Computer Security).

6.S060 Labs This git repository contains the code for the labs in 6.S060. In these labs, you will add a series of security features to a photo-sharing

MIT PDOS 10 Nov 02, 2022
SimilarWeb for Team ACT v.0.0.1

SimilarWeb for Team ACT v.0.0.1 This module has been built to provide a better environment specifically for Similarweb in Team ACT. This module itself

Sunkyeong Lee 0 Dec 29, 2021
Alfred 4 Workflow to search through your maintained/watched/starred GitHub repositories.

Alfred 4 Workflow to search through your maintained/watched/starred GitHub repositories. Setup This workflow requires a number of Python modules. Thes

Bᴇʀɴᴅ Sᴄʜᴏʀɢᴇʀs 1 Oct 14, 2022
Notes on the Deep Learning book from Ian Goodfellow, Yoshua Bengio and Aaron Courville (2016)

The Deep Learning Book - Goodfellow, I., Bengio, Y., and Courville, A. (2016) This content is part of a series following the chapter 2 on linear algeb

hadrienj 1.7k Jan 07, 2023
CaskDB is a disk-based, embedded, persistent, key-value store based on the Riak's bitcask paper, written in Python.

CaskDB - Disk based Log Structured Hash Table Store CaskDB is a disk-based, embedded, persistent, key-value store based on the Riak's bitcask paper, w

886 Dec 27, 2022
Gba-free-fonts - Free font resources for GBA game development

gba-free-fonts Free font resources for GBA game development This repo contains m

28 Dec 30, 2022
Stopmagic gives you the power of creating amazing Stop Motion animations faster and easier than ever before.

Stopmagic gives you the power of creating amazing Stop Motion animations faster and easier than ever before. This project is maintained by Aldrin Mathew.

Aldrin's Art Factory 67 Dec 31, 2022
Blender addon to import images as meshes

ImagesAsMesh Blender addon to import images as meshes. Inspired by: ImagesAsPlanes Installation It's like just about every other Blender addon. Downlo

Niccolo Zuppichini 4 Jan 04, 2022
Cairo-math-64x61 - Fixed point 64.61 math library for Cairo / Starknet

Cairo Math 64x61 A fixed point 64.61 math library for Cairo & Starknet Signed 64

Influence 63 Dec 05, 2022
combs is a package used to generate all possible combinations of a given length k on a given set.

The package combs is a package used to generate all possible combinations of a given length k on a given set. The set is given as a list, and k must b

1 Dec 24, 2021
pyRTOS is a real-time operating system (RTOS), written in Python.

pyRTOS Introduction pyRTOS is a real-time operating system (RTOS), written in Python. The primary goal of pyRTOS is to provide a pure Python RTOS that

Ben Williams 96 Dec 30, 2022
Python-Roadmap - Дорожная карта по изучению Python

Python Roadmap Я решил сделать что-то вроде дорожной карты (Roadmap) для изучения языка Python. Возможно, если найдутся желающие дополнять ее, модифиц

Ruslan Prokhorov 1.2k Dec 28, 2022