├── LICENSE ├── README.md ├── lichess.js └── lichess_assist.js /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Inusha Hapuarachchi 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Lichess Bot 2 | The game : http://lichess.org. 3 | 4 | Using Javascript you can utilise the open source chess engine stockfish (v9) https://github.com/nmrugg/stockfish.js/blob/master/src/stockfish.asm.js alongside websockets to have a fully automated bot that does not even need to be viewable on your screen (no mouse clicks etc) in around 40 lines of code. 5 | Although I hope no one will actually use this against real players since it does ruin the game for everyone and you gain nothing from it. 6 | The only reason I started writing this was as procrastination for the advanced architecture exam I have in an hour today as well as because all the attempts that I saw on the internet achieve a lot less than this whilst using hundreds of more lines of code and silly dependencies! (You only need pure javascript). 7 | 8 | [![demo](https://img.youtube.com/vi/MaQtq-yYvNE/0.jpg)](https://www.youtube.com/watch?v=MaQtq-yYvNE) 9 | 10 | After the latest update it is fully automated (if you have tampermonkey). Just give it a starting game and it will automatically start playing and find opponents after game end. 11 | 12 | 13 | # How to use 14 | 1. Get into a Lichess game 15 | 2. Open console (usually F12) 16 | 3. Copy paste ```lichess.js``` into the console. NOTE: this part might take a few seconds to copy paste since the chess engine is in the code. 17 | Note : The above is outdated - install tampermonkey and use this script directly to automatically inject instead of manual copy pasting into console 18 | 19 | # Extra 20 | You can easily customise the stockfish engine in my code to perform however you want it to (e.g. set mindepth or skill level parameters to increase/decrease elo. 21 | 22 | # Todo 23 | - [X] Play Ultra Bullet. EXTRA : Abuse pre-move implementation to make server think we are taking 0s when we're not 24 | - [X] Intercept Websocket receive events to capture FEN instead of using XML HTTP requests to stop refreshing of page to allow for consistent ultra bullet play. Also update to have larger random (not so often) spikes of delays if this update is applied. 25 | 26 | - [X] Bypasses anti-bot (Not on ultra bullet). If you look at the source of Lichess you will notice that if you account for "inconsistent move times", "low accuracy", "no fast moves" and "don't always have advantage" you can evade all automated bot checks as long as you are not ban evading which is checked by IP, user agent and fingerprint 27 | 28 | - [ ] ~~Add opening book to engine~~ 29 | 30 | - [ ] Use findings to update lichess anti cheat on Git? 31 | --------------------------------------------------------------------------------