lichess-bot-devs / lichess-bot

A bridge between Lichess bots and chess engines
GNU Affero General Public License v3.0
745 stars 440 forks source link

Lichess bot not moving #682

Closed KepcukTheGreat closed 1 year ago

KepcukTheGreat commented 1 year ago
token: "myapi"    # Lichess OAuth2 Token.
url: "https://lichess.org//"  # Lichess base URL.

engine:                      # Engine settings.
  dir: "./engines/"          # Directory containing the engine. This can be an absolute path or one relative to lichess-bot/.
  name: "untrusted"        # Binary name of the engine to use.
  working_dir: ""            # Directory where the chess engine will read and write files. If blank or missing, the current directory is used.
  protocol: "uci"            # "uci", "xboard" or "homemade"
  ponder: true               # Think on opponent's time.

  polyglot:
    enabled: false           # Activate polyglot book.
    book:
      standard:              # List of book file paths for variant standard.
        - engines/book1.bin
        - engines/book2.bin
#     atomic:                # List of book file paths for variant atomic.
#       - engines/atomicbook1.bin
#       - engines/atomicbook2.bin
#     etc.
#     Use the same pattern for 'giveaway' (antichess), 'crazyhouse', 'horde', 'kingofthehill', 'racingkings' and '3check' as well.
    min_weight: 1            # Does not select moves with weight below min_weight (min 0, max: 65535).
    selection: "weighted_random" # Move selection is one of "weighted_random", "uniform_random" or "best_move" (but not below the min_weight in the 2nd and 3rd case).
    max_depth: 8             # How many moves from the start to take from the book.

#  draw_or_resign:
    resign_enabled: false
    resign_score: -1000      # If the score is less than or equal to this value, the bot resigns (in cp).
    resign_for_egtb_minus_two: true # If true the bot will resign in positions where the online_egtb returns a wdl of -2.
    resign_moves: 3          # How many moves in a row the score has to be below the resign value.
    offer_draw_enabled: false
    offer_draw_score: 0      # If the absolute value of the score is less than or equal to this value, the bot offers/accepts draw (in cp).
    offer_draw_for_egtb_zero: true # If true the bot will offer/accept draw in positions where the online_egtb returns a wdl of 0.
    offer_draw_moves: 5      # How many moves in a row the absolute value of the score has to be below the draw value.
    offer_draw_pieces: 10    # Only if the pieces on board are less than or equal to this value, the bot offers/accepts draw.

# online_moves:
    max_out_of_book_moves: 10 # Stop using online opening books after they don't have a move for 'max_out_of_book_moves' positions. Doesn't apply to the online endgame tablebases.
    max_retries: 2           # The maximum amount of retries when getting an online move.
    chessdb_book:
      enabled: false
      min_time: 20
      move_quality: "good"   # One of "all", "good", "best".
      min_depth: 20          # Only for move_quality: "best".
      contribute: true
    lichess_cloud_analysis:
      enabled: false
      min_time: 20
      move_quality: "good"   # One of "good", "best".
      max_score_difference: 50 # Only for move_quality: "good". The maximum score difference (in cp) between the best move and the other moves.
      min_depth: 20
      min_knodes: 0
    online_egtb:
      enabled: false
      min_time: 20
      max_pieces: 7
      source: "lichess"      # One of "lichess", "chessdb".
      move_quality: "best"   # One of "good", "best", "suggest" (it takes all the "good" moves and tells the engine to only consider these; will move instantly if there is only 1 "good" move).

# lichess_bot_tbs:           # The tablebases list here will be read by lichess-bot, not the engine.
    syzygy:
      enabled: false
      paths:
        - "engines/syzygy"
      max_pieces: 7
      move_quality: "best"   # One of "good", "best", "suggest" (it takes all the "good" moves and tells the engine to only consider these; will move instantly if there is only 1 "good" move).
    gaviota:
      enabled: false
      paths:
        - "engines/gaviota"
      max_pieces: 5
      min_dtm_to_consider_as_wdl_1: 120  # The minimum dtm to consider as syzygy wdl=1/-1. Set to 100 to disable.
      move_quality: "best"   # One of "good", "best", "suggest" (it takes all the "good" moves and tells the engine to only consider these; will move instantly if there is only 1 "good" move).

# engine_options:            # Any custom command line params to pass to the engine.
#   cpuct: 3.1

  homemade_options:
#   Hash: 256

  uci_options:               # Arbitrary UCI options passed to the engine.
  Threads: 1
  Ponder: true
  Hash: 256
  Table Memory: 256
  MultiPV: 1
  OwnBook: false
  Use LMR: true
  Null Move Pruning: true
  Overhead MS: 0
  Time Usage: 0
  Use Syzygy: true
  Syzygy Probe Depth: 1
  Syzygy Probe Limit: 7
  Syzygy 50 Move Rule: true
  Smart Syzygy: true
  King Safety: 100
  Selectivity: 250
  Reduction: -80
  Dynamism: 400
  Contempt: 250
  White Contempt: false
  semargin: 20
  Personality: Human
  Armageddon: false
  Variety: 100
  UCI Elo: 3500
  UCI LimitStrength: true
  Auto Skill: true
  Skill: 35
  SkillCents: 0
  SkillCompatibility: true
  Use UCI_Elo: true   
  go_commands:             # Additional options to pass to the UCI go command.
  depth: 18              
# xboard_options:            # Arbitrary XBoard options passed to the engine.
#   cores: "4"
#   memory: "4096"
#   egtpath:                 # Directory containing egtb (endgame tablabases), relative to this project. For 'xboard' engines.
#     gaviota: "Gaviota path"
#     nalimov: "Nalimov Path"
#     scorpio: "Scorpio Path"
#     syzygy: "Syzygy Path"
#   go_commands:             # Additional options to pass to the XBoard go command.
#     depth: 5               # Search depth ply only.
#     Do note that the go commands 'movetime' and 'nodes' are invalid and may cause bad time management for XBoard engines.

  silence_stderr: false      # Some engines (yes you, Leela) are very noisy.

abort_time: 20               # Time to abort a game in seconds when there is no activity.
fake_think_time: false       # Artificially slow down the bot to pretend like it's thinking.
rate_limiting_delay: 0       # Time (in ms) to delay after sending a move to prevent "Too Many Requests" errors.
move_overhead: 2000          # Increase if your bot flags games too often.

correspondence:
  move_time: 60            # Time in seconds to search in correspondence games.
  checkin_period: 600      # How often to check for opponent moves in correspondence games after disconnecting.
  disconnect_time: 300     # Time before disconnecting from a correspondence game.
  ponder: false            # Ponder in correspondence games the bot is connected to.

challenge:                   # Incoming challenges.
  concurrency: 1             # Number of games to play simultaneously.
  sort_by: "best"            # Possible values: "best" and "first".
  accept_bot: true          # Accepts challenges coming from other bots.
  only_bot: false            # Accept challenges by bots only.
  max_increment: 180         # Maximum amount of increment to accept a challenge. The max is 180. Set to 0 for no increment.
  min_increment: 0           # Minimum amount of increment to accept a challenge.
  max_base: 315360000        # Maximum amount of base time to accept a challenge. The max is 315360000 (10 years).
  min_base: 0                # Minimum amount of base time to accept a challenge.
  max_days: 14               # Maximum number of days per move to accept a challenge for a correspondence game.
                             # Unlimited games can be accepted by removing this field or specifying .inf
  min_days: 1                # Minimum number of days per move to accept a challenge for a correspondence game.
  variants:                  # Chess variants to accept (https://lichess.org/variant).
    - standard
#   - fromPosition
#   - antichess
#   - atomic
#   - chess960
#   - crazyhouse
#   - horde
#   - kingOfTheHill
#   - racingKings
#   - threeCheck
  time_controls:             # Time controls to accept.
    - bullet
    - blitz
    - rapid
#   - classical
#   - correspondence
  modes:                     # Game modes to accept.
    - casual                 # Unrated games.
    - rated                  # Rated games - must comment if the engine doesn't try to win.
# block_list:                # List of users from which the challenges are always declined.
#   - user1
#   - user2
# recent_bot_challenge_age: 60 # Maximum age of a bot challenge to be considered recent in seconds
# max_recent_bot_challenges: 2 # Maximum number of recent challenges that can be accepted from the same bot

greeting:
  # Optional substitution keywords (include curly braces):
  #   {opponent} to insert opponent's name
  #   {me} to insert bot's name
  # Any other words in curly braces will be removed.
  hello: "Hi! I'm {me}. Good luck! Type !help for a list of commands I can respond to." # Message to send to opponent chat at the start of a game
  goodbye: "Good game!" # Message to send to opponent chat at the end of a game
  hello_spectators: "Hi! I'm {me}. Type !help for a list of commands I can respond to." # Message to send to spectator chat at the start of a game
  goodbye_spectators: "Thanks for watching!" # Message to send to spectator chat at the end of a game

# pgn_directory: "game_records" # A directory where PGN-format records of the bot's games are kept

matchmaking:
  allow_matchmaking: true    # Set it to 'true' to challenge other bots.
  challenge_variant: "random" # If set to 'random', the bot will choose one variant from the variants enabled in 'challenge.variants'.
  challenge_timeout: 30       # Create a challenge after being idle for 'challenge_timeout' minutes. The minimum is 1 minute.
  challenge_initial_time:     # Initial time in seconds of the challenge (to be chosen at random).
    - 60
    - 120
  challenge_increment:        # Increment in seconds of the challenge (to be chosen at random).
    - 1
    - 2
#  challenge_days:            # Days for correspondence challenge (to be chosen at random).
#    - 1
#    - 2
# opponent_min_rating: 600    # Opponents rating should be above this value (600 is the minimum rating in lichess).
# opponent_max_rating: 4000   # Opponents rating should be below this value (4000 is the maximum rating in lichess).
  opponent_rating_difference: 100 # The maximum difference in rating between the bot's rating and opponent's rating.
  opponent_allow_tos_violation: true # Set to 'false' to prevent challenging bots that violated Lichess Terms of Service.
  challenge_mode: "random"    # Set it to the mode in which challenges are sent. Possible options are 'casual', 'rated' and 'random'.
  delay_after_decline: none  # If a bot declines a challenge, delay issuing another challenge to that bot. Possible options are 'none', 'coarse', and 'fine'.
# block_list:                 # The list of bots that will not be challenged
#   - user1
#   - user2
AttackingOrDefending commented 1 year ago

Can you send your bot's logs? They can be saved to a file with python lichess-bot.py -v -l log.txt. Also, the options under uci_options and go_commands should be indented by adding 2 spaces before each option.

KepcukTheGreat commented 1 year ago

Here is log.txt

2023-03-29 14:26:41,766 __main__ INFO 
    .   _/|
    .  // o\
    .  || ._)  lichess-bot 2023.3.29.1
    .  //__\
    .  )___(   Play on Lichess with a bot

2023-03-29 14:26:41,836 config DEBUG Config:
token: logger
url: https://lichess.org/
engine:
  dir: ./engines/
  name: untrusted
  working_dir: ''
  protocol: uci
  ponder: true
  polyglot:
    enabled: false
    book:
      standard:
      - engines/book1.bin
      - engines/book2.bin
    min_weight: 1
    selection: weighted_random
    max_depth: 8
  draw_or_resign:
    resign_enabled: false
    resign_score: -1000
    resign_for_egtb_minus_two: true
    resign_moves: 3
    offer_draw_enabled: false
    offer_draw_score: 0
    offer_draw_for_egtb_zero: true
    offer_draw_moves: 5
    offer_draw_pieces: 10
  online_moves:
    max_out_of_book_moves: 10
    max_retries: 2
    chessdb_book:
      enabled: false
      min_time: 20
      move_quality: good
      min_depth: 20
      contribute: true
    lichess_cloud_analysis:
      enabled: false
      min_time: 20
      move_quality: good
      max_score_difference: 50
      min_depth: 20
      min_knodes: 0
    online_egtb:
      enabled: false
      min_time: 20
      max_pieces: 7
      source: lichess
      move_quality: best
  lichess_bot_tbs:
    syzygy:
      enabled: false
      paths:
      - engines/syzygy
      max_pieces: 7
      move_quality: best
    gaviota:
      enabled: false
      paths:
      - engines/gaviota
      max_pieces: 5
      min_dtm_to_consider_as_wdl_1: 120
      move_quality: best
  homemade_options: null
  uci_options: null
  Threads: 1
  Ponder: true
  Hash: 256
  Table Memory: 256
  MultiPV: 1
  OwnBook: false
  Use LMR: true
  Null Move Pruning: true
  Overhead MS: 0
  Time Usage: 0
  Use Syzygy: true
  Syzygy Probe Depth: 1
  Syzygy Probe Limit: 7
  Syzygy 50 Move Rule: true
  Smart Syzygy: true
  King Safety: 100
  Selectivity: 250
  Reduction: -80
  Dynamism: 400
  Contempt: 250
  White Contempt: false
  semargin: 20
  Personality: Human
  Armageddon: false
  Variety: 100
  UCI Elo: 3500
  UCI LimitStrength: true
  Auto Skill: true
  Skill: 35
  SkillCents: 0
  SkillCompatibility: true
  Use UCI_Elo: true
  go_commands: null
  depth: 18
  silence_stderr: false
abort_time: 20
fake_think_time: false
rate_limiting_delay: 0
move_overhead: 2000
correspondence:
  move_time: 60
  checkin_period: 600
  disconnect_time: 300
  ponder: false
challenge:
  concurrency: 1
  sort_by: best
  accept_bot: true
  only_bot: false
  max_increment: 180
  min_increment: 0
  max_base: 315360000
  min_base: 0
  max_days: 14
  min_days: 1
  variants:
  - standard
  time_controls:
  - bullet
  - blitz
  - rapid
  modes:
  - casual
  - rated
greeting:
  hello: Hi! I'm {me}. Good luck! Type !help for a list of commands I can respond
    to.
  goodbye: Good game!
  hello_spectators: Hi! I'm {me}. Type !help for a list of commands I can respond
    to.
  goodbye_spectators: Thanks for watching!
matchmaking:
  allow_matchmaking: true
  challenge_variant: random
  challenge_timeout: 30
  challenge_initial_time:
  - 60
  - 120
  challenge_increment:
  - 1
  - 2
  opponent_rating_difference: 100
  opponent_allow_tos_violation: true
  challenge_mode: random
  delay_after_decline: none

2023-03-29 14:26:41,889 config DEBUG ====================
2023-03-29 14:26:41,911 config DEBUG Config:
token: logger
url: https://lichess.org/
engine:
  dir: ./engines/
  name: untrusted
  working_dir: /data/data/com.termux/files/home/lichess-bot
  protocol: uci
  ponder: true
  polyglot:
    enabled: false
    book:
      standard:
      - engines/book1.bin
      - engines/book2.bin
    min_weight: 1
    selection: weighted_random
    max_depth: 8
  draw_or_resign:
    resign_enabled: false
    resign_score: -1000
    resign_for_egtb_minus_two: true
    resign_moves: 3
    offer_draw_enabled: false
    offer_draw_score: 0
    offer_draw_for_egtb_zero: true
    offer_draw_moves: 5
    offer_draw_pieces: 10
  online_moves:
    max_out_of_book_moves: 10
    max_retries: 2
    chessdb_book:
      enabled: false
      min_time: 20
      move_quality: good
      min_depth: 20
      contribute: true
    lichess_cloud_analysis:
      enabled: false
      min_time: 20
      move_quality: good
      max_score_difference: 50
      min_depth: 20
      min_knodes: 0
    online_egtb:
      enabled: false
      min_time: 20
      max_pieces: 7
      source: lichess
      move_quality: best
  lichess_bot_tbs:
    syzygy:
      enabled: false
      paths:
      - engines/syzygy
      max_pieces: 7
      move_quality: best
    gaviota:
      enabled: false
      paths:
      - engines/gaviota
      max_pieces: 5
      min_dtm_to_consider_as_wdl_1: 120
      move_quality: best
  homemade_options: null
  uci_options: null
  Threads: 1
  Ponder: true
  Hash: 256
  Table Memory: 256
  MultiPV: 1
  OwnBook: false
  Use LMR: true
  Null Move Pruning: true
  Overhead MS: 0
  Time Usage: 0
  Use Syzygy: true
  Syzygy Probe Depth: 1
  Syzygy Probe Limit: 7
  Syzygy 50 Move Rule: true
  Smart Syzygy: true
  King Safety: 100
  Selectivity: 250
  Reduction: -80
  Dynamism: 400
  Contempt: 250
  White Contempt: false
  semargin: 20
  Personality: Human
  Armageddon: false
  Variety: 100
  UCI Elo: 3500
  UCI LimitStrength: true
  Auto Skill: true
  Skill: 35
  SkillCents: 0
  SkillCompatibility: true
  Use UCI_Elo: true
  go_commands: null
  depth: 18
  silence_stderr: false
  uci_ponder: false
abort_time: 20
fake_think_time: false
rate_limiting_delay: 0
move_overhead: 2000
correspondence:
  move_time: 60
  checkin_period: 600
  disconnect_time: 300
  ponder: false
  uci_ponder: false
challenge:
  concurrency: 1
  sort_by: best
  accept_bot: true
  only_bot: false
  max_increment: 180
  min_increment: 0
  max_base: 315360000
  min_base: 0
  max_days: 14
  min_days: 1
  variants:
  - standard
  time_controls:
  - bullet
  - blitz
  - rapid
  modes:
  - casual
  - rated
  block_list: []
greeting:
  hello: Hi! I'm {me}. Good luck! Type !help for a list of commands I can respond
    to.
  goodbye: Good game!
  hello_spectators: Hi! I'm {me}. Type !help for a list of commands I can respond
    to.
  goodbye_spectators: Thanks for watching!
matchmaking:
  allow_matchmaking: true
  challenge_variant: random
  challenge_timeout: 30
  challenge_initial_time:
  - 60
  - 120
  challenge_increment:
  - 1
  - 2
  opponent_rating_difference: 100
  opponent_allow_tos_violation: true
  challenge_mode: random
  delay_after_decline: none
  block_list: []
  challenge_days:
  - null
  opponent_min_rating: 600
  opponent_max_rating: 4000

2023-03-29 14:26:41,953 config DEBUG ====================
2023-03-29 14:26:41,961 urllib3.connectionpool DEBUG Starting new HTTPS connection (1): lichess.org:443
2023-03-29 14:26:42,217 urllib3.connectionpool DEBUG https://lichess.org:443 "GET /api/account HTTP/1.1" 200 None
2023-03-29 14:26:42,222 __main__ INFO Welcome UNTRUSTED_BY_BSB!
2023-03-29 14:26:42,225 __main__ INFO You're now connected to https://lichess.org/ and awaiting challenges.
2023-03-29 14:26:43,360 urllib3.connectionpool DEBUG https://lichess.org:443 "GET /api/account/playing HTTP/1.1" 200 None
2023-03-29 14:26:44,707 __main__ DEBUG Event: {'type': 'gameStart', 'game': {'fullId': 'IGWw1VsaCPvJ', 'gameId': 'IGWw1Vsa', 'fen': 'rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1', 'color': 'white', 'lastMove': '', 'source': 'ai', 'variant': {'key': 'standard', 'name': 'Standard'}, 'speed': 'blitz', 'perf': 'blitz', 'rated': False, 'hasMoved': False, 'opponent': {'id': None, 'username': 'Stockfish level 1', 'ai': 1}, 'isMyTurn': True, 'secondsLeft': 300, 'compat': {'bot': True, 'board': True}, 'id': 'IGWw1Vsa'}}
2023-03-29 14:26:44,734 __main__ INFO --- Process Used. Count: 1. IDs: {'IGWw1Vsa'}
2023-03-29 14:26:45,002 urllib3.connectionpool DEBUG Starting new HTTPS connection (1): lichess.org:443
2023-03-29 14:26:45,236 urllib3.connectionpool DEBUG https://lichess.org:443 "GET /api/bot/game/stream/IGWw1Vsa HTTP/1.1" 200 None
2023-03-29 14:26:45,238 __mp_main__ DEBUG Initial state: {'id': 'IGWw1Vsa', 'variant': {'key': 'standard', 'name': 'Standard', 'short': 'Std'}, 'clock': {'initial': 300000, 'increment': 0}, 'speed': 'blitz', 'perf': {'name': 'Blitz'}, 'rated': False, 'createdAt': 1680081464180, 'white': {'id': 'untrusted_by_bsb', 'name': 'UNTRUSTED_BY_BSB', 'title': 'BOT', 'rating': 1803, 'provisional': True}, 'black': {'aiLevel': 1}, 'initialFen': 'startpos', 'type': 'gameFull', 'state': {'type': 'gameState', 'moves': '', 'wtime': 300000, 'btime': 300000, 'winc': 0, 'binc': 0, 'status': 'started'}}
2023-03-29 14:26:45,239 engine_wrapper DEBUG Starting engine: ['./engines/untrusted']
2023-03-29 14:26:45,241 asyncio DEBUG Using selector: EpollSelector
KepcukTheGreat commented 1 year ago

Also

[03/29/23 14:28:30] DEBUG    Event: {'type':   lichess-bot.py:285
                             'challengeCancele
                             d', 'challenge':
                             {'id':
                             'tuPGgo9d',
                             'url':
                             'https://lichess.
                             org/tuPGgo9d',
                             'status':
                             'canceled',
                             'challenger':
                             {'id':
                             'ashnostromo',
                             'name':
                             'AshNostromo',
                             'title': 'BOT',
                             'rating': 1715,
                             'online': True},
                             'destUser':
                             {'id':
                             'untrusted_by_bsb
                             ', 'name':
                             'UNTRUSTED_BY_BSB
                             ', 'title':
                             'BOT', 'rating':
                             1803,
                             'provisional':
                             True, 'online':
                             True}, 'variant':
                             {'key':
                             'standard',
                             'name':
                             'Standard',
                             'short': 'Std'},
                             'rated': True,
                             'speed': 'blitz',
                             'timeControl':
                             {'type': 'clock',
                             'limit': 300,
                             'increment': 3,
                             'show': '5+3'},
                             'color':
                             'random',
                             'finalColor':
                             'white', 'perf':
                             {'icon':
                             '\ue01d', 'name':
                             'Blitz'}}}
[03/29/23 14:29:43] DEBUG    Event: {'type':   lichess-bot.py:285
                             'gameFinish',
                             'game':
                             {'fullId':
                             'IGWw1VsaCPvJ',
                             'gameId':
                             'IGWw1Vsa',
                             'fen':
                             'rnbqkbnr/ppppppp
                             p/8/8/8/8/PPPPPPP
                             P/RNBQKBNR w KQkq
                             - 0 1', 'color':
                             'white',
                             'lastMove': '',
                             'source': 'ai',
                             'variant':
                             {'key':
                             'standard',
                             'name':
                             'Standard'},
                             'speed': 'blitz',
                             'perf': 'blitz',
                             'rated': False,
                             'hasMoved':
                             False,
                             'opponent':
                             {'id': None,
                             'username':
                             'Stockfish level
                             1', 'ai': 1},
                             'isMyTurn':
                             False,
                             'secondsLeft':
                             300, 'compat':
                             {'bot': True,
                             'board': True},
                             'id':
                             'IGWw1Vsa'}}
                    INFO     +++ Process       lichess-bot.py:184
                             Freed. Count: 0.
                             IDs: None
                    INFO     Accept Blitz      lichess-bot.py:333
                             rated challenge
                             from BOT
                             AshNostromo
                             (1715) (tuPGgo9d)
                    DEBUG    Resetting      connectionpool.py:273
                             dropped
                             connection:
                             lichess.org
                    DEBUG    https://liches connectionpool.py:456
                             s.org:443
                             "POST
                             /api/challenge
                             /tuPGgo9d/acce
                             pt HTTP/1.1"
                             400 44
                    DEBUG    Giving up             _common.py:120
                             api_post(...) after 1
                             tries
                             (requests.exceptions.
                             HTTPError: 400 Client
                             Error: Bad Request
                             for url:
                             https://lichess.org/a
                             pi/challenge/tuPGgo9d
                             /accept)
AttackingOrDefending commented 1 year ago

Can you send more of your logs? Especially a part with engine communication. You should start a game and after the game ends, close lichess-bot and send these logs.

TheYoBots commented 1 year ago

After uci_options, 2 spaces need to be given. I think the error is because those spaces are not given. Change your config to this:

token: "myapi"    # Lichess OAuth2 Token.
url: "https://lichess.org//"  # Lichess base URL.

engine:                      # Engine settings.
  dir: "./engines/"          # Directory containing the engine. This can be an absolute path or one relative to lichess-bot/.
  name: "untrusted"        # Binary name of the engine to use.
  working_dir: ""            # Directory where the chess engine will read and write files. If blank or missing, the current directory is used.
  protocol: "uci"            # "uci", "xboard" or "homemade"
  ponder: true               # Think on opponent's time.

  polyglot:
    enabled: false           # Activate polyglot book.
    book:
      standard:              # List of book file paths for variant standard.
        - engines/book1.bin
        - engines/book2.bin
#     atomic:                # List of book file paths for variant atomic.
#       - engines/atomicbook1.bin
#       - engines/atomicbook2.bin
#     etc.
#     Use the same pattern for 'giveaway' (antichess), 'crazyhouse', 'horde', 'kingofthehill', 'racingkings' and '3check' as well.
    min_weight: 1            # Does not select moves with weight below min_weight (min 0, max: 65535).
    selection: "weighted_random" # Move selection is one of "weighted_random", "uniform_random" or "best_move" (but not below the min_weight in the 2nd and 3rd case).
    max_depth: 8             # How many moves from the start to take from the book.

#  draw_or_resign:
    resign_enabled: false
    resign_score: -1000      # If the score is less than or equal to this value, the bot resigns (in cp).
    resign_for_egtb_minus_two: true # If true the bot will resign in positions where the online_egtb returns a wdl of -2.
    resign_moves: 3          # How many moves in a row the score has to be below the resign value.
    offer_draw_enabled: false
    offer_draw_score: 0      # If the absolute value of the score is less than or equal to this value, the bot offers/accepts draw (in cp).
    offer_draw_for_egtb_zero: true # If true the bot will offer/accept draw in positions where the online_egtb returns a wdl of 0.
    offer_draw_moves: 5      # How many moves in a row the absolute value of the score has to be below the draw value.
    offer_draw_pieces: 10    # Only if the pieces on board are less than or equal to this value, the bot offers/accepts draw.

# online_moves:
    max_out_of_book_moves: 10 # Stop using online opening books after they don't have a move for 'max_out_of_book_moves' positions. Doesn't apply to the online endgame tablebases.
    max_retries: 2           # The maximum amount of retries when getting an online move.
    chessdb_book:
      enabled: false
      min_time: 20
      move_quality: "good"   # One of "all", "good", "best".
      min_depth: 20          # Only for move_quality: "best".
      contribute: true
    lichess_cloud_analysis:
      enabled: false
      min_time: 20
      move_quality: "good"   # One of "good", "best".
      max_score_difference: 50 # Only for move_quality: "good". The maximum score difference (in cp) between the best move and the other moves.
      min_depth: 20
      min_knodes: 0
    online_egtb:
      enabled: false
      min_time: 20
      max_pieces: 7
      source: "lichess"      # One of "lichess", "chessdb".
      move_quality: "best"   # One of "good", "best", "suggest" (it takes all the "good" moves and tells the engine to only consider these; will move instantly if there is only 1 "good" move).

# lichess_bot_tbs:           # The tablebases list here will be read by lichess-bot, not the engine.
    syzygy:
      enabled: false
      paths:
        - "engines/syzygy"
      max_pieces: 7
      move_quality: "best"   # One of "good", "best", "suggest" (it takes all the "good" moves and tells the engine to only consider these; will move instantly if there is only 1 "good" move).
    gaviota:
      enabled: false
      paths:
        - "engines/gaviota"
      max_pieces: 5
      min_dtm_to_consider_as_wdl_1: 120  # The minimum dtm to consider as syzygy wdl=1/-1. Set to 100 to disable.
      move_quality: "best"   # One of "good", "best", "suggest" (it takes all the "good" moves and tells the engine to only consider these; will move instantly if there is only 1 "good" move).

# engine_options:            # Any custom command line params to pass to the engine.
#   cpuct: 3.1

  homemade_options:
#   Hash: 256

  uci_options:               # Arbitrary UCI options passed to the engine.
    Threads: 1
    Ponder: true
    Hash: 256
    Table Memory: 256
    MultiPV: 1
    OwnBook: false
    Use LMR: true
    Null Move Pruning: true
    Overhead MS: 0
    Time Usage: 0
    Use Syzygy: true
    Syzygy Probe Depth: 1
    Syzygy Probe Limit: 7
    Syzygy 50 Move Rule: true
    Smart Syzygy: true
    King Safety: 100
    Selectivity: 250
    Reduction: -80
    Dynamism: 400
    Contempt: 250
    White Contempt: false
    semargin: 20
    Personality: Human
    Armageddon: false
    Variety: 100
    UCI Elo: 3500
    UCI LimitStrength: true
    Auto Skill: true
    Skill: 35
    SkillCents: 0
    SkillCompatibility: true
    Use UCI_Elo: true   
  go_commands:             # Additional options to pass to the UCI go command.
  depth: 18              
# xboard_options:            # Arbitrary XBoard options passed to the engine.
#   cores: "4"
#   memory: "4096"
#   egtpath:                 # Directory containing egtb (endgame tablabases), relative to this project. For 'xboard' engines.
#     gaviota: "Gaviota path"
#     nalimov: "Nalimov Path"
#     scorpio: "Scorpio Path"
#     syzygy: "Syzygy Path"
#   go_commands:             # Additional options to pass to the XBoard go command.
#     depth: 5               # Search depth ply only.
#     Do note that the go commands 'movetime' and 'nodes' are invalid and may cause bad time management for XBoard engines.

  silence_stderr: false      # Some engines (yes you, Leela) are very noisy.

abort_time: 20               # Time to abort a game in seconds when there is no activity.
fake_think_time: false       # Artificially slow down the bot to pretend like it's thinking.
rate_limiting_delay: 0       # Time (in ms) to delay after sending a move to prevent "Too Many Requests" errors.
move_overhead: 2000          # Increase if your bot flags games too often.

correspondence:
  move_time: 60            # Time in seconds to search in correspondence games.
  checkin_period: 600      # How often to check for opponent moves in correspondence games after disconnecting.
  disconnect_time: 300     # Time before disconnecting from a correspondence game.
  ponder: false            # Ponder in correspondence games the bot is connected to.

challenge:                   # Incoming challenges.
  concurrency: 1             # Number of games to play simultaneously.
  sort_by: "best"            # Possible values: "best" and "first".
  accept_bot: true          # Accepts challenges coming from other bots.
  only_bot: false            # Accept challenges by bots only.
  max_increment: 180         # Maximum amount of increment to accept a challenge. The max is 180. Set to 0 for no increment.
  min_increment: 0           # Minimum amount of increment to accept a challenge.
  max_base: 315360000        # Maximum amount of base time to accept a challenge. The max is 315360000 (10 years).
  min_base: 0                # Minimum amount of base time to accept a challenge.
  max_days: 14               # Maximum number of days per move to accept a challenge for a correspondence game.
                             # Unlimited games can be accepted by removing this field or specifying .inf
  min_days: 1                # Minimum number of days per move to accept a challenge for a correspondence game.
  variants:                  # Chess variants to accept (https://lichess.org/variant).
    - standard
#   - fromPosition
#   - antichess
#   - atomic
#   - chess960
#   - crazyhouse
#   - horde
#   - kingOfTheHill
#   - racingKings
#   - threeCheck
  time_controls:             # Time controls to accept.
    - bullet
    - blitz
    - rapid
#   - classical
#   - correspondence
  modes:                     # Game modes to accept.
    - casual                 # Unrated games.
    - rated                  # Rated games - must comment if the engine doesn't try to win.
# block_list:                # List of users from which the challenges are always declined.
#   - user1
#   - user2
# recent_bot_challenge_age: 60 # Maximum age of a bot challenge to be considered recent in seconds
# max_recent_bot_challenges: 2 # Maximum number of recent challenges that can be accepted from the same bot

greeting:
  # Optional substitution keywords (include curly braces):
  #   {opponent} to insert opponent's name
  #   {me} to insert bot's name
  # Any other words in curly braces will be removed.
  hello: "Hi! I'm {me}. Good luck! Type !help for a list of commands I can respond to." # Message to send to opponent chat at the start of a game
  goodbye: "Good game!" # Message to send to opponent chat at the end of a game
  hello_spectators: "Hi! I'm {me}. Type !help for a list of commands I can respond to." # Message to send to spectator chat at the start of a game
  goodbye_spectators: "Thanks for watching!" # Message to send to spectator chat at the end of a game

# pgn_directory: "game_records" # A directory where PGN-format records of the bot's games are kept

matchmaking:
  allow_matchmaking: true    # Set it to 'true' to challenge other bots.
  challenge_variant: "random" # If set to 'random', the bot will choose one variant from the variants enabled in 'challenge.variants'.
  challenge_timeout: 30       # Create a challenge after being idle for 'challenge_timeout' minutes. The minimum is 1 minute.
  challenge_initial_time:     # Initial time in seconds of the challenge (to be chosen at random).
    - 60
    - 120
  challenge_increment:        # Increment in seconds of the challenge (to be chosen at random).
    - 1
    - 2
#  challenge_days:            # Days for correspondence challenge (to be chosen at random).
#    - 1
#    - 2
# opponent_min_rating: 600    # Opponents rating should be above this value (600 is the minimum rating in lichess).
# opponent_max_rating: 4000   # Opponents rating should be below this value (4000 is the maximum rating in lichess).
  opponent_rating_difference: 100 # The maximum difference in rating between the bot's rating and opponent's rating.
  opponent_allow_tos_violation: true # Set to 'false' to prevent challenging bots that violated Lichess Terms of Service.
  challenge_mode: "random"    # Set it to the mode in which challenges are sent. Possible options are 'casual', 'rated' and 'random'.
  delay_after_decline: none  # If a bot declines a challenge, delay issuing another challenge to that bot. Possible options are 'none', 'coarse', and 'fine'.
# block_list:                 # The list of bots that will not be challenged
#   - user1
#   - user2
AttackingOrDefending commented 1 year ago

2 spaces should also be added before depth, under go_commands.

KepcukTheGreat commented 1 year ago

2 spaces should also be added before depth, under go_commands.

I did but still not working:(

MarkZH commented 1 year ago

Run python lichess-bot.py -v -l log.txt and copy the entire contents of log.txt here.

KepcukTheGreat commented 1 year ago

Sure

2023-04-03 01:40:18,518 __main__ INFO 
    .   _/|
    .  // o\
    .  || ._)  lichess-bot 2023.3.29.1
    .  //__\
    .  )___(   Play on Lichess with a bot

2023-04-03 01:40:18,587 config DEBUG Config:
token: logger
url: https://lichess.org/
engine:
  dir: ./engines/
  name: untrusted
  working_dir: ''
  protocol: uci
  ponder: true
  polyglot:
    enabled: false
    book:
      standard:
      - engines/book1.bin
      - engines/book2.bin
    min_weight: 1
    selection: weighted_random
    max_depth: 8
  draw_or_resign:
    resign_enabled: false
    resign_score: -1000
    resign_for_egtb_minus_two: true
    resign_moves: 3
    offer_draw_enabled: false
    offer_draw_score: 0
    offer_draw_for_egtb_zero: true
    offer_draw_moves: 5
    offer_draw_pieces: 10
  online_moves:
    max_out_of_book_moves: 10
    max_retries: 2
    chessdb_book:
      enabled: false
      min_time: 20
      move_quality: good
      min_depth: 20
      contribute: true
    lichess_cloud_analysis:
      enabled: false
      min_time: 20
      move_quality: good
      max_score_difference: 50
      min_depth: 20
      min_knodes: 0
    online_egtb:
      enabled: false
      min_time: 20
      max_pieces: 7
      source: lichess
      move_quality: best
  lichess_bot_tbs:
    syzygy:
      enabled: false
      paths:
      - engines/syzygy
      max_pieces: 7
      move_quality: best
    gaviota:
      enabled: false
      paths:
      - engines/gaviota
      max_pieces: 5
      min_dtm_to_consider_as_wdl_1: 120
      move_quality: best
  homemade_options: null
  uci_options:
    Threads: 4
    Ponder: true
    Hash: 1024
    Table Memory: 1024
    MultiPV: 1
    OwnBook: false
    Use LMR: true
    Null Move Pruning: true
    Overhead MS: 0
    Time Usage: -1
    Use Syzygy: true
    Syzygy Probe Depth: 1
    Syzygy Probe Limit: 7
    Syzygy 50 Move Rule: true
    Smart Syzygy: true
    King Safety: 1
    Selectivity: 10
    Reduction: -80
    Dynamism: 400
    Contempt: 1
    White Contempt: false
    semargin: 1
    Personality: Positional
    Armageddon: false
    Variety: 100
    UCI Elo: 3500
    UCI LimitStrength: true
    Auto Skill: false
    Skill: 35
    SkillCents: 99
    SkillCompatibility: true
    Use UCI_Elo: true
    depth: 18
  silence_stderr: false
abort_time: 20
fake_think_time: false
rate_limiting_delay: 0
move_overhead: 2000
correspondence:
  move_time: 60
  checkin_period: 600
  disconnect_time: 300
  ponder: false
challenge:
  concurrency: 1
  sort_by: best
  accept_bot: true
  only_bot: false
  max_increment: 180
  min_increment: 0
  max_base: 315360000
  min_base: 0
  max_days: 14
  min_days: 1
  variants:
  - standard
  time_controls:
  - bullet
  - blitz
  - rapid
  modes:
  - casual
  - rated
greeting:
  hello: Hi! I'm {me}. Good luck! Type !help for a list of commands I can respond
    to.
  goodbye: Good game!
  hello_spectators: Hi! I'm {me}. Type !help for a list of commands I can respond
    to.
  goodbye_spectators: Thanks for watching!
matchmaking:
  allow_matchmaking: true
  challenge_variant: random
  challenge_timeout: 30
  challenge_initial_time:
  - 60
  - 120
  challenge_increment:
  - 1
  - 2
  opponent_rating_difference: 100
  opponent_allow_tos_violation: true
  challenge_mode: random
  delay_after_decline: none

2023-04-03 01:40:18,639 config DEBUG ====================
2023-04-03 01:40:18,660 config DEBUG Config:
token: logger
url: https://lichess.org/
engine:
  dir: ./engines/
  name: untrusted
  working_dir: /data/data/com.termux/files/home/lichess-bot
  protocol: uci
  ponder: true
  polyglot:
    enabled: false
    book:
      standard:
      - engines/book1.bin
      - engines/book2.bin
    min_weight: 1
    selection: weighted_random
    max_depth: 8
  draw_or_resign:
    resign_enabled: false
    resign_score: -1000
    resign_for_egtb_minus_two: true
    resign_moves: 3
    offer_draw_enabled: false
    offer_draw_score: 0
    offer_draw_for_egtb_zero: true
    offer_draw_moves: 5
    offer_draw_pieces: 10
  online_moves:
    max_out_of_book_moves: 10
    max_retries: 2
    chessdb_book:
      enabled: false
      min_time: 20
      move_quality: good
      min_depth: 20
      contribute: true
    lichess_cloud_analysis:
      enabled: false
      min_time: 20
      move_quality: good
      max_score_difference: 50
      min_depth: 20
      min_knodes: 0
    online_egtb:
      enabled: false
      min_time: 20
      max_pieces: 7
      source: lichess
      move_quality: best
  lichess_bot_tbs:
    syzygy:
      enabled: false
      paths:
      - engines/syzygy
      max_pieces: 7
      move_quality: best
    gaviota:
      enabled: false
      paths:
      - engines/gaviota
      max_pieces: 5
      min_dtm_to_consider_as_wdl_1: 120
      move_quality: best
  homemade_options: null
  uci_options:
    Threads: 4
    Ponder: true
    Hash: 1024
    Table Memory: 1024
    MultiPV: 1
    OwnBook: false
    Use LMR: true
    Null Move Pruning: true
    Overhead MS: 0
    Time Usage: -1
    Use Syzygy: true
    Syzygy Probe Depth: 1
    Syzygy Probe Limit: 7
    Syzygy 50 Move Rule: true
    Smart Syzygy: true
    King Safety: 1
    Selectivity: 10
    Reduction: -80
    Dynamism: 400
    Contempt: 1
    White Contempt: false
    semargin: 1
    Personality: Positional
    Armageddon: false
    Variety: 100
    UCI Elo: 3500
    UCI LimitStrength: true
    Auto Skill: false
    Skill: 35
    SkillCents: 99
    SkillCompatibility: true
    Use UCI_Elo: true
    depth: 18
  silence_stderr: false
  uci_ponder: false
abort_time: 20
fake_think_time: false
rate_limiting_delay: 0
move_overhead: 2000
correspondence:
  move_time: 60
  checkin_period: 600
  disconnect_time: 300
  ponder: false
  uci_ponder: false
challenge:
  concurrency: 1
  sort_by: best
  accept_bot: true
  only_bot: false
  max_increment: 180
  min_increment: 0
  max_base: 315360000
  min_base: 0
  max_days: 14
  min_days: 1
  variants:
  - standard
  time_controls:
  - bullet
  - blitz
  - rapid
  modes:
  - casual
  - rated
  block_list: []
greeting:
  hello: Hi! I'm {me}. Good luck! Type !help for a list of commands I can respond
    to.
  goodbye: Good game!
  hello_spectators: Hi! I'm {me}. Type !help for a list of commands I can respond
    to.
  goodbye_spectators: Thanks for watching!
matchmaking:
  allow_matchmaking: true
  challenge_variant: random
  challenge_timeout: 30
  challenge_initial_time:
  - 60
  - 120
  challenge_increment:
  - 1
  - 2
  opponent_rating_difference: 100
  opponent_allow_tos_violation: true
  challenge_mode: random
  delay_after_decline: none
  block_list: []
  challenge_days:
  - null
  opponent_min_rating: 600
  opponent_max_rating: 4000

2023-04-03 01:40:18,705 config DEBUG ====================
2023-04-03 01:40:18,712 urllib3.connectionpool DEBUG Starting new HTTPS connection (1): lichess.org:443
2023-04-03 01:40:18,948 urllib3.connectionpool DEBUG https://lichess.org:443 "GET /api/account HTTP/1.1" 200 None
2023-04-03 01:40:18,953 __main__ INFO Welcome UNTRUSTED_BY_BSB!
2023-04-03 01:40:18,957 __main__ INFO You're now connected to https://lichess.org/ and awaiting challenges.
2023-04-03 01:40:20,359 urllib3.connectionpool DEBUG https://lichess.org:443 "GET /api/account/playing HTTP/1.1" 200 None
2023-04-03 01:40:21,387 __main__ DEBUG Event: {'type': 'gameStart', 'game': {'fullId': 'QXqfc2ip7ufw', 'gameId': 'QXqfc2ip', 'fen': 'rnbqkbnr/pppppppp/8/8/3P4/8/PPP1PPPP/RNBQKBNR b KQkq - 0 1', 'color': 'black', 'lastMove': 'd2d4', 'source': 'friend', 'variant': {'key': 'standard', 'name': 'Standard'}, 'speed': 'blitz', 'perf': 'blitz', 'rated': True, 'hasMoved': False, 'opponent': {'id': 'zulu_bot', 'username': 'BOT zulu_bot', 'rating': 1956}, 'isMyTurn': True, 'secondsLeft': 180, 'compat': {'bot': True, 'board': True}, 'id': 'QXqfc2ip'}}
2023-04-03 01:40:21,413 __main__ INFO --- Process Used. Count: 1. IDs: {'QXqfc2ip'}
2023-04-03 01:40:21,836 urllib3.connectionpool DEBUG Starting new HTTPS connection (1): lichess.org:443
2023-04-03 01:40:22,103 urllib3.connectionpool DEBUG https://lichess.org:443 "GET /api/bot/game/stream/QXqfc2ip HTTP/1.1" 200 None
2023-04-03 01:40:22,105 __mp_main__ DEBUG Initial state: {'id': 'QXqfc2ip', 'variant': {'key': 'standard', 'name': 'Standard', 'short': 'Std'}, 'clock': {'initial': 180000, 'increment': 2000}, 'speed': 'blitz', 'perf': {'name': 'Blitz'}, 'rated': True, 'createdAt': 1680475172079, 'white': {'id': 'zulu_bot', 'name': 'zulu_bot', 'title': 'BOT', 'rating': 1956}, 'black': {'id': 'untrusted_by_bsb', 'name': 'UNTRUSTED_BY_BSB', 'title': 'BOT', 'rating': 1803, 'provisional': True}, 'initialFen': 'startpos', 'type': 'gameFull', 'state': {'type': 'gameState', 'moves': 'd2d4', 'wtime': 180000, 'btime': 180000, 'winc': 2000, 'binc': 2000, 'status': 'started'}}
2023-04-03 01:40:22,107 engine_wrapper DEBUG Starting engine: ['./engines/untrusted']
2023-04-03 01:40:22,108 asyncio DEBUG Using selector: EpollSelector
MarkZH commented 1 year ago
  1. Is there anything else after the end of the log you posted? Anything between 2023-04-03 01:40:22,108 asyncio DEBUG Using selector: EpollSelector and the lines indicating the program has been terminated?

  2. Can you run your engine on the command line without lichess-bot? What happens when you run ./engines/untrusted in a terminal? You may need to type uci and press Enter after starting the engine.

KepcukTheGreat commented 1 year ago
  1. Gönderdiğiniz günlüğün bitiminden sonra başka bir şey var mı? 2023-04-03 01:40:22,108 asyncio DEBUG Using selector: EpollSelectorProgramın sonlandırıldığını gösteren satırlar arasında herhangi bir şey var mı ?
  2. Motorunuzu lichess-bot olmadan komut satırında çalıştırabilir misiniz? ./engines/untrustedBir terminalde çalıştırdığınızda ne olur ? uciMotoru çalıştırdıktan sonra yazıp Enter tuşuna basmanız gerekebilir .

Bcz the match doesn't start I terminated and there isn't any other line u asked using hardware POPCNT uci info string untrusted id name Untrusted 64-bit id author Murat Cicek option name Threads type spin default 1 min 1 max 16 option name Ponder type check default true option name Hash type spin default 4 min 1 max 65536 option name Clear Hash type button option name Table Memory type spin default 4 min 1 max 1024 option name MultiPV type spin default 1 min 1 max 218 option name OwnBook type check default true option name Book File type string default untrusted.bin option name Book Moves type spin default 1000 min 0 max 1000 option name Best Book Line type check default false option name Log File type string default option name UCI_Chess960 type check default false option name UCI_Variant type string default chess option name UCI_AnalyseMode type check default false option name Use LMR type check default true option name Null Move Pruning type check default true option name Overhead ms type spin default 50 min 0 max 10000 option name Time Usage type spin default 0 min -90 max 90 option name Use Syzygy type check default false option name SyzygyPath type string default option name Syzygy Probe Depth type spin default 1 min 0 max 99 option name Syzygy Probe Limit type spin default 6 min 0 max 7 option name Syzygy 50 Move Rule type check default true option name Smart Syzygy type check default false option name King Safety type spin default 83 min 0 max 200 option name Selectivity type spin default 120 min 10 max 250 option name Reduction type spin default 30 min -80 max 400 option name Dynamism type spin default 100 min 0 max 400 option name Contempt type spin default 0 min -250 max 250 option name White Contempt type check default false option name semargin type spin default 9 min 1 max 20 option name Personality type combo default Default var Default var Aggressive var Defensive var Active var Positional var Endgame var Beginner var Human var HN var DR var BF var MC var GK option name Armageddon type combo default Off var Off var White Must Win var Black Must Win option name Variety type spin default 0 min 0 max 100 option name UCI Elo type spin default 3500 min 1 max 3500 option name UCI LimitStrength type check default false option name Auto Skill type check default false option name UCI_Opponent type string default option name Skill type spin default 35 min 1 max 35 option name SkillCents type spin default 0 min 0 max 99 option name SkillCompatibility type check default true option name Use UCI_Elo type check default false uciok

MarkZH commented 1 year ago

Have you had any success in getting your engine to work? I tried running lichess-bot on my computer using Komodo and it worked. I tried Komodo since it uses similar options to your engine.

If your engine still doesn't work, can you try running your engine with the Using synchronous SimpleEngine python-chess example and let us known what happens?

MarkZH commented 1 year ago

Please reopen this issue if the problem persists.