Spaces:
Sleeping
Sleeping
TheYoBots commited on
Commit ·
caf20c6
1
Parent(s): 3ed0155
Fix Readme.md
Browse files
README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
| 3 |
[](https://github.com/TheYoBots/Lishogi-Bot/actions/workflows/python-build.yml)
|
| 4 |
[](https://lishogi.org/player/bots)
|
| 5 |
|
| 6 |
-
A bridge between [Lishogi's API](https://lichess.org/api#tag/Bot) and Lishogi USI Bots. In case you don't know English, view the [Japanese Translation here (日本語翻訳)](https://github.com/TheYoBots/Lishogi-Bot/wiki/Japanese-Translation).
|
| 7 |
|
| 8 |
## How to Install
|
| 9 |
### Mac/Linux:
|
|
@@ -20,7 +20,7 @@ source ./venv/bin/activate
|
|
| 20 |
python3 -m pip install -r requirements.txt
|
| 21 |
```
|
| 22 |
- Copy `config.yml.default` to `config.yml`.
|
| 23 |
-
- Edit the `config.yml` file to your liking by changing the supported [variants](/config.yml.default#
|
| 24 |
|
| 25 |
### Windows:
|
| 26 |
- **NOTE: Only Python 3.7 or later is supported!**
|
|
@@ -37,12 +37,12 @@ python -m venv .venv # if this fails you probably need to add Python to your PA
|
|
| 37 |
pip install -r requirements.txt
|
| 38 |
```
|
| 39 |
- Copy `config.yml.default` to `config.yml`.
|
| 40 |
-
- Edit the `config.yml` file to your liking by changing the supported [variants](/config.yml.default#
|
| 41 |
|
| 42 |
## Lishogi OAuth
|
| 43 |
- Create an account for your bot on [Lishogi.org](https://lishogi.org/signup).
|
| 44 |
- **NOTE: If you have previously played games on an existing account, you will not be able to use it as a bot account.**
|
| 45 |
-
- Once your account has been created and you are logged in, [create a personal OAuth2 token with the "Play games with the bot API" ('play:bot' scopes)](https://lishogi.org/account/oauth/token/create?scopes[]=bot:play&
|
| 46 |
- A `token` (e.g. `xxxxxxxxxxxxxxxx`) will be displayed. Store this in the `config.yml` file as the `token` field.
|
| 47 |
- **NOTE: You won't see this token again on Lishogi, so save it or store it somewhere.**
|
| 48 |
|
|
@@ -53,11 +53,9 @@ pip install -r requirements.txt
|
|
| 53 |
- **Note: The engine you add has to be running under the USI protocol, only then it will work.**
|
| 54 |
|
| 55 |
## Creating a homemade bot
|
| 56 |
-
|
| 57 |
As an alternative to creating an entire chess engine and implementing one of the communiciation protocols (USI), a bot can also be created by writing a single class with a single method. The `search()` method in this new class takes the current board and the game clock as arguments and should return a move based on whatever criteria the coder desires.
|
| 58 |
|
| 59 |
Steps to create a homemade bot:
|
| 60 |
-
|
| 61 |
1. Do all the steps in the [How to Install](#how-to-install)
|
| 62 |
2. In the `config.yml`, change the engine protocol to `homemade`
|
| 63 |
3. Create a class in some file that extends `MinimalEngine` (in `strategies.py`).
|
|
@@ -188,6 +186,10 @@ To output more information (including your engine's thinking output and debuggin
|
|
| 188 |
python lishogi-bot.py -v
|
| 189 |
```
|
| 190 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 191 |
## Tips & Tricks
|
| 192 |
- You can specify a different config file with the `--config` argument.
|
| 193 |
- Here's an example systemd service definition:
|
|
|
|
| 3 |
[](https://github.com/TheYoBots/Lishogi-Bot/actions/workflows/python-build.yml)
|
| 4 |
[](https://lishogi.org/player/bots)
|
| 5 |
|
| 6 |
+
A bridge between [Lishogi's Bot API](https://lichess.org/api#tag/Bot) and Lishogi USI Bots. In case you don't know English, view the [Japanese Translation here (日本語翻訳)](https://github.com/TheYoBots/Lishogi-Bot/wiki/Japanese-Translation).
|
| 7 |
|
| 8 |
## How to Install
|
| 9 |
### Mac/Linux:
|
|
|
|
| 20 |
python3 -m pip install -r requirements.txt
|
| 21 |
```
|
| 22 |
- Copy `config.yml.default` to `config.yml`.
|
| 23 |
+
- Edit the `config.yml` file to your liking by changing the supported [variants](/config.yml.default#L45-L47), [timings](/config.yml.default#L48-L54), [challenge modes](/config.yml.default#L55-L57) and [incoming challenges](/config.yml.default#L34-L44), so that it plays shogi the way you want it to.
|
| 24 |
|
| 25 |
### Windows:
|
| 26 |
- **NOTE: Only Python 3.7 or later is supported!**
|
|
|
|
| 37 |
pip install -r requirements.txt
|
| 38 |
```
|
| 39 |
- Copy `config.yml.default` to `config.yml`.
|
| 40 |
+
- Edit the `config.yml` file to your liking by changing the supported [variants](/config.yml.default#L45-L47), [timings](/config.yml.default#L48-L54), [challenge modes](/config.yml.default#L55-L57) and [incoming challenges](/config.yml.default#L34-L44), so that it plays shogi the way you want it to.
|
| 41 |
|
| 42 |
## Lishogi OAuth
|
| 43 |
- Create an account for your bot on [Lishogi.org](https://lishogi.org/signup).
|
| 44 |
- **NOTE: If you have previously played games on an existing account, you will not be able to use it as a bot account.**
|
| 45 |
+
- Once your account has been created and you are logged in, [create a personal OAuth2 token with the "Play games with the bot API" ('play:bot' scopes)](https://lishogi.org/account/oauth/token/create?scopes[]=bot:play&description=Lishogi+Bot+Token) selected and a description added.
|
| 46 |
- A `token` (e.g. `xxxxxxxxxxxxxxxx`) will be displayed. Store this in the `config.yml` file as the `token` field.
|
| 47 |
- **NOTE: You won't see this token again on Lishogi, so save it or store it somewhere.**
|
| 48 |
|
|
|
|
| 53 |
- **Note: The engine you add has to be running under the USI protocol, only then it will work.**
|
| 54 |
|
| 55 |
## Creating a homemade bot
|
|
|
|
| 56 |
As an alternative to creating an entire chess engine and implementing one of the communiciation protocols (USI), a bot can also be created by writing a single class with a single method. The `search()` method in this new class takes the current board and the game clock as arguments and should return a move based on whatever criteria the coder desires.
|
| 57 |
|
| 58 |
Steps to create a homemade bot:
|
|
|
|
| 59 |
1. Do all the steps in the [How to Install](#how-to-install)
|
| 60 |
2. In the `config.yml`, change the engine protocol to `homemade`
|
| 61 |
3. Create a class in some file that extends `MinimalEngine` (in `strategies.py`).
|
|
|
|
| 186 |
python lishogi-bot.py -v
|
| 187 |
```
|
| 188 |
|
| 189 |
+
## To Quit
|
| 190 |
+
- Press `CTRL+C`.
|
| 191 |
+
- It may take some time to quit.
|
| 192 |
+
|
| 193 |
## Tips & Tricks
|
| 194 |
- You can specify a different config file with the `--config` argument.
|
| 195 |
- Here's an example systemd service definition:
|