Simple chess cheat for lichess based on opencv. #
Highlight above the board the best next move for you.
The program will wait for the opponent turn depend on the clients chosen color. Then it will loop through every cell to detect the last moveset and feed the stockfish engine. Which will predict the best next move for the client. The clients moves are gathered by detecting the position where the client clicked on the board. And then translated to a moveset. In the old method we captured every 501 milliseconds the board to detect the last moveset. That brought up a big problem because if the opponent moved too fast we would miss the clients move. Using this method you can even play bullet mode.
Use pip install -r requirements.txt to install all dependencies.
1) Download the main.py and the data folder 2) Download stockfish from here: https://stockfishchess.org/download/ I'v used "64-bit: Maximally compatible but slow." Keep in mind the exe file needs to be at same drive as the scripts running on. Also you might need to change the file name in code! Not just the path. 3) You need to extract the exe file you downloaded and in main.py code, change the path to your stockfish engine exe file. 4) About the stockfish.set_depth(16) you can put higher values. The higher the value the more accurate the prediction But it's also slower. Using set depth 16 I tied against stockfish level 8 so it's preety strong as it is. 5) 1) Open up a game while logged in to lichess (Playing as anonymous will change the board size and mess everything Also it's only tested on chrome and on 100% zoom while logged in). 2) During the freeze time open up the program choose your starting color. And alt+tab back to the browser (Don't use your mouse). Keep in mind that your mouse clicks from that moment matters. So play like that: 1 click represent the from cell and 1 click represent the to cell when it's your turn. No dragging pieces. No checking youtube for a second It will mess everything and the program will crash
Keep in mind lichess would most definetly ban you for playing against other players. Play only against bots!
This entire project done for the purpose of challenge and education.
Not for the purpose of cheating
Developed on Python 3.7.7