Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First Steps Questions #6

Open
WolfgangFahl opened this issue Dec 21, 2019 · 9 comments
Open

First Steps Questions #6

WolfgangFahl opened this issue Dec 21, 2019 · 9 comments

Comments

@WolfgangFahl
Copy link

WolfgangFahl commented Dec 21, 2019

On my Mac with MacOS 10.13.6 and macports it did the following steps

git clone https://github.com/tailuge/bot-o-tron
cd bot-o-tron
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash
# relogin since bash profile is changed ...
nvm install v10.15.3
npm install -g yarn
npm i -D nyc
yarn install
export API_TOKEN=xxxxxxxxxx
yarn test

which is a bit more than described in your readme. The tests ran fine and yarn start seems to do something sensible. The last line is

Wake up server listening on 5000

Where to go from here? How is a Javascript bot now integrated?

@tailuge
Copy link
Owner

tailuge commented Dec 21, 2019 via email

@WolfgangFahl
Copy link
Author

WolfgangFahl commented Dec 21, 2019

Thank you for your swift response.
I already had a bot account and didn't know how to proceed. By chance i saw that there were some entries like:

STREAM data : {"type":"gameStart","game":{"id":"FitklaCe"}}
GET api/bot/game/stream/FitklaCe stream
STREAM data : {"id":"FitklaCe","variant":{"key":"standard","name":"Standard","short":"Std"},"clock":null,"speed":"correspondence","perf":{"name":"Correspondence"},"rated":false,"createdAt":1576917061855,"white":{"id":"seppl2019","name":"seppl2019","title":"BOT","rating":1500,"provisional":true},"black":{"aiLevel":1},"initialFen":"startpos","type":"gameFull","state":{"type":"gameState","moves":"","wtime":2147483647,"btime":2147483647,"winc":0,"binc":0,"bdraw":false,"wdraw":false}}
seppl2019 as white to move f2f3
POST api/bot/game/FitklaCe/move/f2f3 {}
{"ok":true}
STREAM data : {"type":"gameState","moves":"f2f3","wtime":2147483647,"btime":2147483647,"winc":0,"binc":0,"bdraw":false,"wdraw":false}
STREAM data : {"type":"gameState","moves":"f2f3 e7e5","wtime":2147483647,"btime":2147483647,"winc":0,"binc":0,"bdraw":false,"wdraw":false}
seppl2019 as white to move g2g4
POST api/bot/game/FitklaCe/move/g2g4 {}
{"ok":true}
STREAM data : {"type":"gameState","moves":"f2f3 e7e5 g2g4","wtime":2147483647,"btime":2147483647,"winc":0,"binc":0,"bdraw":false,"wdraw":false}
STREAM data : {"type":"gameState","moves":"f2f3 e7e5 g2g4 d8h4","wtime":2147483647,"btime":2147483647,"winc":0,"binc":0,"bdraw":false,"wdraw":false}

I still do not understand what to do next to integrate my own software. See WolfgangFahl/play-chess-with-a-webcam#17

@tailuge
Copy link
Owner

tailuge commented Dec 21, 2019 via email

@WolfgangFahl
Copy link
Author

Are you able to challenge it to a game on lichess logged in with your human account?
Yes
When you play the moves in lichess you will see this kind of output which shows you the moves >played by the opponent and the move the bot wants to play.
My use case is a bit different - i want to play with two human players and only record the game. Do I need two bot accounts for that or would one do?

Also I still don't see what I need to do to modify the behavior of the bot. Is there already a preconfigured chess bot active?

To implement your chess bot you only need to create one class that implements the method:_

Where and how do i do that? How is this class integrated?

@WolfgangFahl
Copy link
Author

I see there are 4 bots in the bots directory. How is the active bot selected?

@tailuge
Copy link
Owner

tailuge commented Dec 21, 2019 via email

@WolfgangFahl
Copy link
Author

So I am reverse engineering this by looking at the source code ... it would be great if the readme would state a bit about these assumptions:

  links += await startBot(process.env.API_TOKEN, new PatzerPlayer());
  links += await startBot(process.env.API_TOKEN_SWARM, new AntiPatzerPlayer());

So indeed there might be wo tokens and two bots involved ...

@tailuge
Copy link
Owner

tailuge commented Dec 21, 2019 via email

@WolfgangFahl
Copy link
Author

Since my server is in python i'll first use https://github.com/rhgrant10/berserk to get aquainted with the API as such and may be get back later to this javascript library. Thanks for the help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants