Skip to content

Commit

Permalink
Skip fen
Browse files Browse the repository at this point in the history
  • Loading branch information
hyperchessbot committed Feb 22, 2021
1 parent 8acf584 commit f716726
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ Post issues on GitHub https://github.com/hyperchessbot/hyperbot/issues .
## Config vars
**USE_STOCKFISH_13** : set it to 'true' to use Stockfish 13 ( Heroku / Linux only )

**DISABLE_LOGS** : set it to 'true' to disable logs
**DISABLE_LOGS** : set it to 'true' to disable logs, when true, logs, position and evaluation will not be shown on home page

**SKIP_FEN** : set it to 'true' to skip calculating fen for current position beyond book depth, when true, fen will only be calculated for positions within book depth, this makes the bot play faster, but the position on the home page will not be shown beyond book depth

**KEEP_ALIVE_URL** : set this to the full link of your bot home page ( https://[yourappname].herokuapp.com , where change [yourappname] to your Heroku app name ) if you want your bot to be kept alive from early morning till late night Heroku server time, keeping alive a free Heroku bot for 24/7 is not possible, because a free Heroku account has a monthly quota of 550 hours

Expand Down
4 changes: 3 additions & 1 deletion server.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ const useStockfish13 = isEnvTrue('USE_STOCKFISH_13')
envKeys.push('USE_STOCKFISH_13')
const disableLogs = isEnvTrue('DISABLE_LOGS')
envKeys.push('DISABLE_LOGS')
const calcFen = (!(isEnvTrue('SKIP_FEN')))
envKeys.push('SKIP_FEN')
const appName = process.env.APP_NAME || "hyperchessbot"
envKeys.push('APP_NAME')
const generalTimeout = parseInt(process.env.GENERAL_TIMEOUT || "15")
Expand Down Expand Up @@ -839,7 +841,7 @@ function playGame(gameId){
moves = state.moves.split(" ")
state.movesArray = moves

if(getUseBook(moves)){
if(getUseBook(moves) || calcFen){
if(useScalachess && (state.variant != "standard")){
let result = makeUciMoves(state.variant, state.initialFen, moves)
state.fen = result.fen
Expand Down

0 comments on commit f716726

Please sign in to comment.