- Blind mode tutorial
lichess.org
Donate

How to make my lichess bot play moves?

I've coded a lichess bot using cmd prompt, and tryed playing a game with it but it automatically got aborted. How do i let it play moves on its own?

BTW - Bot's name is @Chess_Probot

I've coded a lichess bot using cmd prompt, and tryed playing a game with it but it automatically got aborted. How do i let it play moves on its own? BTW - Bot's name is @Chess_Probot

Hi!

I've coded a lichess bot using cmd prompt,
Cool!

and tryed playing a game with it but it automatically got aborted.
Doh!

How do i let it play moves on its own?
Hmm, did you expect it to make moves?
That is,
when you coded your lichess bot,
did you give it the ability to make moves?
Or was this going as you expected - the game would get aborted beause your lichess bot can't make moves yet?

The Lichess API is documented at https://lichess.org/api
It describes all the ways you can interact with Lichess API from an application such as a lichess bot.

Here's the documentation for the endpoint which a developer can use in their application to send moves for a Lichess BOT account,
https://lichess.org/api#tag/Bot/operation/botGameMove

Here's a Lichess blog about Lichess Bots,
https://lichess.org/blog/WvDNticAAMu_mHKP/welcome-lichess-bots

Chess on!

Hi! > I've coded a lichess bot using cmd prompt, Cool! > and tryed playing a game with it but it automatically got aborted. Doh! > How do i let it play moves on its own? Hmm, did you expect it to make moves? That is, when you coded your lichess bot, did you give it the ability to make moves? Or was this going as you expected - the game would get aborted beause your lichess bot can't make moves yet? The Lichess API is documented at https://lichess.org/api It describes all the ways you can interact with Lichess API from an application such as a lichess bot. Here's the documentation for the endpoint which a developer can use in their application to send moves for a Lichess BOT account, https://lichess.org/api#tag/Bot/operation/botGameMove Here's a Lichess blog about Lichess Bots, https://lichess.org/blog/WvDNticAAMu_mHKP/welcome-lichess-bots Chess on!

I didn't know how to code it to play moves. what do i need to add?

I didn't know how to code it to play moves. what do i need to add?

@Kabirshi_ofs said in #3:

I didn't know how to code it to play moves. what do i need to add?
And do i need to feed in my desired moves to the cmd prompt?

@Kabirshi_ofs said in #3: > I didn't know how to code it to play moves. what do i need to add? And do i need to feed in my desired moves to the cmd prompt?

So my guess is, based on your questions,
that you thought that if you created a Lichess account,
and used the Lichess API "Upgrade to Bot account" (https://lichess.org/api#tag/Bot/operation/botAccountUpgrade),
to change the account type to BOT,
that it would start playing on its own?

That is not the case, the Lichess BOT account will not start playing on its own.

Changing the account type to BOT,
makes it possible for you as a developer to write an application which can send HTTP requests (described in the Lichess API https://lichess.org/api) to play games with that BOT account.

So your BOT account will not do anything until you interact with it via the Lichess API (typically from an application which you as a developer is creating).
The possible ways you can interact with the BOT account are described in the Lichess API documentation (https://lichess.org/api#tag/Bot)

I didn't know how to code it to play moves. what do i need to add?
And do i need to feed in my desired moves to the cmd prompt?

You can come up with moves any way you like, you are the developer.
You could for instance send moves manually from the cmd prompt.
You could for instance write a chess engine and ask that chess engine what move to send.

Lichess doesn't need to know how you generate the move for your BOT account.
For your BOT account to make a move, you need to send the move to Lichess.

Here's an example where someone has published an application which can control a Lichess BOT account,
https://github.com/RealCyGuy/random-lichess

It looks like it uses a Python library called "berserk" to interact with the Lichess API.
It looks like the way it chooses moves is by randomly picking a move based on which moves are legal in the current position and sends that move.

I haven't written a Lichess BOT application myself, so I don't really have any advice on steps how to learn how to use the Lichess API to play BOT games. But looking at examples of how others have done it (searching on github, for instance) must surely be a gold mine!

Chess on!

So my guess is, based on your questions, that you thought that if you created a Lichess account, and used the Lichess API "Upgrade to Bot account" (https://lichess.org/api#tag/Bot/operation/botAccountUpgrade), to change the account type to BOT, that it would start playing on its own? That is not the case, the Lichess BOT account will not start playing on its own. Changing the account type to BOT, makes it possible for you as a developer to write an application which can send HTTP requests (described in the Lichess API https://lichess.org/api) to play games with that BOT account. So your BOT account will not do anything until you interact with it via the Lichess API (typically from an application which you as a developer is creating). The possible ways you can interact with the BOT account are described in the Lichess API documentation (https://lichess.org/api#tag/Bot) > I didn't know how to code it to play moves. what do i need to add? > And do i need to feed in my desired moves to the cmd prompt? You can come up with moves any way you like, you are the developer. You could for instance send moves manually from the cmd prompt. You could for instance write a chess engine and ask that chess engine what move to send. Lichess doesn't need to know how you generate the move for your BOT account. For your BOT account to make a move, you need to send the move to Lichess. Here's an example where someone has published an application which can control a Lichess BOT account, https://github.com/RealCyGuy/random-lichess It looks like it uses a Python library called "berserk" to interact with the Lichess API. It looks like the way it chooses moves is by randomly picking a move based on which moves are legal in the current position and sends that move. I haven't written a Lichess BOT application myself, so I don't really have any advice on steps how to learn how to use the Lichess API to play BOT games. But looking at examples of how others have done it (searching on github, for instance) must surely be a gold mine! Chess on!

@tors42 said in #5:

I haven't written a Lichess BOT application myself, so I don't really have any advice on steps how to learn how to use the Lichess API to play BOT games. But looking at examples of how others have done it (searching on github, for instance) must surely be a gold mine!

Hmm, so things happened and I created a Lichess bot: @charibot
The code is here: https://github.com/tors42/charibot
(Similarly to the Python library called "berserk", I used a Java library called "chariot")

Chess on!

@tors42 said in #5: > I haven't written a Lichess BOT application myself, so I don't really have any advice on steps how to learn how to use the Lichess API to play BOT games. But looking at examples of how others have done it (searching on github, for instance) must surely be a gold mine! Hmm, so things happened and I created a Lichess bot: @charibot The code is here: https://github.com/tors42/charibot (Similarly to the Python library called "berserk", I used a Java library called "chariot") Chess on!

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