]> ruin.nu Git - ndwebbie.git/blobdiff - scripts/stats.pl
Remove old ugly hacks from pre-history
[ndwebbie.git] / scripts / stats.pl
index 6e9c8508e2332ca393162e366cc6b0392f781c5b..fb30c24717ed622bf6897f419c263c6f101fb3e4 100755 (executable)
@@ -35,8 +35,6 @@ use ND::DB;
 
 our $dbh = ND::DB::DB();
 
-$dbh->do("SET CLIENT_ENCODING TO 'LATIN1';");
-
 my %classes = (Fighter => 'Fi', Corvette => 'Co', Frigate => 'Fr', Destroyer => 'De', Cruiser => 'Cr', Battleship => 'Bs');
 
 my $file = get("http://game.planetarion.com/manual.pl?page=stats");
@@ -46,6 +44,8 @@ while ($file =~ /class="(\w+)"><td>((?:\w| )+)<\/td><td>(\w+)<\/td><td>(\w+|-)<\
        my $dmg = $10;
        $dmg = 0 if $dmg eq '-';
        my $class = $classes{$3};
+       my $type = $6;
+       $type = 'Emp' if $type eq 'EMP';
        $st->execute($2,$class,$4,$5,'-',$6,$7,$8,$9,$dmg,$11,$12,$13,$14,$1) or die $dbh->errstr;
        print "$2,$class,$4,$5,'-',$6,$7,$dmg,$9,$10,$11,$12,$13,$14,$1\n";
 }