Skip to content

Commit

Permalink
config engine object
Browse files Browse the repository at this point in the history
  • Loading branch information
ornicar committed Apr 18, 2018
1 parent 39fccf2 commit 2bd1216
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
10 changes: 6 additions & 4 deletions config.yml.default
@@ -1,10 +1,12 @@
token: "xxxxxxxxxxxxxxxx"
url: "https://lichess.org/"
engines_dir: "./engines/"
engine: "lczero"
weights: "latest.txt"
engine {
dir: "./engines/"
name: "lczero"
threads:
# weights: "latest.txt" # uncomment if the engine is leela
}
max_concurrent_games: 1
threads:
supported_variants:
- standard
# - fromPosition
Expand Down
7 changes: 4 additions & 3 deletions main.py
Expand Up @@ -219,8 +219,9 @@ def load_config():
is_bot = upgrade_account(li)

if is_bot:
engine_path = os.path.join(CONFIG["engines_dir"], CONFIG["engine"])
weights_path = os.path.join(CONFIG["engines_dir"], CONFIG["weights"]) if CONFIG["weights"] is not None else None
start(li, user_profile, engine_path, weights_path, CONFIG["threads"])
cfg = CONFIG["engine"]
engine_path = os.path.join(cfg["dir"], cfg["name"])
weights_path = os.path.join(cfg["dir"], cfg["weights"]) if "weights" in cfg else None
start(li, user_profile, engine_path, weights_path, cfg["threads"])
else:
print("{} is not a bot account. Please upgrade your it to a bot account!".format(user_profile["username"]))

0 comments on commit 2bd1216

Please sign in to comment.