Coder Social home page Coder Social logo

ianfab / lishogi-bot Goto Github PK

View Code? Open in Web Editor NEW

This project forked from theyobots/lishogi-bot

0.0 1.0 0.0 3.77 MB

A bridge between Lichess API (used by lishogi) and Lishogi USI Bots

Home Page: https://lishogi.org/@/YoBot_v2

License: MIT License

Python 100.00%

lishogi-bot's Introduction

Lishogi Bot

Python Build Lishogi Team

A bridge between Lichess API and Lishogi USI Bots. In case you don't know English, view the Japanese Translation here (日本語翻訳).

How to Install

Mac/Linux:

  • NOTE: Only Python 3.7 or later is supported!
  • Download the repo into Lishogi-Bot directory.
  • Navigate to the directory in cmd/Terminal: cd Lishogi-Bot.
  • Install pip: apt install python3-pip
  • Install virtualenv: pip install virtualenv.
  • Setup virtualenv: apt install python3-venv
python3 -m venv venv  (if this fails you probably need to add Python3 to your PATH)
virtualenv .venv -p python3  (if this fails you probably need to add Python3 to your PATH)
source ./venv/bin/activate
python3 -m pip install -r requirements.txt

Windows:

  • NOTE: Only Python 3.7 or later is supported!
  • If you don't have Python, you may download it here. 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.
  • 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

Lishogi OAuth

  • 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. xxxxxxxxxxxxxxxx will be displayed. Store this in config.yml as the token field.
  • NOTE: You won't see this token again on Lishogi, so save it or store it somewhere.

Setup Engine

  • Place your engine(s) in the engine.dir directory
  • In your config.yml file, enter the binary name as the engine.name field.
  • Using this process any engine can be added to the bot.
  • Note: The engine you add has to be running under the USI protocol, then only it will work

Lishogi Upgrade to Bot Account

WARNING This is irreversible. Read more about upgrading to bot account.

  • run python lishogi-bot.py -u
  • for more verbrose logs run python lishogi-bot.py -v

Acknowledgements

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 and for running an API which is used by lishogi. Thanks to the Tasuku SUENAGA a.k.a. gunyarakun and his python-shogi code which allows engine communication seamlessly. Thanks to allthatglittersisgold for creating a Windows executable for lishogi-bot.py and Thanks to WandererXII for all his effort and help.

lishogi-bot's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.