my ($x,$y,$z) = $dbh->selectrow_array($findcoords,undef,$planet,$t);
die "No coords for: $planet tick $t" unless defined $x;
my $news = $1;
my $t = $2;
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 <a class="coords" href="galaxy.pl\?x=\d+&y=\d+">(\d+):(\d+):(\d+)</a>, on a mission to (Attack|Defend). Arrival tick: (\d+)}g){
+ if(($news eq 'Defend' || $news eq 'Attack' || $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;
$mission = 'AllyDef' if $eta == 6 && $x != $2;
my ($target) = $dbh->selectrow_array($findplanet,undef
,$2,$3,$4,$t) or die $dbh->errstr;
my $eta = $6 - $t;
my $mission = $5;
my $back = $6 + $eta;
$mission = 'AllyDef' if $eta == 6 && $x != $2;
my ($target) = $dbh->selectrow_array($findplanet,undef
,$2,$3,$4,$t) or die $dbh->errstr;
- die "No target: $2:$3:$4" unless defined $target;
+ next unless defined $target;
my $id = addintel($1,$mission,$planet,$target,$6
,$eta,$back,undef, ($x == $2 && $y == $3));
$intelscan->execute($id,$scan->{id});
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 <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){
+ }elsif($news eq 'Hostile' && $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){