]> ruin.nu Git - ndwebbie.git/blobdiff - scripts/scans.pl
Format for scans has changed to include commas in numbers
[ndwebbie.git] / scripts / scans.pl
index 185c76c858f3733c9bd2c279b63a3eb2b1cdc3f3..f6b6be316d14debf006acaf3f34a05d67e50fe5b 100755 (executable)
@@ -128,6 +128,7 @@ sub parse_unit {
 sub parse_jumpgate {
        my ($scan,$file) = @_;
 
+       $file =~ s/,//g;
        while ($file =~ m{(\d+):(\d+):(\d+)\D+(Attack|Defend|Return)</td><td class="left">([^<]*)\D+(\d+)\D+(\d+)}g){
                my ($sender) = $dbh->selectrow_array($findplanet,undef,$1,$2,$3,$scan->{tick});
                ($sender) = $dbh->selectrow_array($findoldplanet,undef,$1,$2,$3,$scan->{tick})
@@ -220,7 +221,7 @@ while (my $scan = $newscans->fetchrow_hashref){
                                        my $id = addintel($1,$mission,$planet,$target,$6
                                                ,$eta,$back,undef, ($x == $2 && $y == $3));
                                        $intelscan->execute($id,$scan->{id});
-                               }elsif($news eq 'Incoming' && $text =~ m/We have detected an open jumpgate from (.*?), located at (\d+):(\d+):(\d+). The fleet will approach our system in tick (\d+) and appears to have roughly (\d+) ships/g){
+                               }elsif($news eq 'Incoming' && $text =~ m/We have detected an open jumpgate from (.*?), located at (\d+):(\d+):(\d+). The fleet will approach our system in tick (\d+) and appears to have (\d+) visible ships/g){
                                        my $eta = $5 - $t;
                                        my $mission = '';
                                        my $back = $5 + $eta;
@@ -271,6 +272,7 @@ sub addfleet {
 
        my @ships;
        my $total = 0;
+       $ships =~ s/,//g;
        while(defined $ships && $ships =~ m{((?:[a-zA-Z]| )+)</td><td(?: class="right")?>(\d+)}sg){
                $total += $2;
                push @ships, [$1,$2];