3 # kgslog2gtp - Convert kgsGtp log file to GTP command stream
5 # The command stream contains two special GTP commands intended
6 # for further script processing (unrecognized by Pachi itself):
8 # pachi-mygame COLOR OPPONENT DATE TIME
9 # pachi-mymove COORD VALUE
11 # (You probably want to convert pachi-mymove to play.)
15 # 19.1.2012 20:47:47 com.gokgs.client.gtp.a <init>
16 if (s/^(\S+ \S+) com.gokgs.client.gtp.a <init>$/$1/) {
19 # FINE: Starting game as white against Mateman
20 } elsif (s/^FINE:.*as (\S+) against (\w+)/$1 $2/) {
21 print "pachi-mygame $_ $a";
24 } elsif (s/^IN: // and not /genmove/ and not /kgs-chat/ and not /time/) {
27 # *** WINNER is C4 (3,4) with score 0.4333 (49243/93153:93153/93393 games), extra komi 0.000000
28 } elsif (s/^\*\*\* WINNER is (\S+) .*score (\S+) .*komi 0\.0.*/$1 $2/) {
29 print "pachi-mymove $_";