Skip to content

The-bot-makers/Lishogi-Bot-Heroku

Repository files navigation

lishogi-bot

Python Build

The code template to make a Lishogi Bot and deploy it to heroku server easily. This is the code of @libot and similar heroku run bots in lishogi.org

Engine communication code taken from https://github.com/TheYoBots/Lishogi-Bot by TheYoBots

Shogi Engine

Heroku Buildpack

Heroku Stack

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

How to Use

  • Fork this repository.
  • Edit only your token in the config.yml file over here.
  • 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.)

You're now connected to lishogi and awaiting challenges! Your bot is up and ready!

Important Notes

  • This code might result in many crashes, so if any error shows up in the logs, immediately restart all dynos by clucking on more in the top right corner of your heroku app and then click restart all dynos. Also do create an issue with your error logs if it has not already been discussed in another issue.
  • Do note that on heroku you are allowed a maximum of 550 hours a month, so you can't run your bot 24/7 unless you have a verified account. To get a verified account you will need to provide your payment details, but no payment is required. Once this is done, your account becomes verified and you are provided an additional 450 hours a month which sums up to a total of 1000 hours a month which is more than what is needed to run your bot 24/7 on lishogi.
  • This bot uses 256 MB hash size with 10 threads (stack: heroku-20). This is quite strong. 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 config.yml file and use multithreading to handle multiple games. This is mainly caused due to rate limiting from heroku. This can be prevented by decreasing the hash and threads in the config.yml file.
  • 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: "fairy-stockfish" 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.

About

No description, website, or topics provided.

Resources

License

MIT, Unknown licenses found

Licenses found

MIT
LICENSE
Unknown
COPYING.txt

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages