Need help writing a script

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

User avatar
M ANSARI
Posts: 3707
Joined: Thu Mar 16, 2006 7:10 pm

Re: Need help writing a script

Post by M ANSARI »

The bug can easily be fixed with a Rybka 3 GUI upgrade which is the same as the Fritz upgrades that are done quite frequently, I guess they could fix the bug from the engine but more likely the easier fix would be to re-arrange 2 lines of code in the initialization string of the GUI since in that package there are around 16 different Rybka engines. I doubt this will happen anytime soon though which is why I am trying to see if this can be done locally.
User avatar
hgm
Posts: 27796
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Need help writing a script

Post by hgm »

If it is just a matter of slipping in a command, or replacing one command by another, you could use the InBetween adapter and define a substitution (e.g. of an unimportant option setting by another one).

That is how people usually trick non-compliant engines into running.
F. Bluemers
Posts: 868
Joined: Thu Mar 09, 2006 11:21 pm
Location: Nederland

Re: Need help writing a script

Post by F. Bluemers »

hgm wrote:If it is just a matter of slipping in a command, or replacing one command by another, you could use the InBetween adapter and define a substitution (e.g. of an unimportant option setting by another one).

That is how people usually trick non-compliant engines into running.
That would work if rybka3 is a normal exe ,but maybe not if its a cb native uhm "thing"
To be honest I have no clue if the problem is with Rybka or the GUI ... most likely it is a combination of both since the Rybka I have is Rybka 3 from CB with the Fritz GUI.
Teemu Pudas
Posts: 88
Joined: Wed Mar 25, 2009 12:49 pm

Re: Need help writing a script

Post by Teemu Pudas »

F. Bluemers wrote:[That would work if rybka3 is a normal exe ,but maybe not if its a cb native uhm "thing"
The CB distribution uses the same Rybka executables as everyone else.
F. Bluemers
Posts: 868
Joined: Thu Mar 09, 2006 11:21 pm
Location: Nederland

Re: Need help writing a script

Post by F. Bluemers »

Teemu Pudas wrote:
F. Bluemers wrote:[That would work if rybka3 is a normal exe ,but maybe not if its a cb native uhm "thing"
The CB distribution uses the same Rybka executables as everyone else.
Great,that will simplify things,maybe even for chessbase :wink:
Best
Fonzy
User avatar
M ANSARI
Posts: 3707
Joined: Thu Mar 16, 2006 7:10 pm

Re: Need help writing a script

Post by M ANSARI »

hgm wrote:If it is just a matter of slipping in a command, or replacing one command by another, you could use the InBetween adapter and define a substitution (e.g. of an unimportant option setting by another one).

That is how people usually trick non-compliant engines into running.
Could you be a litte more specific and walk me though this. Where can I download this InBetween adapter and how can I use it to modify the location of the 2 lines of code mentioned. There are quite a few unimportant option settings that could be changed or are not used in the engine parameter window such as Persistent Hash or Preserve Analysis.
User avatar
hgm
Posts: 27796
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Need help writing a script

Post by hgm »

InBetween can be obtained from Odd Gunnar Malin's website ( http://home.online.no/~malin/sjakk/ ).

I am not really an experienced InBetween user either, but what I remember from it is that you have to call InBetween like it is the engine, and provide a file inbetween.ini that defines the phraces you want to substitute for other phrases in the information streams in either direction. There is a server2client part and a client2server part (the engine is the server, the GUI the client) in the file, and you can simply write

phrase1 := phrase2

in the applicable section to have InBetween substitute every occurrence of phrase1 by phrase2 in that direction.

I think the InBetween download comes with a clear explanation and an example ini file. I only used it once to swap the words "white" and "black" in the GUI->engine stream to play GNU Shogi under WinBoard. (GNU Shogi thinks that black must do the first move...).

This is the ini file I found for that on my computer:

Code: Select all

[InBetween]
; You can set program option here if its not possible in the server program
;
; The priority flag is if you want the server app. to run with lower priority.
; This could be when you want use an engine to analyze games/positions and
; you also want to use the computer to other work. If this is not set it will
; try to see what the client wants and set the server to this priority.
; Don't use the high option is you don't know what you do.
;Priority := low, normal or high
;
;CommandLine := f:\cygwin\home\chess\GNShogi\gnushogi.exe
;
; The debug switch is if you want to see the command flow in a window when the
; server and client talks. 1 means viewpoint is on the client interface, 2 means
; viewpoint is on the server interface, and finaly 3 means that the viewpont is
; after the translation (input to client and input to server).
;Debug := 0, 1, 2 or 3
Debug := 0
;
; A try to pass any control signal.
;Ctrl := False or True
;
; The logfile is if you want that InBetween log all communications.
;Log := logfile.log

[Client2Server]
; Set the translation of client command to server here.
; Format:
;    clientword := serverword
black := zzzzz
white := black
zzzzz := white
[Server2Client]
; Set the translation of server response to the client here.
; Format:
;    serverword := clientword
User avatar
Don
Posts: 5106
Joined: Tue Apr 29, 2008 4:27 pm

Re: Need help writing a script

Post by Don »

bob wrote:
M ANSARI wrote:The idea for putting the batch file on the engine is that in an engine tourney the engine would have to be loaded and reloaded continuously. With the GUI it only starts once. If I could manage to find a way that whenever an engine call is made that the engine would load then quickly do the following:

F3 (opens the window where the parameters change)
TAB TAB ENTER (gets the correct window to open the engine parameter)
TAB TAB 8 (moves the cursor to the correct location and 8 is for 8 processors)
ENTER ENTER (this gets out of the parameter windows)

Is it possible to write a script or batchfile which would modify the rybka executable to have those things happen every time the engine is called? If not then is it possible to tell the GUI that IF engine X is called THEN do the steps mentioned above. Sorry if that sounds silly but I have never written a line of code in my life and missed the DOS part of computer timeline.
I am not following. If the GUI will start something like rybka3.exe for each game, then you ought to be able to tell it to start "rybka3.bat" instead. And inside that .bat file, do whatever you want first, and the last command would be to execute rybka3.exe. The gui would have no idea that a script executed first, it just executes "something"... where that "something" is "rybka3.bat" and it behaves identically to executing rybka3.exe as far as the GUI is concerned.
Windows is not quite as simple as that Bob. I was trying to help someone do something like this - in this case call up a program with a command line argument and the interface would not accept it directly, or in a batch file.

It is one of those many broken windows things - everything is inconsistent or treated differently or a special case of somethings.