X-Git-Url: https://git.sesse.net/?p=remoteglot;a=blobdiff_plain;f=remoteglot.pl;h=c4c9c3699f8d9d8ccbaf9365e721611c3cf99960;hp=a6de634d9f3e43bfc92be254e74ba608662cf76e;hb=766c4d90d091a766a7989289b3d6d93f1a941045;hpb=2e7dae9e44dc28d14356353f02a4781a2df2ee17 diff --git a/remoteglot.pl b/remoteglot.pl index a6de634..c4c9c36 100755 --- a/remoteglot.pl +++ b/remoteglot.pl @@ -18,17 +18,17 @@ use warnings; # Configuration my $server = "freechess.org"; -my $target = "278"; -# 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 $target = "GMCarlsen"; +my $engine = "'./Deep Rybka 4 SSE42 x64'"; 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 @@ -67,13 +67,10 @@ while () { } 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"); -# uciprint("setoption name Contempt value 1000"); -# uciprint("setoption name Outlook value Ultra Optimistic"); +# uciprint("setoption name MultiPV value 2"); uciprint("ucinewgame"); print "Chess engine ready.\n"; @@ -82,7 +79,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 +208,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 +331,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 +399,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 +652,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 ""; # clear the screen @@ -966,7 +965,7 @@ sub book_info { } my $ret = `./booklook $fen`; - return '' if ($ret =~ /Not found/ || $ret eq ''); + return "" if ($ret =~ /Not found/ || $ret eq ''); my @moves = ();