0

I need to run 2 command lines in chess engine using the UCI protocol.

1- position fen "r1k4r/p2nb1p1/2b4p/1p1n1p2/2PP4/3Q1NB1/1P3PPP/R5K1 b"

2- go depth 10

The first line set the FEN position in the engine (stockfish). The second command the engine start to analyse the position and then give me an output.

In vb6 my code is this:

With CreateObject("WScript.Shell")

    .Run "cmd /c start /b E:\UCI-Vb6\stockfish_9_x64.exe position fen "r1k4r/p2nb1p1/2b4p/1p1n1p2/2PP4/3Q1NB1/1P3PPP/R5K1 b" > E:\UCI-Vb6\out.txt", 1, True

End With

and runs perfectly, but if I try to send a second command it will go back to re-start the engine with no "memories" about the position I set up before.

I also try nesting the two commands with the "&" parameter but with the same result And also try using "cmd /k" but again with no success.

  • https://chess.stackexchange.com/questions/11163/piping-stockfish-input Seems similar to this, however, simply piping the commands DOES seem to work... I get "bestmove d5b4" inside of `result.out` with the two commands in a text file using `start /b stockfish_13_win_x64.exe < cmds.txt > result.out`. It doesn't capture all of the output, but it does have the result. – User51 Apr 30 '21 at 20:31
  • Ok, it works with the commands in the cmds.txt ...but only thinks for a 2ms ..no matter what depth or movetime I wrote... even with the linebreak '\n' at the end – zerocoolphp Apr 30 '21 at 21:56

0 Answers0