]> ruin.nu Git - ndwebbie.git/blobdiff - scripts/parseplanets.pl
Remove the old stats automatically when parsing
[ndwebbie.git] / scripts / parseplanets.pl
index 7d3eda7c1396ffb7f934184e71ac146515c1151b..0c62298edc96f501b06907f383c30cbc048dcb1a 100755 (executable)
@@ -35,8 +35,6 @@ use ND::DB;
 
 our $dbh = ND::DB::DB();
 
-$ND::DBH = $dbh;
-
 my $tick = $ARGV[0];
 my $hour;
 $dbh->begin_work;
@@ -87,6 +85,7 @@ while (my @planet = $findplanets->fetchrow){
 }
 my $intel = $dbh->prepare(q{INSERT INTO forum_posts (ftid,uid,message) VALUES(
                (SELECT ftid FROM planets WHERE pid = $2),$1,$3)});
+$dbh->do(q{DELETE FROM planet_stats WHERE tick = $1},undef,$tick);
 for my $planet (@planets) {
        #print "$planet->[1]\n";
        my $oldPlanet = $oldStats{$planet->[1]};