changeset 240:c79dd30a368f misc

Cosmetics.
author Matti Hamalainen <ccr@tnsp.org>
date Fri, 01 Mar 2013 05:14:11 +0200
parents b35c643a64d9
children bc07a75aee3e
files icesusplaque.pl
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/icesusplaque.pl	Sun Feb 24 19:28:02 2013 +0200
+++ b/icesusplaque.pl	Fri Mar 01 05:14:11 2013 +0200
@@ -39,7 +39,7 @@
   $line =~ s/[\r\n]+$//;
   if ($line =~ /^Server time: (.+)/) {
     $stamp = str2time($1);
-  } elsif ($state == 0 && $line =~ /^\| +The top 150 players of Icesus +lvl +Exp +\|/) {
+  } elsif ($state == 0 && $line =~ /^\| +The top \d+ players of Icesus +lvl +Exp +\|/) {
     $state = 1;
   } elsif ($state == 1 && $line =~ /^\| +(\d+) +([A-Z][a-z]+) +(\d+) +([0-9][0-9,]+) +\|/) {
     my ($pos, $name, $level, $exp) = ($1, $2, $3, $4);
@@ -162,7 +162,8 @@
 if ($opt_plaque) {
   $sbar = $shead = sprintf "| %-10s | %-12s | %-10s | %-30s |",
   "Pos", "Name", "Lvl", "Exp";
-  $sbar =~ s/./-/g;
+  $sbar =~ tr/\|/+/;
+  $sbar =~ s/[^\+]/-/g;
 
   print "" . scalar localtime($$p0{0})." to ".scalar localtime($$p1{0})." (".get_period($$p1{0} - $$p0{0}).")\n".
   "$sbar\n$shead\n$sbar\n";
@@ -177,7 +178,8 @@
 if ($opt_topexp) {
   $sbar = $shead = sprintf "| %-15s | %7s | %-15s | %-15s |",
   "Exp gain", "% (*)", "Total exp", "Name";
-  $sbar =~ s/./-/g;
+  $sbar =~ tr/\|/+/;
+  $sbar =~ s/[^\+]/-/g;
 
   print "" . scalar localtime($$p0{0})." to ".scalar localtime($$p1{0}).
   " (".get_period($$p1{0} - $$p0{0}).")\n" unless ($opt_plaque);