git.shiar.nl
/
perl
/
schtarr.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
cc84763
)
screp: fix apm (ignore first 1'20 correctly)
author
Shiar
<shiar@shiar.org>
Mon, 12 Nov 2007 15:14:22 +0000
(16:14 +0100)
committer
Shiar
<shiar@shiar.org>
Mon, 12 Nov 2007 15:14:22 +0000
(16:14 +0100)
screp
patch
|
blob
|
history
diff --git
a/screp
b/screp
index 4b1f033159b8614100d43d28a30f0b6121fdc7f2..0b35ac0d00c709010a07dc7017f1de7a7103df8a 100755
(executable)
--- a/
screp
+++ b/
screp
@@
-10,6
+10,8
@@
GetOptions(
"verbose|v!" => \$SHOWWARN,
);
"verbose|v!" => \$SHOWWARN,
);
+use constant { APM_FIRSTFRAME => 80 / .042 };
+
{
package Data::StarCraft::Replay;
{
package Data::StarCraft::Replay;
@@
-486,7
+488,7
@@
my %cmdmacro = map {$_ => 1} (
my %stats; # player => count
for (@$map) {
$stats{$_->[1]}{actions}++;
my %stats; # player => count
for (@$map) {
$stats{$_->[1]}{actions}++;
- $stats{$_->[1]}{gameactions}++ if $_->[0] >
80 / .042
;
+ $stats{$_->[1]}{gameactions}++ if $_->[0] >
= APM_FIRSTFRAME
;
$stats{$_->[1]}{last} = $_->[0] if $_->[2] eq "part";
$stats{$_->[1]}{$cmdmacro{$_->[2]} ? "macro" : "micro"}++;
$stats{$_->[1]}{count}{$_->[2]}++;
$stats{$_->[1]}{last} = $_->[0] if $_->[2] eq "part";
$stats{$_->[1]}{$cmdmacro{$_->[2]} ? "macro" : "micro"}++;
$stats{$_->[1]}{count}{$_->[2]}++;
@@
-501,8
+503,7
@@
for my $player (sort keys %stats) {
showtime($row->{last}),
# $row->{micro} / $row->{last} * 60 / .042 * 1.05,
# $row->{macro} / $row->{last} * 60 / .042 * 1.05,
showtime($row->{last}),
# $row->{micro} / $row->{last} * 60 / .042 * 1.05,
# $row->{macro} / $row->{last} * 60 / .042 * 1.05,
- $row->{gameactions} / $row->{last} * 60 / .042 * 1.042,
- # $row->{gameactions} / $map->[-1][0] * 60 / .042,
+ $row->{gameactions} / ($row->{last} - APM_FIRSTFRAME) * 60 / .042,
);
if (0) {
);
if (0) {