use strict;
use warnings;
no warnings 'exiting';
+use local::lib;
use CGI;
use DBI;
use DBD::Pg qw(:pg_types);
-use LWP::Simple;
+
+use LWP::Simple qw/get $ua/;
+$ua->agent("Stupid user agent check is stupid");
use FindBin;
use lib "$FindBin::Bin/../lib";
my $adddevscan = $dbh->prepare(q{INSERT INTO development_scans
(id,tick,pid,light_fac,medium_fac,heavy_fac,amps,distorters
- ,metal_ref,crystal_ref,eonium_ref,reslabs,fincents,seccents
+ ,metal_ref,crystal_ref,eonium_ref,reslabs,fincents,milcents,seccents,structdefs
,travel,infra,hulls,waves,extraction,covert,mining,total)
- VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
+ VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
});
my $text = $3;
my ($x,$y,$z) = $dbh->selectrow_array($findcoords,undef,$planet,$t);
die "No coords for: $planet tick $t" unless defined $x;
- if($news eq 'Launch' && $text =~ m/The (.*?) fleet has been launched, heading for (\d+):(\d+):(\d+), on a mission to (Attack|Defend). Arrival tick: (\d+)/g){
+ if($news eq 'Launch' && $text =~ m{The (.*?) fleet has been launched, heading for <a class="coords" href="galaxy.pl\?x=\d+&y=\d+">(\d+):(\d+):(\d+)</a>, on a mission to (Attack|Defend). Arrival tick: (\d+)}g){
my $eta = $6 - $t;
my $mission = $5;
my $back = $6 + $eta;
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 (\d+) visible ships/g){
+ }elsif($news eq 'Incoming' && $text =~ m{We have detected an open jumpgate from (.*?), located at <a class="coords" href="galaxy.pl\?x=\d+&y=\d+">(\d+):(\d+):(\d+)</a>. 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;
my $total = 0;
while($file =~ m{((?:[a-zA-Z]| )+)</t[dh]><td(?: class="right")?>(\d+)}sg){
push @values,$2;
- $total += $2 if $#values <= 13;
+ $total += $2 if $#values <= 15;
}
push @values,$total;
$adddevscan->execute(@values);