Need a batch file with Bayeselo

Discussion of chess software programming and technical issues.

Moderator: Ras

Charly
Posts: 1091
Joined: Wed Jul 23, 2014 4:30 pm
Location: Bretagne

Need a batch file with Bayeselo

Post by Charly »

Hi,

First of all, let me tell you that I'm not at all a programmer.

I would like to know if it is possible to have a batch file to run automatically Bayeselo (version Jan 30 2007).

ususally, I launch Bayeselo manually like that :

a) readpgn xxxxxx.pgn
b) elo
c) mm
d) exactdist
e) offset 2600 Ruffian 1.0.5
f) ratings
g) ratings>Elo.txt

It would be very user friendly and less time consuming to have that automated for my rating list.

Many thanks for helping.

Arnaud Lohéac
Brittany from the sky :
https://youtu.be/nR9eU_tVbxE
nionita
Posts: 181
Joined: Fri Oct 22, 2010 9:47 pm
Location: Austria
Full name: Niculae Ionita

Re: Need a batch file with Bayeselo

Post by nionita »

This is what I use:

Code: Select all

#!/usr/bin/env bash

(
echo readpgn results.pgn
echo elo
echo mm
echo ratings
echo x
echo x
) | bayeselo
But results.pgn (after readpgn) could also be made a parameter.
User avatar
Evert
Posts: 2929
Joined: Sat Jan 22, 2011 12:42 am
Location: NL

Re: Need a batch file with Bayeselo

Post by Evert »

I use the following Perl script:

Code: Select all

#!/usr/bin/perl
use strict;

if ($#ARGV >= 0) {
   open ELO, "| bayeselo";
   print ELO "prompt off\n";
   foreach (@ARGV) { print ELO "readpgn $_\n"; }
   print ELO "elo
      mm
      offset 2100
      ratings
      los
      ";
   close ELO;
}
Don't know if that helps at all though...?
tpetzke
Posts: 686
Joined: Thu Mar 03, 2011 4:57 pm
Location: Germany

Re: Need a batch file with Bayeselo

Post by tpetzke »

Hi,

just enter all your bayeselo commands in a plain file and then pipe it into bayeselo as input.

if you name the file input.txt then you would simply run

bayeselo < input.txt
Thomas...

=======
http://macechess.blogspot.com - iCE Chess Engine
Robert Pope
Posts: 572
Joined: Sat Mar 25, 2006 8:27 pm
Location: USA
Full name: Robert Pope

Re: Need a batch file with Bayeselo

Post by Robert Pope »

Nice trick -- I've always had input.txt ready, and then copied and pasted into bayeselo.
Ferdy
Posts: 4855
Joined: Sun Aug 10, 2008 3:15 pm
Location: Philippines

Re: Need a batch file with Bayeselo

Post by Ferdy »

Charly wrote:Hi,

First of all, let me tell you that I'm not at all a programmer.

I would like to know if it is possible to have a batch file to run automatically Bayeselo (version Jan 30 2007).

ususally, I launch Bayeselo manually like that :

a) readpgn xxxxxx.pgn
b) elo
c) mm
d) exactdist
e) offset 2600 Ruffian 1.0.5
f) ratings
g) ratings>Elo.txt

It would be very user friendly and less time consuming to have that automated for my rating list.

Many thanks for helping.

Arnaud Lohéac
Here is another method.
Required files:
1. bayeselo.exe
2. your pgn file say zzz.pgn
Have a look at the comments after :: in the batch file.

Create a batch file say get_elo.bat then paste the following.

Code: Select all

:: (1) Modify your pgn filename here, say zzz.pgn
set "PGNFILE=zzz.pgn"


:: (2) Set your output rating file, say Elo.txt
set "OUTFILE=Elo.txt"


:: (2.1) Set the reference engine and its offset
set "REF_ENGINE_AND_OFFSET=offset 2600 Ruffian 1.0.5"


:: (3)Create the temp file elo_param.txt and write commands to this file
echo. 2>elo_param.txt
echo readpgn %PGNFILE%>elo_param.txt
echo elo>>elo_param.txt
echo mm>>elo_param.txt
echo exactdist>>elo_param.txt
echo %REF_ENGINE_AND_OFFSET%>>elo_param.txt
echo ratings>>elo_param.txt
echo ratings ^>%OUTFILE%>>elo_param.txt
echo x>>elo_param.txt
echo x>>elo_param.txt


:: (4) Run bayeselo
bayeselo <elo_param.txt


:: (5) Delete the temp file
if exist elo_param.txt del elo_param.txt


:: (6) See the output in console before exiting
pause
To edit the batch file, right-click the file then click edit.
I tested this on windows 7.