-
Notifications
You must be signed in to change notification settings - Fork 33
Home
- If you don't have Python, you may download it here: (https://www.python.org/downloads/). When installing it, enable "add Python to PATH", then go to custom installation (this may be not necessary, but on some computers it won't work otherwise) and enable all options (especially "install for all users"), except the last . It's better to install Python in a path without spaces, like "C:\Python".
- To type commands it's better to use PowerShell. Go to Start menu and type "PowerShell" (you may use cmd too, but sometimes it may not work).
- Then you may need to upgrade pip. Execute
python -m pip install --upgrade pip
in PowerShell. - Download the repo into lishogi-bot directory.
- Navigate to the directory in PowerShell:
cd [folder's adress]
(like "cd C:\shogi\lishogi-bot"). - Install virtualenv:
pip install virtualenv
. - Setup virtualenv:
virtualenv .venv -p python
(if this fails you probably need to add Python to your PATH)
./.venv/Scripts/activate
(.\.venv\Scripts\activate
should work in cmd in administator mode) (This may not work on Windows, and in this case you need to execute "Set-ExecutionPolicy RemoteSigned" first and choose "Y" there [you may need to run Powershell as administrator]. After you executed the script, change execution policy back with "Set-ExecutionPolicy Restricted" and pressing "Y")
pip install -r requirements.txt
- Copy
config.yml.default
toconfig.yml
- Edit the
.yml
files to your liking, so that it plays shogi.
- Create an account for your bot on Lishogi.org.
- NOTE: If you have previously played games on an existing account, you will not be able to use it as a bot account.
- Once your account has been created and you are logged in, create a personal OAuth2 token with the "Play as a bot" selected and add a description.
- A
token
e.g.Xb0ddNrLabc0lGK2
will be displayed. Store this in.yml
as thetoken
field. - NOTE: You won't see this token again on Lishogi.
- Place your engine(s) in the
engine.dir
directory - In your
.yml
file, enter the binary name as theengine.name
field. - Using this process any engine can be added to the bot.
WARNING This is irreversible. Read more about upgrading to bot account.
- run
python lichess-bot.py -u
- Press
CTRL+C
. - It may take some time to quit.
- Standard Chess
- Crazyhouse
- Chess960
- King of the Hill
- Three-Check
- AntiChess
- Atomic
- Horde
- Racing Kings
- Shogi
- Xiangqi
- Makruk
- Sittuyin
- Placement
- Capablanca
- Capahouse
- SHouse
- Seirawan
- Note: Other Variants can also be added, but on Lishogi.org, the bot will only play Shogi. Changes can be made for the Bot to play on other websites with the above Variants and more can be added.
Thanks to the Lichess Team for creating a repository that could be easily accessed and modified to help converting it to a format that supports Lishogi.
Thanks to the Lichess team, especially T. Alexander Lystad and Thibault Duplessis for working with the LeelaChessZero team to get this API up. Thanks to the Niklas Fiekas and his python-chess code which allows engine communication seamlessly.