lichess.org
Donate

Hyper Bot - new ideas for bot development

@AHappyBee , you have not posted any link in your own or your bot accounts' profile to the source of your bot, so I'm not sure what you mean and how your bot was created ( is it lichess-bot or your own code ? )
I think @AHappyBee means that rather than make lichess-bot into a web project, they used Heroku worker dynos instead, which can run 24/7 without sleeping (which is also what I did). This way, all we have to add are 2 files: a Procfile and a startbot.sh file, which contains the engine chmod start-up, and deploy from CLI. In this case the Procfile points to the bash script. In my opinion this is more straightforward as there's only two things we need:

Procfile:
worker: bash run.sh

run.sh:
#!/bin/bash
chmod +x engines/stockfish_20090216_x64
python lichess-bot.py

Of course Heroku is linux-based, and so the Engine file must be a linux file :)
If you invoke a script like bash script.sh, then you don't need the shebang in the first line ( the shebang is for cases when the script is a stand alone command and you need to let the operation system know by what interpreter it should run the script ).

As far as running without sleeping is concerned, this can be easily simulated with a web process type as well. The only thing you need is to make requests to any of the pages of the server at regular intervals ( once in every ten minutes is fine, as the server sleeps after being idle for half an hour ). In fact I do this with my bot, if the time is between early morning and late evening, the bot keeps itself alive.

https://i.imgur.com/lLiN2lp.png
@Jay1210 , I think it is better if you provide some information in your bot's profile as to what code / hardware it runs on, simply stating that you created a bot, does not carry to much information, as it takes only a single API request to create one
im only big brain enough to understand 30% of that but it sounds good!
boy, I made it, the bot can now play any lichess variant !

( for playing other than standard, config var USE_SCALACHESS has to be set to "true", config var ACCEPT_VARIANTS should be the space separated variant keys, example: "standard atomic horde racingKings" )

why is this such a big deal ?, you may ask

well, lichess-bot can play any variant, but lichess-bot is written in Python, and there is a good variant library, python-chess

my bot is in Javascript, and the only good variant library is scalachess compiled to Javascript, called scalachessjs; however scalachessjs is an html web worker, and in node I can only use node web workers

to convert an html web worker to a node web worker, well this was quite a headache, but finally I managed to do it; not that the solution was so complicated, but finding out on my own what to do, now, that was complicated :)
I framed #19 as a StackOverflow answer

I posted the answer to a very old and unsolved question, I really did not hope that anyone would be interested, however within minutes it was upvoted, may be the side product of my bot development is a down to earth, practical solution to a problem which others tried to solve using complicated dependencies, that were not maintained any more, and which fail with the current Node.js version

stackoverflow.com/questions/14522543/html5-web-workers-in-nodejs/64523255#64523255

This topic has been archived and can no longer be replied to.