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
Checkers Project Built Using Python

Checkers Project Built Using Python

Meekness Anyaeche 1 Nov 08, 2021
Return-Parity-MDP - Towards Return Parity in Markov Decision Processes

Towards Return Parity in Markov Decision Processes Code for the AISTATS 2022 pap

Jianfeng Chi 3 Nov 27, 2022
Set of scripts that schedules employees for shifts throughout the week based on availability, shift times, and shift necessities

Automatic-Scheduler Set of scripts that schedules employees for shifts throughout the week based on availability, shift times, and shift necessities *

Matthew 1 May 01, 2022
Would upload anything I do with/related to brainfuck

My Brainfu*k Repo Basically wanted to create something with Brainfu*k but realized that with the smol brain I have, I need to see the cell values real

Rafeed 1 Mar 22, 2022
MatroSka Mod Compiler for ts4scripts

MMC Current Version: 0.2 MatroSka Mod Compiler for .ts4script files Requirements Have Python 3.7 installed and set as default. Running from Source pip

MatroSka 1 Dec 13, 2021
Url-check-migration-python - A python script using Apica API's to migrate URL checks between environments

url-check-migration-python A python script using Apica API's to migrate URL chec

Angelo Aquino 1 Feb 16, 2022
This application demonstrates IoTVAS device discovery and security assessment API integration with the Rapid7 InsightVM.

Introduction This repository hosts a sample application that demonstrates integrating Firmalyzer's IoTVAS API with the Rapid7 InsightVM platform. This

Firmalyzer BV 4 Nov 09, 2022
Modify version of impacket wmiexec.py, get output(data,response) from registry, don't need SMB connection, also bypassing antivirus-software in lateral movement like WMIHACKER.

wmiexec-RegOut Modify version of impacket wmiexec.py,wmipersist.py. Got output(data,response) from registry, don't need SMB connection, but I'm in the

小离 228 Jan 04, 2023
The Google Assistant on a rotary phone

Google Assistant Rotary Phone Shoutout to my dad who had this idea a year ago and I'm only now getting around to doing it. Notes This is the code used

rydercalmdown 10 Nov 04, 2022
Demo code for "Logs in distributed systems" webinar

Hexlet Logs Demo Пререквизиты docker-compose python3 Учетка в DataDog Базовое понимание, что такое логи (можно почитать гайд

Anton Markelov 1 Dec 01, 2021
Make pack up python files easier.

python-easy-pack make pack up python files easier. 目前只提供了中文环境 如何使用? 将index.py复制到你的项目文件夹,或者把.py文件拷贝到这个文件夹。 打开你的cmd或者powershell 切换到程序所在目录,输入python index

2 Dec 15, 2021
Software that extracts spreadsheets from various .pdf files to .csv

Extração de planilhas de diversos arquivos .pdf para .csv O código inteiro foi desenvolvido em Python. Foi utilizado o pacote "tabula" e a biblioteca

Marcos Silva 2 Jan 09, 2022
Advanced python code - For students in my advanced python class

advanced_python_code For students in my advanced python class Week Topic Recordi

Ariel Avshalom 3 May 27, 2022
Created a Python Keylogger script.

Python Script Simple Keylogger Script WHAT IS IT? Created a Python Keylogger script. HOW IT WORKS Once the script has been executed, it will automatic

AC 0 Dec 12, 2021
Graphene Metanode is a locally hosted node for one account and several trading pairs, which uses minimal RAM resources.

Graphene Metanode is a locally hosted node for one account and several trading pairs, which uses minimal RAM resources. It provides the necessary user stream data and order book data for trading in a

litepresence 5 May 08, 2022
This is where I learn machine learning

This is where I learn machine learning🤷‍ This means that this repo covers no specific topic of machine learning or a project - I work in here when I want to learn/try something

Wilhelm Berghammer 47 Nov 16, 2022
Do you need a screensaver for CircuitPython? Of course you do

circuitpython_screensaver Do you need a screensaver for CircuitPython? Of course you do Demo video of dvdlogo screensaver: screensaver_dvdlogo.mp4 Dem

Tod E. Kurt 8 Sep 02, 2021
Projeto de Jogo de dados em Python 3 onde é definido o lado a ser apostado e número de jogadas, pontuando os acertos e exibindo se ganhou ou perdeu.

Jogo de DadoX Projeto de script que simula um Jogo de dados em Python 3 onde é definido o lado a ser apostado (1, 2, 3, 4, 5 e 6) ou se vai ser um núm

Estênio Mariano 1 Jul 10, 2021
Developed a website to analyze and generate report of students based on the curriculum that represents student’s academic performance.

Developed a website to analyze and generate report of students based on the curriculum that represents student’s academic performance. We have developed the system such that, it will automatically pa

VIJETA CHAVHAN 3 Nov 08, 2022
Flames Calculater App used to calculate flames status between two names created using python's Flask web framework.

Flames Finder Web App Flames Calculater App used to calculate flames status between two names created using python's Flask web framework. First, App g

Siva Prakash 4 Jan 02, 2022