SriMethan / BotLi-Heroku

Lichess Bot Heroku
GNU Affero General Public License v3.0
1 stars 3 forks source link

Hello i want to use different engine for antichess and racingkimg what should I do #2

Open HeroRebor opened 2 years ago

SriMethan commented 2 years ago

Hello, If you want to change the engines for all variants other than standard and antichess upload your engines to the engines folder and edit your config.yml with the correct engine name https://github.com/SriMethan/BotLi-Heroku/blob/botli-heroku/config.yml#L7

If you want to change the engine for a specific variant like antichess and racingkings you'll have to edit the https://github.com/SriMethan/BotLi-Heroku/blob/botli-heroku/lichess_game.py#L359

    def _get_engine(self, gameFull_event: dict) -> chess.engine.SimpleEngine:
        if gameFull_event['variant']['name'] == 'Standard' or gameFull_event['variant']['name'] == 'From Position' :
            engine = chess.engine.SimpleEngine.popen_uci(self.config['engine']['path'])
        else:
            engine = chess.engine.SimpleEngine.popen_uci(self.config['engine']['varipath']) 

to like example uses that engines for only antichess and racingkings

    def _get_engine(self, gameFull_event: dict) -> chess.engine.SimpleEngine:
        if gameFull_event['variant']['name'] == 'antichess' or gameFull_event['variant']['name'] == 'racingkings' :
            engine = chess.engine.SimpleEngine.popen_uci(self.config['engine']['varipath'])
        else:
            engine = chess.engine.SimpleEngine.popen_uci(self.config['engine']['path']) 
HeroRebor commented 2 years ago
def _get_engine(self, gameFull_event: dict) -> chess.engine.SimpleEngine:
    if gameFull_event['variant']['name'] == 'antichess' or gameFull_event['variant']['name'] == 'racingkings' :
        engine = chess.engine.SimpleEngine.popen_uci(self.config['engine']['varipath'])
    else:
        engine = chess.engine.SimpleEngine.popen_uci(self.config['engine']['path']) 

so if I paste it then we can different engine btw if we want to add all variant different engine then ? How to add polygot book of variant ? Can u also suggest me some good engine name for each variant plz