GithubHelp home page GithubHelp logo

arav123456833 / lichess-bot Goto Github PK

View Code? Open in Web Editor NEW

This project forked from the-bot-makers/lichess-bot

0.0 0.0 0.0 224.08 MB

The code template to make a Lichess Bot and deploy it to heroku server easily.

Home Page: https://lichess.org/@/master_bot

License: BSD 3-Clause "New" or "Revised" License

Shell 0.36% Python 99.64%

lichess-bot's Introduction

Lichess-bot

Python Build

The code template to make a Lichess Bot and deploy it to heroku server easily.

This is the code of @master_bot in lichess.org

Chess Engines

  • Stockfish 14.1+(dev) POPCNT + SSE41
  • v14 Fairy Stockfish POPCNT + SSE41

Polyglot Opening Books

Heroku Buildpack

  • heroku/python

Heroku Stack

  • heroku-20 (allowing a maximum hash size of 512 mb)

How to Use

  • Fork this repository.
  • Create a new heroku app.
  • Go to the Deploy tab and click Connect to GitHub.
  • Click on search and then select your fork of this repository.
  • Then Enable Automatic Deploys and then select the main branch (which is already done by default usually) and Click Deploy.
  • Once it has been deployed, go to Resources tab on heroku and enable worker (bash startbot.sh) dynos. (Do note that if you don't see any dynos in the Resources tab, then you must wait for about 5 minutes and then refresh your heroku page.)
  • Finally go to your Settings tab and then under Config Vars click on Reveal Config Vars and then in the place of key type in LICHESS_BOT_TOKEN and in the place of value add your Lichess Bot Token.
  • You're now connected to lichess and awaiting challenges! Your bot is up and ready!

Note: Incase of any errors during deploy of code to heroku, make sure to set the buildpack in the 'Settings' tab in heroku as given in the instructions here

Important Notes

  • Make sure to disable/switch off the dyno once you are not monitoring your bot, for the bot used to crash in bullet often. In the recent very few games, this stopped happening, but until it is fully tested, switch off the dyno when you are monitoring your bot. If any error shows up in the logs, immediately restart all dynos by more-restart all dynos.
  • Also swith off your bot when you are shutting your computer down, else it might crash. This happens due to the bot losing connection with heroku. To prevent this your internet has to be running smoothly and constantly connected to heroku.
  • This bot uses 120 MB hash size with 5 threads. This is quite strong, but the downside is games at a time. Heroku's free dyno's limitations are crossed even with 2-3 games in one go. So make sure you don't play many games in one go. If you want multiple games at a time, reduce the values of threads and hash in the lichessbot.py and use multithreading to handle multiple games. This is mainly caused due to rate limiting from heroku or lichess. This can be prevented by increasing 'rate_limiting_delay' in the 'config.yml' file.
  • Compared to other bots, this bot plays relatively fast, and the time taken is static. I am trying to figure out a way to have better time management.
  • When changing engines make sure you rename your engine name in the startbot.sh file, line 2 with chmod a+x engines/engine-name, where engine-name must be replaced with the name of your engine. If your engine name is the same after changing your engine, this doesn't need to be done. Also do note forgot to change the engine name in the config.yml file too, where name: "sf" must be changed to name: "engine-name", where engine-name is the name of your engine. All engines must be placed in the engines folder.

lichess-bot's People

Contributors

abhijato avatar theyobots avatar deepsourcebot avatar lidevelopers avatar srimethan 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.