changeset 92:013e69791387 misc

Cleanups; Version bump; Make GgrTF log assumption not to be default.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 26 Apr 2010 03:56:33 +0000
parents d513a05279d3
children 73fbb15fcda5
files magestats.pl
diffstat 1 files changed, 10 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/magestats.pl	Sun Apr 25 04:45:27 2010 +0000
+++ b/magestats.pl	Mon Apr 26 03:56:33 2010 +0000
@@ -24,7 +24,10 @@
 );
 
 # Settings and defaults
-my $progName = "magestats.pl";
+my $prog_name = "Magestats";
+my $prog_version = "0.6.2";
+my $prog_name = "magestats.pl";
+
 my $opt_cachefile;
 my $opt_verbosity = 1;
 my $opt_prefix = "magestats";
@@ -32,7 +35,7 @@
 my $opt_noinput = 0;
 my $opt_width = 500;
 my $opt_height = 250;
-my $opt_ggrtf = 1;
+my $opt_ggrtf = 0;
 
 my @crit_types = ("Unseen", "ENERGY", "POWER", "power");
 
@@ -47,15 +50,13 @@
 ###
 ### Print out help if no arguments given
 ###
-my $prog_name = "Magestats";
-my $prog_version = "0.6.2";
 my $opt_mode = shift or die(
 "$prog_name v$prog_version - BatMUD Mage guild statistics generator
 Developed by Matti Hamalainen (Ggr \@ bat), <ccr\@tnsp.org>
 (C) Copyright 2010 Tecnic Software productions (TNSP)
 
-Usage: $progName dump [options] < logfile
-       $progName stats [options] < logfile
+Usage: $prog_name dump [options] < logfile
+       $prog_name stats [options] < logfile
 
  -v                Verbose mode
  -c <cachefile>    Specify a cache file to restore from
@@ -273,14 +274,13 @@
   }
 }
 
-mlog(1, "Using GgrTF format only!") if ($opt_ggrtf);
-mlog(2, "Matching regexp '$match'\n");
-
-my $gflag = 0;
 
 if ($opt_noinput) {
   mlog(1, "Skipping input parsing.");
 } else {
+  my $gflag = 0;
+  mlog(1, "Using GgrTF format only!") if ($opt_ggrtf);
+  mlog(2, "Matching regexp '$match'\n");
   mlog(1, "Parsing log from stdin...");
   while (defined(my $s = <STDIN>)) {
     if ($s =~ /^You wear.*? (\S+ the (Shimmering|Radiating|Glowing) ([Ww]hite|[Gg]rey|[Dd]ark|[Bb]lack) mage staff)( <.+? glow>| of Power)/) {