X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=scripts%2Fstats.pl;h=f90f16a134da2ec48794faa7d5f6160494f30765;hb=6772ec335287679e8837ebe85b8b1218cc2be8ff;hp=706d7c70ff78a8c3ae4cd00adaf4f4a21238ee51;hpb=b52c7c95096825846f53e73de627e6cda01d9bca;p=ndwebbie.git diff --git a/scripts/stats.pl b/scripts/stats.pl index 706d7c7..f90f16a 100755 --- a/scripts/stats.pl +++ b/scripts/stats.pl @@ -38,9 +38,9 @@ $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.php?page=stats"); +my $file = get("http://game.planetarion.com/manual.pl?page=stats"); $dbh->begin_work; -my $st = $dbh->prepare(q{INSERT INTO ship_stats (name,"class",t1,t2,t3,"type",init,guns,armor,damage,eres,metal,crystal,eonium,race) VALUES(?,?,NULLIF(?,'-'),NULLIF(?,'-'),NULLIF(?,'-'),?,?,?,?,?,?,?,?,?,?)}); +my $st = $dbh->prepare(q{INSERT INTO ship_stats (ship,"class",t1,t2,t3,"type",init,guns,armor,damage,eres,metal,crystal,eonium,race) VALUES(?,?,NULLIF(?,'-'),NULLIF(?,'-'),NULLIF(?,'-'),?,?,?,?,?,?,?,?,?,?)}); while ($file =~ /((?:\w| )+)<\/td>(\w+)<\/td>(\w+|-)<\/td>(\w+|-)<\/td>(\w+|-)<\/td>(\w+)\D+(\d+)\D+(\d+)\D+(\d+)\D+?(\d+|-)\D+(\d+)\D+(\d+)\D+(\d+)\D+(\d+)\D+\d+\D+\d+.+?(\w+)<\/td>/g){ my $dmg = $10; $dmg = 0 if $dmg eq '-';