]> git.sesse.net Git - remoteglot/commitdiff
Minor reorganization.
authorSteinar H. Gunderson <sesse@debian.org>
Sun, 1 Jul 2007 15:12:31 +0000 (17:12 +0200)
committerSteinar H. Gunderson <sesse@debian.org>
Sun, 1 Jul 2007 15:12:31 +0000 (17:12 +0200)
remoteglot.pl

index 24ce2e75106a10ce53c539cdc650b115efa7bb4e..69ba997470827c689068c9909425471c3438257d 100755 (executable)
@@ -16,15 +16,17 @@ use Time::HiRes;
 use strict;
 use warnings;
 
-$SIG{ALRM} = sub { output_screen(); };
-
-$| = 1;
-
+# Configuration
 my $server = "freechess.org";
 my $target = "Sesse";
 # my $engine = "/usr/games/toga2";
 my $engine = "wine Rybkav2.3.2a.mp.w32.exe";
 
+# Program starts here
+$SIG{ALRM} = sub { output_screen(); };
+
+$| = 1;
+
 open(FICSLOG, ">ficslog.txt")
        or die "ficslog.txt: $!";
 print FICSLOG "Log starting.\n";
@@ -56,7 +58,7 @@ uciprint("setoption name UCI_AnalyseMode value true");
 uciprint("setoption name NalimovPath value c:\\nalimov");
 uciprint("setoption name NalimovUsage value Rarely");
 uciprint("setoption name Hash value 1024");
-uciprint("setoption name MultiPV value 3");
+uciprint("setoption name MultiPV value 3");
 # uciprint("setoption name Contempt value 1000");
 # uciprint("setoption name Outlook value Ultra Optimistic");
 uciprint("ucinewgame");
@@ -99,6 +101,15 @@ while (1) {
                        uciprint("stop");
                        uciprint("position fen $fen");
                        uciprint("go infinite");
+
+                       # 
+                       # Output a command every move to note that we're
+                       # still paying attention -- this is a good tradeoff,
+                       # since if no move has happened in the last half
+                       # hour, the analysis/relay has most likely stopped
+                       # and we should stop hogging server resources.
+                       #
+                       $t->cmd("date");
                }
                #print "FICS: [$line]\n";
                $sleep = 0;