I can only setup that engine in Arena using a batch file on windows.
wukong.bat
Code: Select all
node uci.js
Moderator: Ras
Code: Select all
node uci.js
Tried the following in cutechess GUI but does not work.tmokonen wrote: ↑Thu Dec 24, 2020 8:56 am In the CuteChess GUI, I put the program name, with full path, and command line parameters all together in the Command: section of the Configure Engine screen. You might need quotes around the program path or javascript file path if there are spaces. It's the same format as you would use from a command prompt. For example:
C:\Games\NoSpaces\NoQuotesRequired\node.exe C:\jsengines\coolengine.js
"C:\path with spaces\node.exe" C:\jsengines\wukong.js
C:\Games\NoSpaces\NoQuotesRequired\node.exe "C:\jsengines\This time I have spaces.js"
This is what I tried so far without success.hgm wrote: ↑Thu Dec 24, 2020 9:11 am What works from the command line should work in the GUI. It is just that, as far as the GUI is concerned, node.exe is the engine, and the .js file and possibly other arguments that would be needed to make nodejs run the engine, have to be given as parameters to the engine command.
Spaces in filenames are a problem, as they lead to ambiguity to what is the executable and what are commands; the Windows command-prompt interpreter solves this by trying all possibilities. But WinBoard doesn't, and needs quotes to indicate which space-containing groups of characters have to be considered as a single word. The Load Engine dialog should automatically apply quotes when the executable pathname needs them, but it cannot know whether quotes are needed in the engine parameters. WinBoard support 3 levels of quoting, (with single or double quotes, or surrounding {braces}). so that you can have quotes within quotes. Which is good, because the entire engine command has to be passed as a string to the -fcp / -scp options. And these options are stored in the engine list, which is itself a parameter to a string option, surrounded by braces. So if these contain spaces (because they consist of executable + parameters) that needs one extra outer level of quoting. Nota that quotes within a quoted string can be 'escaped' by preceding them with a backslash, when WinBoard interprets such a string.
I never tried this directly, because setting up via Polyglot/Inbetween is more comfortable for me and allows some automaticFerdy wrote: ↑Thu Dec 24, 2020 10:54 am...hgm wrote: ↑Thu Dec 24, 2020 9:11 am What works from the command line should work in the GUI. It is just that, as far as the GUI is concerned, node.exe is the engine, and the .js file and possibly other arguments that would be needed to make nodejs run the engine, have to be given as parameters to the engine command.
Spaces in filenames are a problem, as they lead to ambiguity to what is the executable and what are commands; the Windows command-prompt interpreter solves this by trying all possibilities. But WinBoard doesn't, and needs quotes to indicate which space-containing groups of characters have to be considered as a single word. The Load Engine dialog should automatically apply quotes when the executable pathname needs them, but it cannot know whether quotes are needed in the engine parameters. WinBoard support 3 levels of quoting, (with single or double quotes, or surrounding {braces}). so that you can have quotes within quotes. Which is good, because the entire engine command has to be passed as a string to the -fcp / -scp options. And these options are stored in the engine list, which is itself a parameter to a string option, surrounded by braces. So if these contain spaces (because they consist of executable + parameters) that needs one extra outer level of quoting. Nota that quotes within a quoted string can be 'escaped' by preceding them with a backslash, when WinBoard interprets such a string.
Code: Select all
1608805123.071 Engine->Adapter: C:\Engines\UCIJS\WukongJS_10-64\uci.js:10
1608805123.072 Engine->Adapter: const { Engine } = require('./wukong.js');
1608805123.072 Engine->Adapter: ^
1608805123.072 Engine->Adapter:
1608805123.072 Engine->Adapter: SyntaxError: Unexpected token {
1608805123.072 Engine->Adapter: at exports.runInThisContext (vm.js:53:16)
1608805123.072 Engine->Adapter: at Module._compile (module.js:404:25)
1608805123.072 Engine->Adapter: at Object.Module._extensions..js (module.js:432:10)
1608805123.072 Engine->Adapter: at Module.load (module.js:356:32)
1608805123.072 Engine->Adapter: at Function.Module._load (module.js:311:12)
1608805123.072 Engine->Adapter: at Function.Module.runMain (module.js:457:10)
1608805123.072 Engine->Adapter: at startup (node.js:136:18)
1608805123.072 Engine->Adapter: at node.js:972:3
1608805123.076 Engine->Adapter: EOF
Code: Select all
1608805368.682 Adapter->Engine: uci
1608805368.874 Engine->Adapter: Node.js is only supported on Windows 8.1, Windows Server 2012 R2, or higher.
1608805368.875 Engine->Adapter: Setting the NODE_SKIP_PLATFORM_CHECK environment variable to 1 skips this
1608805368.876 Engine->Adapter: check, but Node.js might not execute correctly. Any issues encountered on
1608805368.880 Engine->Adapter: EOF
You should let WinBoard worry about the quoting, and you should not put any command-line arguments in the text entry meant for the executable. The latter should go into the 'command-line parameters' entry. The .exe entry is only for the executable; if there are any spaces in there, WinBoard will assume it is an executable name with spaces in it. Writing quotes in there yourself will just confuse WinBoard; when you use the 'browse' button to point out the .exe it wouldn't provide any quotes either.
I tried now with Node 9.0.0 and Node 11.0.0Guenther wrote: ↑Thu Dec 24, 2020 11:22 am ...
I never tried this directly, because setting up via Polyglot/Inbetween is more comfortable for me and allows some automatic
batch processes done in renaming and creating of hundreds of folders and entries at once for my engines.json.
I noticed though that it won't work here too, but the reason is a node.js incompatibility.
If I try my old one (Node 5.0.0) I get this:If I use the current node (15.x.x) it says my Win version is incompatible and at least Win 8.1 is needed.Code: Select all
1608805123.071 Engine->Adapter: C:\Engines\UCIJS\WukongJS_10-64\uci.js:10 1608805123.072 Engine->Adapter: const { Engine } = require('./wukong.js'); 1608805123.072 Engine->Adapter: ^ 1608805123.072 Engine->Adapter: 1608805123.072 Engine->Adapter: SyntaxError: Unexpected token { 1608805123.072 Engine->Adapter: at exports.runInThisContext (vm.js:53:16) 1608805123.072 Engine->Adapter: at Module._compile (module.js:404:25) 1608805123.072 Engine->Adapter: at Object.Module._extensions..js (module.js:432:10) 1608805123.072 Engine->Adapter: at Module.load (module.js:356:32) 1608805123.072 Engine->Adapter: at Function.Module._load (module.js:311:12) 1608805123.072 Engine->Adapter: at Function.Module.runMain (module.js:457:10) 1608805123.072 Engine->Adapter: at startup (node.js:136:18) 1608805123.072 Engine->Adapter: at node.js:972:3 1608805123.076 Engine->Adapter: EOF
and I have not yet tried the suggested solution above with setting an environment variable...Code: Select all
1608805368.682 Adapter->Engine: uci 1608805368.874 Engine->Adapter: Node.js is only supported on Windows 8.1, Windows Server 2012 R2, or higher. 1608805368.875 Engine->Adapter: Setting the NODE_SKIP_PLATFORM_CHECK environment variable to 1 skips this 1608805368.876 Engine->Adapter: check, but Node.js might not execute correctly. Any issues encountered on 1608805368.880 Engine->Adapter: EOF
Code: Select all
1608810214.537 Adapter->Engine: uci
1608810214.727 Engine->Adapter:
1608810214.727 Engine->Adapter: Wukong JS - UCI mode - v1.0
1608810214.727 Engine->Adapter:
1608810214.727 Engine->Adapter:
1608810214.737 Engine->Adapter: id name WukongJS 1.0
1608810214.737 Engine->Adapter: id author Code Monkey King
In WB now w/o Polyglot - Wukong10JS-64 is just a renamed nodehgm wrote: ↑Thu Dec 24, 2020 12:41 pmYou should let WinBoard worry about the quoting, and you should not put any command-line arguments in the text entry meant for the executable. The latter should go into the 'command-line parameters' entry. The .exe entry is only for the executable; if there are any spaces in there, WinBoard will assume it is an executable name with spaces in it. Writing quotes in there yourself will just confuse WinBoard; when you use the 'browse' button to point out the .exe it wouldn't provide any quotes either.
So the .exe field should just contain
C:/Program Files/blabla/nodes.exe
and the command-line parameter should be
uci.js
This should result in a line in the engine list
"nodes.exe uci.js" -fd "C:/Program Files/blabla"
If you don't want the engine to run in the nodes.exe folder (e.g. because it cannot find its book files from there), you should explicitly provide the directory (there also is a browse button for that), and WinBoard will use that as -fd argument, and refrain from spliiting off the path from the engine command. In that case it should produce a line in the engine list like
'"C:/Program Files/blabla/nodes.exe" uci.js' -fd "whatever"
Code: Select all
recognized 'normal' (-1) as variant normal
recognized 'normal' (-1) as variant normal
shuffleOpenings = 0
Version: WinBoard 4.9.1 + Wukong10JS-64
Reset(1, 0) from gameMode 0
recognized 'normal' (-1) as variant normal
GameEnds(0, (null), 2)
shuffleOpenings = 0
StartChildProcess (dir="") UCI2WB Wukong10JS-64 uci.js C:\Engines\UCIJS\Wukong_10JS-64
nice engine proc to 10
1200 >first : xboard
protover 2
1230 <first : Wukong10JS-64: No error
Terminating process 4176, result=0
GameEnds(29, xboard exit, 2)
There is a bug in uci.js, the engine does not send uciok as last message after receiving uci command.tmokonen wrote: ↑Thu Dec 24, 2020 8:56 am In the CuteChess GUI, I put the program name, with full path, and command line parameters all together in the Command: section of the Configure Engine screen. You might need quotes around the program path or javascript file path if there are spaces. It's the same format as you would use from a command prompt. For example:
C:\Games\NoSpaces\NoQuotesRequired\node.exe C:\jsengines\coolengine.js
"C:\path with spaces\node.exe" C:\jsengines\wukong.js
C:\Games\NoSpaces\NoQuotesRequired\node.exe "C:\jsengines\This time I have spaces.js"