]> git.sesse.net Git - remoteglot/blobdiff - remoteglot.pl
Workaround for double spaces added by Zappa Mexico; patch from
[remoteglot] / remoteglot.pl
index a6de634d9f3e43bfc92be254e74ba608662cf76e..16416ba07fb7a37c48c6e1c36e54c0c9cd69fe04 100755 (executable)
@@ -18,17 +18,21 @@ use warnings;
 
 # Configuration
 my $server = "freechess.org";
-my $target = "278";
+my $target = "GMCarlsen";
 # my $engine = "/usr/games/toga2";
-# my $engine = "wine Rybkav2.3.2a.mp.w32.exe";
-my $engine = "~/microwine-0.2/microwine Rybkav2.3.2a.mp.x64.exe";
+#my $engine = "wine Rybkav2.3.2a.mp.w32.exe";
+my $engine = "~/microwine-0.5/microwine Rybkav2.3.2a.mp.x64.exe";
+#my $engine = "ssh -t sesse\@84.48.204.209 ./microwine-0.5/microwine ./Rybkav2.3.2a.mp.x64.exe";
+#my $engine = "ssh -t sesse\@cirkus.samfundet.no nice -n 19 ./microwine-0.5/microwine ./microwine-0.5/Rybkav2.3.2a.mp.x64.exe";
 my $telltarget = undef;   # undef to be silent
 my @tell_intervals = (5, 20, 60, 120, 240, 480, 960);  # after each move
-my $uci_assume_full_compliance = 1;                    # dangerous :-)
+my $uci_assume_full_compliance = 0;                    # dangerous :-)
 my @masters = (
        'Sesse',
        'Sessse',
-       'Sesssse'
+       'Sesssse',
+       'greatestguns',
+       'beuki'
 );
 
 # Program starts here
@@ -68,7 +72,7 @@ while (<UCIREAD>) {
 
 uciprint("setoption name UCI_AnalyseMode value true");
 # uciprint("setoption name Preserve Analysis value true");
-uciprint("setoption name NalimovPath value /srv/tablebase");
+uciprint("setoption name NalimovPath value /srv/tablebase");
 uciprint("setoption name NalimovUsage value Rarely");
 uciprint("setoption name Hash value 1024");
 uciprint("setoption name MultiPV value 2");
@@ -82,7 +86,7 @@ print "Chess engine ready.\n";
 my $t = Net::Telnet->new(Timeout => 10, Prompt => '/fics% /');
 $t->input_log(\*FICSLOG);
 $t->open($server);
-$t->print("guest");
+$t->print("SesseBOT");
 $t->waitfor('/Press return to enter the server/');
 $t->cmd("");
 
@@ -211,6 +215,7 @@ sub handle_uci {
 
        chomp $line;
        $line =~ tr/\r//d;
+       $line =~ s/  / /g;  # Sometimes needed for Zappa Mexico
        print UCILOG localtime() . " <= $line\n";
        if ($line =~ /^info/) {
                my (@infos) = split / /, $line;
@@ -333,6 +338,7 @@ sub style12_to_fen {
        $castling .= "k" if ($x[13] == 1);
        $castling .= "q" if ($x[14] == 1);
        $castling = "-" if ($castling eq "");
+       # $castling = "-"; # chess960
        $fen .= " ";
        $fen .= $castling;
 
@@ -400,7 +406,7 @@ sub prettyprint_pv {
        my $piece = substr($board->[$from_row], $from_col, 1);
 
        if ($piece eq '-') {
-               die "Invalid move";
+               die "Invalid move $pv";
        }
 
        # white short castling
@@ -653,7 +659,7 @@ sub output_screen {
                $text .=  "\n\n";
        }
 
-       $text .= book_info($pos_calculating->{'fen'}, $pos_calculating->{'board'}, $pos_calculating->{'toplay'});
+       #$text .= book_info($pos_calculating->{'fen'}, $pos_calculating->{'board'}, $pos_calculating->{'toplay'});
 
        if ($last_text ne $text) {
                print "\e[H\e[2J"; # clear the screen
@@ -966,7 +972,7 @@ sub book_info {
        }
 
        my $ret = `./booklook $fen`;
-       return '' if ($ret =~ /Not found/ || $ret eq '');
+       return "" if ($ret =~ /Not found/ || $ret eq '');
 
        my @moves = ();