Providers
Debian Linux
SDF
MinGW-W64
Verizon
Research
Faqs and RFCs
FileSearching
Google
Google Groups
W3Schools Online Web Tutorials
Wikipedia
Multimedia
CTIS
For the Pigs Among Us
Family Photos
My House
My Photos (1999-2002?)
My Photos (2005)
Retro Computers
Minions of Mirth
Main
Criticals
Criticals (Single Player)
Ghaqua
Maps and Points of Interest
Miscellaneous
Monster Templates
Miscellaneous
Area Codes
Bard’s Tale
Dungeons & Dragons Online
My Blog
Quote of the Day
RogueBasin
Slashdot
The Adventuer’s Guild
Weather
GitHub:eprive/Z80-MBC3
Programming
Main
Across
Biorhythm
BMP Chips
Complex Roots
Magic Square
Magic Square(js)
Matrix(js)
More DOS Programs
Roll
Strip Dups (bash)
Wacky Wood-Worker
How To
Enlightenment 0.16.7.2 Startup Patch
How to Create an OS X Iconset
My RedHat Howto
SSH to VMS (Deathrow OpenVMS Cluster)
Tools
Allowable Mortgage Interest
Dates and Mileage
Day of the Year
Fun With Time
Downloads
Educational
Utilities
mbest.pl
#!/usr/bin/env perl # mbest.pl version 1.3 12/14/16 # # 1.3 - Added Greivous wound to verbose. # # Constants $GAME_LOG="/Applications/Games/Minions of Mirth Undead Wars/MinionsOfMirth.app/Contents/logs/game.txt"; $BEST_REP="/Users/mike/Documents/minionsbest.report"; @temp = @toon; @toon = sort @temp; # Set options based on command line $verbose = 0; foreach (@ARGV) { if (/-v/) { $verbose = 1; } if (/-o/) { $old = 1; } if (/-1/) { $GAME_LOG= "/Applications/Games/Minions of Mirth Undead Wars/MinionsOfMirth.app/Contents/logs/game.txt"; $BEST_REP="/Users/mike/Documents/minionsbest.report"; } if (/-2/) { $GAME_LOG= "/Applications/Games/Minions of Mirth Undead Wars 2nd/MinionsOfMirth2.app/Contents/logs/game.txt"; $BEST_REP="/Users/mike/Documents/minions2best.report"; } } # Short term Boolean flags $cr_changed = 0; $gr_changed = 0; if ($old) { $verbose = 1; print "Using previous log!\n"; $GAME_LOG = $GAME_LOG . ".1"; } if ($verbose) { print "Log to parse: " . $GAME_LOG . "\n"; print "Data file : " . $BEST_REP . "\n"; } open REP, "$BEST_REP" or die $!; while (<REP>) { if (/^(\S+)\s*(\d*)\s*(\d*)/) { push @toon, $1; $critical{"$1"}=$2; $grievous{"$1"}=$3; } } close REP; foreach $TOON (@toon) { open LOG, $GAME_LOG || die $! ; while (<LOG>) { if (/$TOON critically/i) { $line = s/.* (.*) .*$/$1/; if ($verbose) { print $TOON . " " . $_ ; } if ($_ > $critical{"$TOON"}) { $critical{"$TOON"} = $_; chomp($critical{"$TOON"}); $cr_changed = 1; } } # patern found if (/$TOON grievously/i) { $line = s/.* (.*) .*$/$1/; # print $_; if ($verbose) { print $TOON . " Grievous wound " . $_ ; } if ($_ > $grievous{"$TOON"}) { $grievous{"$TOON"} = $_; chomp($grievous{"$TOON"}); $gr_changed = 1; } } } # while close LOG; } chomp($critical{"$TOON"}); print "Character Critical Grievous\n"; foreach $TOON (@toon) { printf "%-16s%10d%10d\n", $TOON, $critical{$TOON}, $grievous{$TOON}; } if ($cr_changed) { print "Critically wound has changed\n"; } if ($gr_changed) { print "Grievously wound has changed\n"; } open REP, ">$BEST_REP" or die $!; foreach $TOON (@toon) { print REP "$TOON " . $critical{"$TOON"} . " " . $grievous{"$TOON"} . "\n"; } close REP;
This source has been viewed 19 times.
Friday, 6 December 2024
Michael J. Chappell
Contact me at:
mcsuper5@freeshell.org