VladimirPootin's Mafia Log Parser v5.0: Linux compatible!

For stuff related to KoLmafia, KoLproxy, Ascension Log Visualizer, and greasemonkey scripts. Maybe other stuff too.
Parrithead
AFH
Posts: 52
Joined: Fri Apr 27, 2007 5:09 pm

Post by Parrithead » Thu May 10, 2007 8:28 am

VladimirPootin wrote:see what kind of junk is in cream.txt.


tres cool. There's a bunch of crap in there. Gives me a little understanding of what to look for after I ascend her today.

kain
Pie of the Sky
Posts: 23
Joined: Wed May 16, 2007 2:30 pm

Post by kain » Wed May 16, 2007 2:41 pm

I just wanted to hop in and say that the parser is incredible

Seriously awesome.

<<edit>> I did notice that if I beat the NS, and then decide to level to 12, it doesn't register that I actually hit level 12 (or 14 or 15 or 27 -- whatever I got to)

It also doesn't register (somehow) how many adventures I used to get the dictionary

Code: Select all

BOTTLENECKS
-----------

Sewered 11 times for 4 trinkets
Fought  bloopers
Fought 6 dairy goats for 6 cheeses
Fought 23 armours for 9 antiques
Took  disguised turns to get the dictionary
Received 28 louvres in 122 gallery adventures (23.0%)
Louvred for 0 / 4007 / 1400
Received 1 muscle castle adventures
Received 0 myst castle adventures
Received 0 mox castle adventures

I pulled the digital key, so that's why there aren't any bloopers ...

VladimirPootin
AFH
Posts: 1236
Joined: Tue Mar 27, 2007 2:03 am
Location: Ad Absurdum

Post by VladimirPootin » Thu May 17, 2007 4:20 am

it stops counting at level 15 but it should do up to there... maybe i forgot. will look into it the next time i work on this thing.

also the disguised adventures... hmm - are you subject to areas missing the last character? some of the more advanced features will break if that's the case.
[b]AFH: Now with more [i]new and improved[/i] moral ambiguity![/b]

kain
Pie of the Sky
Posts: 23
Joined: Wed May 16, 2007 2:30 pm

Post by kain » Thu May 17, 2007 9:11 am

VladimirPootin wrote:it stops counting at level 15 but it should do up to there... maybe i forgot. will look into it the next time i work on this thing.

also the disguised adventures... hmm - are you subject to areas missing the last character? some of the more advanced features will break if that's the case.


Yeah, that could be (the missing characters) as none of the logs I ran this thing through showed the number of disguised adventures to find the dictionary. The fact that I pull one to autosell wouldn't have anything to do with this, would it?

In fact, on all the runs where I killed the NS and then leveled for a post-level 11 skill, the parser doesn't recognize that I got to X level and then ascended.

I'll try the chomp/chop switch and let ya know

It's not a huge deal to me at all, I just love having the adventure count/detail, which *rocks*

<<edit>>
log before search/replace chop/chomp wrote:

Code: Select all

[1-11] Unlucky Sewer
     #> Turn [0] pulled 1 jewel-eyed wizard hat
     #> Turn [0] pulled 1 plastic pumpkin bucket
     #> Turn [0] pulled 1 pilgrim shield
     #> Turn [0] pulled 1 ice sickle
     #> Turn [0] pulled 1 Travoltan trousers
     #> Turn [0] pulled 1 Rock and Roll Legend
     #> Turn [0] pulled 1 facsimile dictionary
     #> Turn [0] pulled 1 Wand of Nagamar
     #> Turn [0] pulled 1 stainless steel scarf
     #> Turn [0] pulled 1 ring of conflict
     #> Turn [0] pulled 1 milk of magnesium
     o> Turn [0] Used 1 milk of magnesium
     #> Turn [0] pulled 3 spooky hi mein
     o> Ate 1 spooky hi mein
        35 adventures gained
     => Level 2 (Turn 0)! (3/10/0)
     => Level 3 (Turn 0)! (3/10/5)
     o> Ate 1 spooky hi mein
        32 adventures gained
     => Level 4 (Turn 0)! (5/14/5)
     o> Ate 1 spooky hi mein
        32 adventures gained
     +> [1] Got worthless trinket
     +> [4] Got worthless trinket
     +> [9] Got worthless knick-knack
     +> [11] Got worthless gewgaw

log after search/replace chop/chomp wrote:

Code: Select all

[1-11] Unlucky Sewer
     #> Turn [0] pulled 1 jewel-eyed wizard hat
     #> Turn [0] pulled 1 plastic pumpkin bucket
     #> Turn [0] pulled 1 pilgrim shield
     #> Turn [0] pulled 1 ice sickle
     #> Turn [0] pulled 1 Travoltan trousers
     #> Turn [0] pulled 1 Rock and Roll Legend
     #> Turn [0] pulled 1 facsimile dictionary
     #> Turn [0] pulled 1 Wand of Nagamar
     #> Turn [0] pulled 1 stainless steel scarf
     #> Turn [0] pulled 1 ring of conflict
     #> Turn [0] pulled 1 milk of magnesium
     o> Turn [0] Used 1 milk of magnesium
     #> Turn [0] pulled 3 spooky hi mein
     o> Ate 1 spooky hi mein
        35 adventures gained
     => Level 2 (Turn 0)! (3/10/0)
     => Level 3 (Turn 0)! (3/10/5)
     o> Ate 1 spooky hi mein
        32 adventures gained
     => Level 4 (Turn 0)! (5/14/5)
     o> Ate 1 spooky hi mein
        32 adventures gained
     +> [1] Got worthless trinket
,
     +> [4] Got worthless trinket
,
     +> [9] Got worthless knick-knack
,
     +> [11] Got worthless gewgaw
,

<<...>>
BOTTLENECKS
-----------

Sewered  times for 4 trinkets
Fought  bloopers
Fought 6 dairy goats for  cheeses
Fought 23 armours for 9 antiques
Took  disguised turns to get the dictionary
Received 28 louvres in  gallery adventures (0%)
Louvred for 0 / 4007 / 1400
Received 1 muscle castle adventures
Received 0 myst castle adventures
Received 0 mox castle adventures


Like I said, not a big deal at all, but if you'd like mafia logs, etc, I'd be glad to provide them.[/quote]

<<edit 2 = early morning means typos>>

dvmaprezson
Fie the Pie
Posts: 1009
Joined: Mon Jan 29, 2007 9:45 pm
Location: Philly Suburbs
Contact:

Post by dvmaprezson » Sun May 27, 2007 9:48 pm

-familiar is broken in the latest version for me, vlad.
[img]http://img.photobucket.com/albums/v300/dvmaprezson/AFHV2.gif[/img]

VladimirPootin
AFH
Posts: 1236
Joined: Tue Mar 27, 2007 2:03 am
Location: Ad Absurdum

Post by VladimirPootin » Sun May 27, 2007 11:46 pm

seems like a couple things are busted... next time i look it over i'll try to clear it up.

changes to mafia stand a good chance of breaking the parser.
[b]AFH: Now with more [i]new and improved[/i] moral ambiguity![/b]

theophrastus
Spy vs. Pie
Posts: 77
Joined: Thu Apr 19, 2007 5:45 am

Post by theophrastus » Mon Jun 18, 2007 6:35 am

I've been noticing some weirdness in the calculation of level gains (i.e. the readout at which turn a new level is reached), which seems not be connected to another bug which Kain reported about the final level attainment post-Sorceress not being registered. Example bug No. 1:

Code: Select all

     o> Turn [0] Used 3 Breathetastic? Premium Canned Air
        70 adventures gained
     => Level 2 (Turn 0)! (14/13/0)
     => Level 3 (Turn 0)! (14/13/14)
...
[7-13] Spooky Forest
     => Level 4 (Turn 7)! (14/13/14)
whereas (i) the stats after adv 7 are the same as before adv 1, and (ii) I gained L4 directly from the canned air.

Specifically, I am referring to the line which reads

Code: Select all

my @LEVELS = (0,0,25,64,169,400,841,1600,2809,4624,7225,10816,15625,21904,29929,40000);

I haven't read the entire code to see how this information is used, but I assume you just total the substats gained and interpolate the turn at which a level is gained. However
KoLWiki in its speedrun appendix wrote:

Code: Select all

      Achieved   Total Sub-Point
Level   At Stat       Cost
1       N/A            N/A
2         5            10
3         8            49
4        13           154
5        20           385
6        29           826
7        40          1585
8        53          2794
9        68          4609
10       85          7210
11      104         10801

This is because your stats start at 3/3/2, and your primary stat starts with 6/7 substats, while your secondary starts at 1/7 substats and your tertiary starts at 1/5.

This would mean that if my assumption is correct, your interpolation comes 15 substat points too late, which may or may not make a few turns difference, especially early game, where you have lots of statless advs in the sewers and whatnot. Clearly, in the late game where you are gaining 30 mainstat points per combat and upwards of 200 per noncombat, it often won't make a difference, if any at all. OTOH, you may have accounted for this elsewhere in the code.

Bug Nr. 2: Since my L15 runs often included some mucking around after having bought the skill, it seems unlikely that these measley 15 substat points should be the reason for L15 not registering correctly. Any ideas on that?

@Kain: If I understand your post correctly, you are saying only the final level is not registered if you level post-Sorceress, i.e. going to L27 would register all level gains up to L26 inclusive. Can you confirm this?

If anyone has a link to a downloadable starter for Perl, I would appreciate hearing about it. I hate manually d/l-ing lots of pages and changing the internal references by hand.

Edit: I double-checked, and in at least one run, I bought the L15 skill and then gathered bags of bones in the Conservatory, gaining well over 200 substat points in the process, so it seems that L15 (resp. the last level to be attained) not registering is indeed a separate bug.

deedlee
AFH
Posts: 108
Joined: Tue May 15, 2007 10:20 pm

Post by deedlee » Sun Jun 24, 2007 12:55 pm

if you want to run this script on a 1 day run, I found you need to break your logs in half (2 files)
this is running on windows

User avatar
QuantumNightmare
AFH
Posts: 1827
Joined: Mon Jan 29, 2007 10:28 pm
Location: Montreal

Post by QuantumNightmare » Mon Dec 17, 2007 5:54 pm

I've updated this for NS13. It now groups adventures properly, records critical NS13 drops, and displays critical item drops from noncombats. The familiar option doesn't work for now, so call the script by typing:

./mafialogparser.pl -all YourNameHere

Version 2.3.2

Huge thanks to vlad for the script. This is just an incremental improvement on his great work.

DarthDud
Inscrutable Pi
Posts: 265
Joined: Fri Apr 06, 2007 12:41 am

Post by DarthDud » Mon Dec 17, 2007 8:49 pm

Blah. It... is not detecting some of my ascensions correctly.

Edit: granted I am missing like the first 10 turns of that run. But I really wish it were smart enough to still work with it.

User avatar
Mad Hamish
AFH
Posts: 1517
Joined: Mon Apr 09, 2007 8:03 pm

Post by Mad Hamish » Mon Dec 17, 2007 9:56 pm

Make a fake 10 turns.
Image
Hi-keebated again? No way!

User avatar
KujjieKujjieKoo
Spade Ninja
Posts: 2240
Joined: Mon Apr 30, 2007 8:50 pm
Location: !Chicago
Contact:

Post by KujjieKujjieKoo » Mon Dec 17, 2007 10:03 pm

I would love to see all of Darth's logs start with: [1-10] Campground.

A couple other items to add to the critical drops: gourd potion, filthworm glands.

Also, is it possible to record the first instance where an item appears? I'm thinking specifically of the war outfits, where the first piece is important, but multiple drops would be excessively long.
Image

User avatar
Mad Hamish
AFH
Posts: 1517
Joined: Mon Apr 09, 2007 8:03 pm

Post by Mad Hamish » Mon Dec 17, 2007 10:58 pm

KujjieKujjieKoo wrote:I would love to see all of Darth's logs start with: [1-10] Campground.
All bleeding edge runs these days require a Spooky Hockey Mask :wink:
Image
Hi-keebated again? No way!

DarthDud
Inscrutable Pi
Posts: 265
Joined: Fri Apr 06, 2007 12:41 am

Post by DarthDud » Tue Dec 18, 2007 2:14 am

Code: Select all

[1-10] Campground
[11-17] Spooky Forest
     +> [14] Got Spooky Temple map
     +> [15] Got spooky sapling
     => Level 2 (Turn 16)! (4/4/5)
     +> [17] Got mosquito larva
[18-31] Typical Tavern Quest
     => Level 3 (Turn 21)! (5/5/8)
     => Level 4 (Turn 28)! (7/7/13)
     #> Turn [32] pulled 1 bartender-in-the-box
[32] Haunted Pantry
[33-39] Haunted Billiards Room
     +> [37] Got pool cue
[40-44] Haunted Library
     o> Drank 1 pink pony
        17 adventures gained
     o> Drank 1 rockin' wagon
        19 adventures gained
     => Level 5 (Turn 42)! (12/11/20)
[45-57] Outskirts of The Knob
     +> [49] Got chef's hat
     +> [57] Got Knob Goblin encryption key
[58-58] Knob Goblin Harem
     #> Turn [59] pulled 1 C.A.R.N.I.V.O.R.E. button
[59-68] 8-Bit Realm
[69] Friar Ceremony Location
[69-76] Dark Elbow of the Woods
     => Level 6 (Turn 71)! (18/17/29)
     #> Turn [76] pulled 1 tangarita
     o> Drank 1 tangarita
        24 adventures gained
     o> Drank 1 snifter of thoroughly aged brandy
        7 adventures gained
     +> [76] Got eldritch butterknife
[77-89] Dark Heart of the Woods
     +> [89] Got box of birthday candles
[90-99] Dark Neck of the Woods
     +> [93] Got wussiness potion
     +> [97] Got wussiness potion
     #> Turn [99] pulled 1 chef-in-the-box
     #> Turn [99] pulled 1 milk of magnesium
     +> [99] Got dodecagram
[100-107] Guano Junction
     +> [103] Got sonar-in-a-biscuit
     o> Ate 1 Hell ramen
        27 adventures gained
     o> Ate 1 Hell ramen
        27 adventures gained
     o> Ate 1 bat haggis
        7 adventures gained
     o> Ate 1 fortune cookie
        2 adventures gained
     o> Ate 1 fortune cookie
     +> [106] Got loose teeth, broken skull
     #> Turn [107] pulled 1 ring of conflict
     +> [107] Got sonar-in-a-biscuit, broken skull
[108-113] Haunted Bedroom
     +> [111] Got Lord Spookyraven's spectacles
[114-171] Haunted Ballroom
     +> [116] Got dance card
     => Level 7 (Turn 117)! (25/26/40)
     +> [130] Got dance card
     +> [138] Got dance card
     +> [139] Got dance card
     +> [140] Got dance card
     +> [151] Got dance card
     +> [158] Got dance card
     => Level 8 (Turn 159)! (30/31/53)
     +> [167] Got dance card
     #> Turn [170] pulled 1 not-a-pipe
     #> Turn [170] pulled 2 Breathetastic? Premium Canned Air
        12 adventures gained
        20 adventures gained
        21 adventures gained
     #> Turn [171] pulled 1 cherry bomb
     #> Turn [171] pulled 1 monster bait
     o> Drank 1 cherry bomb
        29 adventures gained
     #> Turn [171] pulled 1 hockey stick of furious angry rage
[172-181] Defiled Nook
     +> [172] Got loose teeth
     +> [173] Got skeleton bone
     +> [174] Got loose teeth, skeleton bone
     +> [175] Got skeleton bone, smart skull
     +> [176] Got smart skull
     +> [177] Got skeleton bone, smart skull
     +> [178] Got loose teeth, skeleton bone
     +> [179] Got skeleton bone
     +> [180] Got skeleton bone, smart skull
     +> [181] Got skeleton bone, skeleton bone, skeleton bone
[182-187] Defiled Niche
[188] Knob Goblin Kitchens
[189-193] Defiled Niche
[194-205] Defiled Cranny
     => Level 9 (Turn 198)! (41/42/68)
[206-218] Defiled Alcove
     +> [206] Got rusty grave robbing shovel
     +> [218] Got loose teeth
[219] Haert of the Cyrpt
     +> [219] Got skull of the Bonerdagon, chest of the Bonerdagon, vertebra of the Bonerdagon
[220-226] Dark Neck of the Woods
[227] Guano Junction
[229-233] Boss Bat's Lair
     +> [233] Got Boss Bat bandana
[234] Beanbat Chamber
     +> [234] Got enchanted bean
[235-258] Fantasy Airship
     +> [238] Got metallic A
     +> [243] Got Tissue Paper Immateria
     +> [245] Got Tin Foil Immateria
     +> [249] Got Gauze Immateria
     +> [252] Got Plastic Wrap Immateria
     +> [258] Got S.O.C.K.
[259-275] Giant's Castle
     +> [259] Got plot hole
     +> [260] Got plot hole
     +> [261] Got awful poetry journal
     +> [262] Got furry fur
     +> [263] Got giant needle
     +> [268] Got heavy D, original G
     +> [271] Got giant needle
     +> [273] Got plot hole
     +> [274] Got plot hole
     #> Turn [275] pulled 1 Spooky-Gro fertilizer
[276-292] Hole in the Sky
     +> [280] Got star chart
     +> [288] Got star chart
     => Level 10 (Turn 289)! (53/53/85)
     #> Turn [291] pulled 3 Breathetastic? Premium Canned Air
        23 adventures gained
        24 adventures gained
        25 adventures gained
[293] Rogue Windmill
[294-296] Hole in the Sky
[297] Mouldering Mansion
[298] Hole in the Sky
     +> [298] Got star chart
[299-300] Greater-Than Sign
[301] Stately Pleasure Dome
[302-309] Haunted Ballroom
     +> [305] Got dance card
[310-321] Moxie Vacation
[322-326] Black Forest
     +> [322] Got adder bladder, sunken eyes
     +> [326] Got Black No. 2, broken wings
[327] Moxie Vacation
     #> Turn [327] pulled 1 filthy corduroys, 1 filthy knitted dread sack
[330-341] Pirate Cove
     +> [330] Got bottle of rum, eyepatch
     +> [331] Got acoustic guitarrr
     +> [336] Got stuffed shoulder parrot
     +> [337] Got swashbuckling pants
     +> [339] Got bottle of rum
[342-354] Palindome
     +> [349] Got bottle of gin
     +> [351] Got stunt nuts
[355-358] Knob Goblin Laboratory
     o> Drank 1 Neuromancer
        22 adventures gained
     o> Drank 1 mandarina colada
        20 adventures gained
     o> Drank 1 mandarina colada
        23 adventures gained
[359-376] Hidden Temple
[377-393] Whitey's Grove
     +> [377] Got bird rib
     +> [380] Got white picket fence
     +> [393] Got lion oil
[394] Knob Goblin Laboratory
     +> [394] Got Mega Gem
[395-402] Greater-Than Sign
     +> [402] Got plus sign
[403] Pirate Cove
[404-424] Pirate Cove In Disguise
     +> [419] Got skeleton bone
, skeleton bone, skeleton bone
     #> Turn [424] pulled 1 milk of magnesium
     o> Ate 1 Hell ramen
        29 adventures gained
     o> Ate 1 Hell ramen
        30 adventures gained
     o> Ate 1 fortune cookie
        2 adventures gained
     o> Ate 1 desiccated apricot
        4 adventures gained
     o> Ate 1 desiccated apricot
        5 adventures gained
     o> Ate 1 desiccated apricot
[425-428] Hidden City
     #> Turn [425] pulled 1 large box
     #> Turn [427] pulled 1 large box
     #> Turn [427] pulled 1 swirly potion
     #> Turn [427] pulled 1 effervescent potion
[429] White Citadel
     #> Turn [429] pulled 3 linoleum ore, 1 Knob Goblin harem pants, 1 Knob Goblin harem veil, 1 Knob Goblin perfume
     #> Turn [429] pulled 2 Boris's ring
[430] Typical Tavern
[431] King's Chamber
     #> Turn [431] pulled 6 goat cheese
     +> [431] Got Crown of the Goblin King
[432-454] Hidden City
     +> [434] Got pygmy blowgun
     => Level 11 (Turn 441)! (64/64/104)
     +> [449] Got pygmy pygment
[455] Palindome
[456-459] Desert (Unhydrated)
[460] Oasis in the Desert
[461] Desert (Ultrahydrated)
[462] Oasis in the Desert
     +> [462] Got stone rose
[463-465] Desert (Ultrahydrated)
[466] Oasis in the Desert
[467-469] Desert (Ultrahydrated)
[470-472] Oasis in the Desert
     +> [471] Got drum machine
[473-477] Desert (Ultrahydrated)
[478] Oasis in the Desert
[479] Desert (Ultrahydrated)
[480-482] Oasis in the Desert
     +> [480] Got worm-riding manual page 1
     +> [481] Got worm-riding manual page 2
     +> [482] Got worm-riding manual pages 3-15
[483] Desert (Ultrahydrated)
     +> [483] Got worm-riding hooks
[484-488] Haunted Ballroom
[489] The Upper Chamber
[490-492] Rogue Windmill
[493] The Upper Chamber
[494-495] Mouldering Mansion
[496-497] The Upper Chamber
     +> [497] Got carved wooden wheel
[498] Stately Pleasure Dome
[499] The Middle Chamber
[500-501] Rogue Windmill
[502-503] The Middle Chamber
[504] Mouldering Mansion
[506-507] The Middle Chamber
[508] Stately Pleasure Dome
[509] The Lower Chambers
[510-514] The Middle Chamber
     #> Turn [510] pulled 1 mariachi G-string
[515] Rogue Windmill
[516] Frat House
[517-518] Wartime Frat House (Hippy Disguise)
[519] Mouldering Mansion
     #> Turn [519] pulled 1 bejeweled pledge pin, 1 distressed denim pants
[520] Hippy Camp
[521-522] Wartime Hippy Camp (Frat Disguise)
[523] Stately Pleasure Dome
[524] Hippy Camp
[525] Wartime Hippy Camp (Frat Disguise)
     +> [525] Got molybdenum magnet
[526-536] Junkyard
     +> [526] Got molybdenum hammer
     +> [530] Got molybdenum crescent wrench
     +> [531] Got molybdenum pliers
     +> [536] Got molybdenum screwdriver
[537-542] Sonofa Beach
     +> [541] Got barrel of gunpowder
[543] Orc Chasm
     +> [543] Got 30669 scroll, 33398 scroll, 334 scroll, 334 scroll
[544-558] Sonofa Beach
     +> [546] Got barrel of gunpowder
     o> Drank 1 Mon Tiki
        20 adventures gained
     o> Drank 1 Mon Tiki
        19 adventures gained
     o> Drank 1 Mon Tiki
        21 adventures gained
     o> Drank 1 shot of nepenthe schnapps
        12 adventures gained
     +> [549] Got barrel of gunpowder
     +> [553] Got barrel of gunpowder
     +> [558] Got barrel of gunpowder
[559-562] Hatching Chamber
[563-565] Feeding Chamber
[566-567] Guards' Chamber
[568] Queen's Chamber
[569-579] Orc Chasm
     +> [571] Got 33398 scroll
     +> [572] Got 334 scroll
     +> [573] Got 334 scroll
     +> [576] Got 30669 scroll
     +> [577] Got 33398 scroll
     +> [578] Got lowercase N
[580-593] 8-Bit Realm
[594] Dark Neck of the Woods
     +> [594] Got ruby W
[595] Friar Ceremony Location
[595-607] Dungeons of Doom
     +> [595] Got large box
     +> [596] Got small box
     +> [598] Got large box
     +> [600] Got small box
     +> [603] Got large box
     +> [606] Got large box
     +> [607] Got dead mimic
[608-611] The Middle Chamber
[612-628] Battlefield (Frat Uniform)
     => Level 12 (Turn 614)! (78/78/125)
     #> Turn [620] pulled 1 Breathetastic? Premium Canned Air
        22 adventures gained
     #> Turn [628] pulled 1 Mick's IcyVapoHotness Inhaler
[629-646] Themthar Hills
     #> Turn [640] pulled 1 Breathetastic? Premium Canned Air
        20 adventures gained
[647-674] Battlefield (Frat Uniform)
     o> Ate 1 nutty organic salad
        13 adventures gained
     o> Ate 1 nutty organic salad
        12 adventures gained
[675-677] The Middle Chamber
[678] The Lower Chambers
[679-684] The Middle Chamber
[685-692] The Lower Chambers
        3 adventures gained
        2 adventures gained
     #> Turn [686] pulled 1 disassembled clover
[693] Haunted Ballroom
     o> Ate 1 cactus fruit
        7 adventures gained
     o> Ate 1 brain-meltingly-hot chicken wings
        3 adventures gained
     o> Ate 1 brain-meltingly-hot chicken wings
        2 adventures gained
     +> [693] Got marzipan skull
[694-701] Sorceress' Hedge Maze
[702] Sorceress Tower: Level 1
     #> Turn [702] pulled 1 powdered organs
     +> [702] Got black pepper
[703] Sorceress Tower: Level 2
[704-705] Sorceress Tower: Level 3
     #> Turn [704] pulled 1 fancy bath salts
     o> Ate 1 desiccated apricot
        3 adventures gained
     #> Turn [705] pulled 1 powdered organs, 1 bronzed locust
[706-707] Sorceress Tower: Level 4
     #> Turn [706] pulled 1 disease
[708] Sorceress Tower: Level 5
     o> Ate 1 escargotsicle
        4 adventures gained
     #> Turn [708] pulled 1 barbed-wire fence
[709-710] Sorceress Tower: Level 6
     #> Turn [709] pulled 1 stick of dynamite
     +> [710] Got lowercase N, original G
[711] Sorceress Tower: Door Puzzles
[711] Sorceress Tower: Shadow Fight
[712

As you can see there are a few weird things going on... for example, clearly I was L9 when consuming those airs, after turn 171, not on turn 198 or whatever like it claims.

But still awesome, thanks.

alacrity
AFH
Posts: 501
Joined: Sun May 27, 2007 6:55 am
Location: Santa Barbara, CA
Contact:

Post by alacrity » Tue Dec 18, 2007 3:41 am

DarthDud wrote:

Code: Select all

[1-10] Campground


Mmm sekrit Campground tech ...

User avatar
KujjieKujjieKoo
Spade Ninja
Posts: 2240
Joined: Mon Apr 30, 2007 8:50 pm
Location: !Chicago
Contact:

Post by KujjieKujjieKoo » Tue Dec 18, 2007 8:31 am

It looks like there might be some oddities around turns 425-430 as well. Two pulled large boxes, two pulled potions, then an adventure at White Citadel and the Typical Tavern. At turn 510 it shows a mariachi G-string being pulled. I don't see that as a tower monster, so it would seem to be a bug of some nature.

Adding not-a-pipes to the consumption print outs would be useful as well.
Image

DarthDud
Inscrutable Pi
Posts: 265
Joined: Fri Apr 06, 2007 12:41 am

Post by DarthDud » Tue Dec 18, 2007 12:13 pm

KujjieKujjieKoo wrote:It looks like there might be some oddities around turns 425-430 as well. Two pulled large boxes, two pulled potions, then an adventure at White Citadel and the Typical Tavern. At turn 510 it shows a mariachi G-string being pulled. I don't see that as a tower monster, so it would seem to be a bug of some nature.

Teleportitis sent me to the tavern, where I got drunk, ending day 2, and screwing up my consumption and whatnot.

I dunno about the white citadel part, I'd assume the same?

User avatar
QuantumNightmare
AFH
Posts: 1827
Joined: Mon Jan 29, 2007 10:28 pm
Location: Montreal

Post by QuantumNightmare » Tue Dec 18, 2007 1:02 pm

The leveling bug should be fixed. Results from non-choice noncombats were being eaten by the script; in an earlier update I included item drops from non-choice noncombats but forgot you could get stats from them instead.

Double-negatives are cool again.

DarthDud
Inscrutable Pi
Posts: 265
Joined: Fri Apr 06, 2007 12:41 am

Post by DarthDud » Tue Dec 18, 2007 6:33 pm

KujjieKujjieKoo wrote:At turn 510 it shows a mariachi G-string being pulled. I don't see that as a tower monster, so it would seem to be a bug of some nature.

The unadultered mafia log shows a turn 510 pull of a G-string also.

Either I was on crack or mafia itself screwed up. Probably the former, as it was a terrible run.

User avatar
QuantumNightmare
AFH
Posts: 1827
Joined: Mon Jan 29, 2007 10:28 pm
Location: Montreal

Post by QuantumNightmare » Tue Dec 18, 2007 9:11 pm

I've created a class of items that are only displayed the first X times they drop (X can be any number I choose). This should reduce spam in areas like the castle, while still displaying the first important drop of an item. If any critical drops are left out, or if any spammy drops are left in, report them here.

User avatar
QuantumNightmare
AFH
Posts: 1827
Joined: Mon Jan 29, 2007 10:28 pm
Location: Montreal

Post by QuantumNightmare » Fri Dec 21, 2007 5:36 pm

I've added a daycount display, if certain conditions are met. You must have the "Session log records your player's state on login" option checked on your mafia account, and you must drink at least one item during the day. The "state on login" displays your characters drunkeness level, and if that is less than it was when you logged out... rollover happened!

EDIT:Added -statgains option, which is not toggled by the -all command.When used, it will display the number of substats gained from each location inline with the name of the area and number of turns spent. This includes all substats gained by eating, drinking, using items, and adventuring.

VladimirPootin
AFH
Posts: 1236
Joined: Tue Mar 27, 2007 2:03 am
Location: Ad Absurdum

Post by VladimirPootin » Fri Dec 21, 2007 8:33 pm

open source software working for you!

i'm pretty proud i almost singlehandedly created a programmer here. i'm not really sure but i think you need a significantly higher understanding of perl beyond "while(<>) print;" to even modify this script.
[b]AFH: Now with more [i]new and improved[/i] moral ambiguity![/b]

Pwnage1337
Just Plain Old Pie
Posts: 12
Joined: Thu Jan 10, 2008 9:53 pm

Re: VladimirPootin's Mafia Log Parser v3.3.1: Bugspray

Post by Pwnage1337 » Thu Jan 10, 2008 9:57 pm

VladimirPootin wrote:3. You will be confronted with a bewildering series of unix program to download and install. You only care about one: the perl parser. It can be found under "Interpreters" - just check the box and hit next; cygwin will do its thing.


I'm having a little bit of trouble with this section. I could not find the perl parser. I've tried looking in every section, I've downloaded the complete contents of both Perl and Interpreters, yet I still cannot find it.

I've tried reinstalling cygwin and redownloading the unix programs from a different portal. No dice.

So... any advice? This looks like a really cool tool and I want to try it out.

TeKRunneR
Spy vs. Pie
Posts: 80
Joined: Tue Nov 27, 2007 4:35 pm

Post by TeKRunneR » Fri Jan 25, 2008 6:01 pm

Hey, thanks for this great tool. It's not perfect (I'm getting a lot of "Got" with no item name), but it's still very useful.

I think you may want to remove this bit from the original post :
if you have a mac with any OS X, you probably aren't using mafia

I suppose Mafia wasn't working too well on macs at that time, but now it is.

However to make the script work I had to convert its line endings to OS X format. A simple way to do that is to open the .pl file in Smultron (free text editor), click Text > Line endings > Unix - Mac OS X (LF) and save.

User avatar
QuantumNightmare
AFH
Posts: 1827
Joined: Mon Jan 29, 2007 10:28 pm
Location: Montreal

Post by QuantumNightmare » Fri Jan 25, 2008 6:39 pm

I thought I ironed out all the bugs such as the blank "got" lines in the most recent update. If you're still getting problems in the latest version, then send me a link to a zipped file of your ascension log and I'll check what went wrong.

As to line endings, that flew right over my head.

User avatar
QuantumNightmare
AFH
Posts: 1827
Joined: Mon Jan 29, 2007 10:28 pm
Location: Montreal

Post by QuantumNightmare » Thu Feb 14, 2008 1:05 pm

Bump. I've added a fix in an earlier version that let's you properly parse an incomplete log. This can come in handy for contest runs that are posted as they are played.

davidmac
Just Plain Old Pie
Posts: 4
Joined: Mon Feb 25, 2008 1:48 pm

Post by davidmac » Mon Feb 25, 2008 2:00 pm

QN, what platform are you testing your script on?
FYI, the command 'unlink cream.txt' deletes the file on disk. So you go through all that trouble to create the log
[open(OUTLOG, "> cream.txt"); print OUTLOG ...; unlink "cream.txt"]
and then the very last line of the script deletes the parsed results. Not exactly useful :-)

As for TeK's comment on line endings - there are two ANSI characters used for line endings - Carriage Return <CR> and Line Feed <LF>.
*nix uses <LF> to end a line. Windows uses <CR><LF>. Macs, prior to OS 9, used <CR>. This causes much confusion when code is ported from one system to another. It appears you use CR-LF, which is mostly ok, but some varieties of *nix will choke on it.

Also, I've written a basement log summarizer that you may want to include - is there a way for me to attach a textfile to this post?

-Davidmac

User avatar
QuantumNightmare
AFH
Posts: 1827
Joined: Mon Jan 29, 2007 10:28 pm
Location: Montreal

Post by QuantumNightmare » Mon Feb 25, 2008 7:09 pm

I'm windows based, and have little understanding of how to make code compatible on different systems. My knowledge of perl is very informal, a few chats with vlad and a couple internet articles. On that note, this parser was created by vlad, and he wrote all the framework. I haven't touched the whole "cream.txt" codes, since it falls under the catagory of "if it ain't broke, don't fix it" so far. But I've no idea what it's original use was for!

There are a couple ways to send text files, but I'll PM you my email address so you can send it there. I'll take a look at your stuff, and see how I can integrate it.

davidmac
Just Plain Old Pie
Posts: 4
Joined: Mon Feb 25, 2008 1:48 pm

Post by davidmac » Tue Feb 26, 2008 10:01 am

QuantumNightmare wrote:I haven't touched the whole "cream.txt" codes


Well, my initial tries, on linux, to use the log parser resulted in output to screen of the preamble, and then no further output. Nothing to file, nothing to screen. Commenting out the unlink statement results in a textfile with the parsed data - so I don't know why it was commented out to begin with.

Does this produce a file with cygwin, or just output to terminal?

User avatar
QuantumNightmare
AFH
Posts: 1827
Joined: Mon Jan 29, 2007 10:28 pm
Location: Montreal

Post by QuantumNightmare » Tue Feb 26, 2008 11:49 am

The parser produces a small output in cygwin, displaying a few lines of preamble as well as which session logs are being opened. The main parsed output is stored in a text file the script creates, of the form <user name><ascend date>.

davidmac
Just Plain Old Pie
Posts: 4
Joined: Mon Feb 25, 2008 1:48 pm

Post by davidmac » Tue Feb 26, 2008 1:28 pm

QuantumNightmare wrote:The parser produces a small output in cygwin, displaying a few lines of preamble as well as which session logs are being opened. The main parsed output is stored in a text file the script creates, of the form <user><ascend>.


Aha! That would explain some of the issues I've been seeing. If you don't ascend during the log (preferably at the very beginning), you don't get any output. Lines 939-941 close and reopen the output log with a new file name. Everything prior to finding the action of ascending is put into "cream.txt" and then deleted -- so the parser won't work if you don't have the very first part of the ascension documented in the logs.

User avatar
QuantumNightmare
AFH
Posts: 1827
Joined: Mon Jan 29, 2007 10:28 pm
Location: Montreal

Post by QuantumNightmare » Tue Feb 26, 2008 9:27 pm

Here's an open request: What sort of basement information would players like to see this logo parser display? I've got davidmac's basic framework to work, but I don't know what basement reports would be helpful here. Maybe a display whenever a test is failed?

User avatar
QuantumNightmare
AFH
Posts: 1827
Joined: Mon Jan 29, 2007 10:28 pm
Location: Montreal

Post by QuantumNightmare » Sat Mar 22, 2008 12:04 am

New version: Minor changes, and a turn/stat update is printed at the start of each day. Bigger news is i've added a new command: -mlbreakdown. What this does is print out a table that looks as follows:

Code: Select all

             Level: 0    1    2    3    4    5    6    7    8    9    10   11   12   total
Need to gain level: 0    10   39   105  231  441  759  1209 1815 2601 3591 4809 6279 21904
C.A.R.N.I.V.O.R.E.: 0    0    0    0    4    36   17   0    28   15   23   4    101  226.875
Wax Lips:           0    3    5    11   12   33   36   23   87   47   125  167  126  672
Grimacite Gown:     0    0    0    0    0    0    0    0    0    0    19   68   199  285
Hockey Stick:       0    0    0    0    0    0    0    0    0    0    19   83   289  390
Pilgrim Shield:     0    3    5    11   12   29   36   23   87   47   125  167  101  642
This table displays the amount of mainstat substats that you need to gain at each level to reach the next one, and the amount of mainstat gained by equipping various items per level. Only combat turns with the items equipped are included.

The table itself is taken from !jim's 2-day attempt, and shows the relative usefulness of various +stat pulls. So 10 substats are needed to go from level 1 to level 2, and 60% of those substats were provided by 2 turns spent with wax lips / pilgrim shield.

Known bug: only one of each item is tracked.

User avatar
Flolle
Fie the Pie
Posts: 848
Joined: Mon Apr 02, 2007 10:13 am

Post by Flolle » Mon Apr 07, 2008 5:47 pm

Due to me not feeling like continuing development for the foreseeable future, I pulled this tool from my webspace.
Last edited by Flolle on Sun Aug 17, 2008 7:40 pm, edited 1 time in total.

salien
Pie in the Sky
Posts: 115
Joined: Fri Jan 11, 2008 1:50 pm

Post by salien » Mon Apr 07, 2008 7:45 pm

I'm currently at work and so have no access to logs I could view with this, and I don't really know what information you're going to show (screenshots?), but I can tell just the idea of a tool to convert logs into charts makes me giddy with glee! Thanks for working on this and making it available!

I can also predict to you that my first request will be to make it able to read in multiple ascensions and track statistics across them, if it isn't able to do so already. :)

Edit: I... Hm. I must be doing something wrong; I thought from the above that the point of it was to open the pre-parsed files produced by Vlad/QN's tool, but it just refused to open those files at all, no errors or anything. Then I tried raw mafia logs, and those it would open, but the only chart with any data is the "Turnrundown gantt chart"; the others all say either no data available or, in the case of semirares and pulls, are just blank. I'm using Java 6 update 4, and the logs are from Mafia r6021.

Edit the second: QN, any chance that ML item breakdown could have the scarf added?

User avatar
Flolle
Fie the Pie
Posts: 848
Joined: Mon Apr 02, 2007 10:13 am

Post by Flolle » Tue Apr 08, 2008 4:47 pm

massage no longer serving a purpose
Last edited by Flolle on Sun Aug 17, 2008 7:41 pm, edited 1 time in total.

salien
Pie in the Sky
Posts: 115
Joined: Fri Jan 11, 2008 1:50 pm

Post by salien » Wed Apr 09, 2008 11:44 am

Flolle wrote:I made a few with the build-in screenshot taker from the chart library I'm using.

Oooh, those are enticing. :)

Flolle wrote:You understood correctly, the Log Visualizer is meant for pre-parsed logs. Sounds like your logs somehow break the parser (as in the parser inside my program, not the mafia log parser). Could you send me one of those logs so I can figure out why that happens? Hopefully no sekrits inside the log so as to make sending me it not a problem. But even if there are sekrits, I'll promise you that I'll only fix what's breaking the parsing and delete the log directly afterwards. :)


Nothing really sekrit, just some embarassing blunders. :) Can you PM me an email address to send them to? I could just post them here and might anyway, but I was going to include the raw logs as well in case the root cause was somewhere in there.

Puttan Esca
Just Plain Old Pie
Posts: 6
Joined: Thu May 08, 2008 7:53 am

Post by Puttan Esca » Sat May 10, 2008 1:59 am

I have been getting some weird things popping up in the output of the log parser recently. It doesnt seem to know what level I am. For example:

Code: Select all

[317-360] Haunted Ballroom
     *> [321] Started hunting zombie waltzers
     +> [321] Got dance card
     +> [323] Got dance card
     +> [324] Got dance card
     +> [331] Got dance card
     +> [335] Got dance card
     +> [336] Got dance card
     o> Used 1 Breathetastic? Premium Canned Air  (21 adventures gained)
     o> Used 1 Breathetastic? Premium Canned Air  (22 adventures gained)
     o> Used 1 Breathetastic? Premium Canned Air  (24 adventures gained)
     => Level 2 (Turn 346)! (24/23/47)
     => Level 3 (Turn 346)! (24/23/47)
     => Level 4 (Turn 346)! (24/23/47)
     => Level 5 (Turn 347)! (24/23/47)
     => Level 6 (Turn 347)! (24/23/47)
     => Level 7 (Turn 347)! (24/23/47)
     +> [349] Got dance card
     => Level 8 (Turn 354)! (24/24/53)
     +> [355] Got dance card
     +> [358] Got dance card

and

Code: Select all


===Day 2===
Level 10 (57/52/95)
66 turns banked, Meat: 16789
[620-622] Belowdecks
     o> Drank 1 mandarina colada  (22 adventures gained)
     o> Drank 1 mandarina colada  (23 adventures gained)
[623-640] Haunted Ballroom
     +> [627] Got dance card
     +> [636] Got dance card
[641-642] Spooky Forest
     +> [642] Got Spooky-Gro fertilizer
[643-654] Greater-Than Sign
[655-657] Daily Dungeon
[658] Outskirts of The Knob
     +> [658] Got Knob Goblin lunchbox
[659-663] Desert (Unhydrated)
[664-675] Hidden Temple
     o> Used 1 twinkly wad  (1 adventures gained)
[676-699] Hidden City
     o> Used 1 twinkly wad  (1 adventures gained)
     +> [686] Got pygmy pygment
     *> [688] Started hunting pygmy blowgunner
     +> [689] Got pygmy blowgun
     +> [690] Got pygmy blowgun
     +> [693] Got pygmy blowgun
     +> [694] Got pygmy blowgun
     o> Used 1 twinkly wad  (1 adventures gained)
[700-704] Haunted Wine Cellar
[705-720] Palindome
     => Level 11 (Turn 706)! (62/58/104)
     +> [706] Got stunt nuts
     +> [707] Got hard rock candy
     +> [709] Got hard-boiled ostrich egg
     +> [710] Got bottle of gin
     +> [712] Got photograph of God
     *> [715] Started hunting Bob Racecar
     +> [715] Got ketchup hound
     +> [716] Got ketchup hound
     +> [719] Got ketchup hound
     o> Drank 1 Neuromancer  (17 adventures gained)
     o> Drank 1 vodka stratocaster  (18 adventures gained)
     o> Drank 1 thermos full of Knob coffee  (9 adventures gained)
     o> Drank 1 thermos full of Knob coffee  (11 adventures gained)
     o> Drank 1 shot of blackberry schnapps  (4 adventures gained)
     +> [720] Got bottle of gin


Any idea what could be causing this?

User avatar
QuantumNightmare
AFH
Posts: 1827
Joined: Mon Jan 29, 2007 10:28 pm
Location: Montreal

Post by QuantumNightmare » Sat May 10, 2008 4:31 pm

That was a mafia change. In order to tell what level you are, the script needs to know what class you are (and hence your mainstat). A mafia change meant that the usual method of determining your class upon ascension broke, but I had coded a few backups within the script that kick in when you visit a guild store before level 9, or when you log in. So in the first log, the script only realized what class you were on turn 346, and so started adding levels. I updated the script, it should be able to tell what class you are upon ascension now.

As to the second log, that looks like a miscount of your base stats. Are the base stats at the start of day 2 correct? If not, I can change the script to update your base stats every time you log on. It won't completely eliminate this problem, but it will reduce it.

Puttan Esca
Just Plain Old Pie
Posts: 6
Joined: Thu May 08, 2008 7:53 am

Post by Puttan Esca » Sat May 10, 2008 6:10 pm

I had already started the level 11 quest so I was at least 104 moxie, probably more.

User avatar
QuantumNightmare
AFH
Posts: 1827
Joined: Mon Jan 29, 2007 10:28 pm
Location: Montreal

Post by QuantumNightmare » Sat May 10, 2008 7:26 pm

Another quick update. The script attempts to read in your stat/substat information every time you login, and uses this to refresh it's internal stat counter.

Let me know if the problem is still there.

Pwnage1337
Just Plain Old Pie
Posts: 12
Joined: Thu Jan 10, 2008 9:53 pm

Post by Pwnage1337 » Sat May 17, 2008 5:17 pm

I had been using the Log Parser fine up to a couple of days ago. But, I recently fired up cygwin again and typed in my normal code:

Code: Select all

cd c:
cd Way to get to sessions folder
./mafialogparser.pl -all-drops bhushan305

unix2dos *ascend*.txt


It seemed to work fine. But when I opened up the text file, the only thing that was there was where I adventured, no drops, level gains, special adventures, or anything. I have some of my old ascensions up on another forum and they had worked fine prior to this.

Example of Log Working Properly (Done a few weeks ago. I haven't changed anything since: http://hurtsclan.21.forumer.com/viewtopic.php?t=230
Example of Log Failing (Done Today): http://hurtsclan.21.forumer.com/viewtopic.php?t=234

User avatar
Pet Rock Steve
Pie in the Sky
Posts: 111
Joined: Thu Apr 03, 2008 5:00 pm

Re: VladimirPootin's Mafia Log Parser v4.2: Pathed Daycounts

Post by Pet Rock Steve » Sat May 17, 2008 5:18 pm

VladimirPootin wrote:If you have spaces in your username, tough nuts. No, actually it should be OK, just put double quotes around your name (have not been able to test this though - if you do it and it works, let me know).


Typing pet_rock_steve worked, while "pet rock steve" did not. As mafia stores it as pet_rock_steve, I don't have a problem with it.

-----

On a side note, I am not seeing the day counts after day 1.

User avatar
QuantumNightmare
AFH
Posts: 1827
Joined: Mon Jan 29, 2007 10:28 pm
Location: Montreal

Post by QuantumNightmare » Sat May 17, 2008 6:25 pm

In order for the daycount to work properly, you need to go to your mafia preferences. Open the "session log" tab, and make sure that "session log records player state on login" is selected. This makes mafia record the KoL date and your drunkenness level every time you log in, and is used for determining daycount.

As well, the code is

Code: Select all

./mafialogparser.pl -all -drops bhushan305 
If there's no space between -all-drops, then the script will fail and just print the barebones log. As well, I'd recommend not typing in -drops. Instead, type the following:

Code: Select all

./mafialogparser.pl -all bhushan305 
This will post only the important drops, and even then only the first time than certain critical-yet-common drops appear. Say no to log-spam!

Pwnage1337
Just Plain Old Pie
Posts: 12
Joined: Thu Jan 10, 2008 9:53 pm

Post by Pwnage1337 » Sun May 18, 2008 9:12 am

So it was just me being completely stupid? Thanks for your help.

Puttan Esca
Just Plain Old Pie
Posts: 6
Joined: Thu May 08, 2008 7:53 am

Post by Puttan Esca » Wed May 21, 2008 10:36 pm

I think the level and stats are better than they were but I am having another problem in that the parser is not seeing any of my ascensions after 20080507.
Mafia's preferences were reset at some stage and so it wasnt logging correctly for a while, but now that I have all the logging options set the parser still doesn't recognize any more runs...
Is there some text I can insert into the mafia logs to get the parser to process some of the asensions?

Edit: After getting someone else to parse my logs I thought there might be something wrong with the perl package installed with cgywin, so I tried activeperl but that didnt work either. Then I noticed that mafia had a different idea of what my name capitalization was and was saving logs with this different name and that was the reason no logs after 20080507 were being read.

Also it does seem to being reporting the level/stats at start of day more or less correctly and reporting level-ups at about the right time.
On one ascension I did nothing on day1, on day2 the log started with: "Level 1 (0/0/0)" Maybe the starting substats should be added or is that related to the script not knowing what class the player is?

Blah35
Pie in the Sky
Posts: 127
Joined: Tue Jul 31, 2007 3:53 am

Post by Blah35 » Tue May 27, 2008 12:33 am

So I can't get this to work i've made the directory
and I get to the line ./ kolmaifa.pl [-OPTIONS] blah35 (this is the script)
and all I get is bash ./: is a directory what am I doing wrong?

Puttan Esca
Just Plain Old Pie
Posts: 6
Joined: Thu May 08, 2008 7:53 am

Post by Puttan Esca » Tue May 27, 2008 1:07 am

Blah35 wrote:So I can't get this to work i've made the directory
and I get to the line ./ kolmaifa.pl [-OPTIONS] blah35 (this is the script)
and all I get is bash ./: is a directory what am I doing wrong?


You put in a space between the path and filename.
Look 3 posts above you post for an example command line.

Blah35
Pie in the Sky
Posts: 127
Joined: Tue Jul 31, 2007 3:53 am

Post by Blah35 » Wed May 28, 2008 3:41 am

so I still can't get this working

my code line goes
cd c:
cd cygwin
cd sessions
./kolmafiapaser.pl -all blah35

and I get the this is not a directiory message have I downloaded the wrong file or the wrong parser?

User avatar
deusnoctum
Statistically likely to return
Posts: 820
Joined: Wed May 07, 2008 4:00 pm

Post by deusnoctum » Wed May 28, 2008 4:01 am

Blah35 wrote:so I still can't get this working

my code line goes
cd c:
cd cygwin
cd sessions
./kolmafiapaser.pl -all blah35

and I get the this is not a directiory message have I downloaded the wrong file or the wrong parser?


First off, are you sure you're spelling it correctly and giving the correct name? By default, it's called mafiaLogParser.pl, and names are case sensitive. For the last line, try typing the first few characters of the command, then hitting the tab key (e.g., ./mafia then tab). If the file is there, it should complete the name for you. (You'll still need to add -all blah35 yourself.)

Also, it might not be calling perl correctly for some reason or another. Try replacing the last line with perl ./mafiaLogParser.pl -all blah35 (the aforementioned tab trick should still work on the second word.)
Last edited by deusnoctum on Wed May 28, 2008 4:04 am, edited 1 time in total.

Seal Lubber
AFH
Posts: 318
Joined: Fri Sep 21, 2007 12:27 am

Post by Seal Lubber » Wed May 28, 2008 4:01 am

Blah35 wrote:my code line goes
cd c:
cd cygwin
cd sessions
./kolmafiapaser.pl -all blah35

That would work if:
- cygwin is installed at c:\cygwin;
- you have moved the sessions folder from mafia into the cygwin folder;
- the script is called "kolmafiapaser.pl" and is in the sessions folder, and;
- you haven't included any typos in the command, as you have in your last two posts :wink:

I think you're probably just not navigating to the right place to run the script. I put the script into the original sessions folder in mafia, so I would go:

Code: Select all

cd c:
cd games/km/12.4/sessions
./kolmafiaparser.pl -all seal_lubber
If you type "dir" and don't get a long list of your logs, you're in the wrong place.

EDIT: Huh, MS-DOS used "" but Cygwin uses "/" for directories. I could never remember which one to use in the first place, so this isn't any different I suppose.

Blah35
Pie in the Sky
Posts: 127
Joined: Tue Jul 31, 2007 3:53 am

Post by Blah35 » Thu May 29, 2008 12:25 am

yes its in Cygwin yes it's in sessions and yes i spelt parser wrong

User avatar
deusnoctum
Statistically likely to return
Posts: 820
Joined: Wed May 07, 2008 4:00 pm

Post by deusnoctum » Thu May 29, 2008 1:14 am

Blah35 wrote:yes its in Cygwin yes it's in sessions and yes i spelt parser wrong


Er...does it work now? Did you try the stuff suggested in the two posts above yours? If you did but it still doesn't work, what didn't work?

User avatar
QuantumNightmare
AFH
Posts: 1827
Joined: Mon Jan 29, 2007 10:28 pm
Location: Montreal

Post by QuantumNightmare » Thu Jun 12, 2008 4:21 pm

Puttan Esca wrote:Is there some text I can insert into the mafia logs to get the parser to process some of the asensions?
Here's a quick method to hack in the start of an ascension: open your session log, and paste the following text:

Code: Select all

Ascension #
On the next line, write your new character class, with capitals at the start of every word. I haven't tried it, but looking at the source code that should work.

Also it does seem to being reporting the level/stats at start of day more or less correctly and reporting level-ups at about the right time.
On one ascension I did nothing on day1, on day2 the log started with: "Level 1 (0/0/0)" Maybe the starting substats should be added or is that related to the script not knowing what class the player is?
I'm still on vacation without access to perl, but this is a known issue. Before I left I did some major modifications to the script to make the script work with pathed runs and didn't have time to fix some smaller bugs that appeared. If you log in but don't play adventures, the script will print some junk. And substats are updated every time you log in, but your stats/level are not recalculated based on your substat values until you gain stats. I'll fix these issues in ~3 weeks, when I get back home.

VladimirPootin
AFH
Posts: 1236
Joined: Tue Mar 27, 2007 2:03 am
Location: Ad Absurdum

Post by VladimirPootin » Fri Jun 27, 2008 8:59 pm

i haven't been following this thread but i was just on the HCO forums for a second and it appears QN and I have written what is by now the standard log parser.

that's fucking awesome.

edit: and in so doing, Josh learned a marketable skill!

edit 2: it's also sweet that you guys are basically doing support for this.

edit 3: it's triply sweet that the usernames "QuantumNightmare" and "VladimirPootin" are in every ascension log on every clan forum in the galaxy. it seems i can die a happy man knowing that i have achieved my One True Purpose: KoL in-game fame, aka e-penis.
[b]AFH: Now with more [i]new and improved[/i] moral ambiguity![/b]

zomg
Spy vs. Pie
Posts: 98
Joined: Sat Jul 05, 2008 11:39 pm
Location: Bottom o' the boards.

Post by zomg » Wed Jul 09, 2008 3:36 pm

Well, I haven't actually logged a run with theis yet, but except for a few user-related fuckups (like, oh, forgetting to actually download the parser), it works great.

Big thanks to QN for putting up with my dumbassery >.>

egotrippen
Just Plain Old Pie
Posts: 1
Joined: Sun Jul 20, 2008 10:05 am

Post by egotrippen » Sun Jul 20, 2008 10:11 am

This looks great, but I'm having trouble getting it to work.

On OS X 10.5, I get this output in the terminal:

Code: Select all

$ perl mafialogparser.pl -all egotrippen
   Option -all
Username: egotrippen
Opening egotrippen_20080516.txt... Date of Log: 20080516
Opening egotrippen_20080518.txt... Date of Log: 20080518
Opening egotrippen_20080519.txt... Date of Log: 20080519
Opening egotrippen_20080520.txt... Date of Log: 20080520
Opening egotrippen_20080521.txt... Date of Log: 20080521
Opening egotrippen_20080522.txt... Date of Log: 20080522
Opening egotrippen_20080523.txt... Date of Log: 20080523
Opening egotrippen_20080524.txt... Date of Log: 20080524
Opening egotrippen_20080525.txt... Date of Log: 20080525
Opening egotrippen_20080526.txt... Date of Log: 20080526
Opening egotrippen_20080527.txt... Date of Log: 20080527
Opening egotrippen_20080528.txt... Date of Log: 20080528
Opening egotrippen_20080529.txt... Date of Log: 20080529
Opening egotrippen_20080530.txt... Date of Log: 20080530
Opening egotrippen_20080531.txt... Date of Log: 20080531
Opening egotrippen_20080601.txt... Date of Log: 20080601
Opening egotrippen_20080602.txt... Date of Log: 20080602
Opening egotrippen_20080603.txt... Date of Log: 20080603
Opening egotrippen_20080604.txt... Date of Log: 20080604
Opening egotrippen_20080605.txt... Date of Log: 20080605
Opening egotrippen_20080606.txt... Date of Log: 20080606
Opening egotrippen_20080607.txt... Date of Log: 20080607
Opening egotrippen_20080608.txt... Date of Log: 20080608
Opening egotrippen_20080609.txt... Date of Log: 20080609
Opening egotrippen_20080610.txt... Date of Log: 20080610
Opening egotrippen_20080611.txt... Date of Log: 20080611
Opening egotrippen_20080612.txt... Date of Log: 20080612
Opening egotrippen_20080613.txt... Date of Log: 20080613
Opening egotrippen_20080614.txt... Date of Log: 20080614
Opening egotrippen_20080615.txt... Date of Log: 20080615
Opening egotrippen_20080616.txt... Date of Log: 20080616
Opening egotrippen_20080617.txt... Date of Log: 20080617
Opening egotrippen_20080618.txt... Date of Log: 20080618
Opening egotrippen_20080619.txt... Date of Log: 20080619
Opening egotrippen_20080620.txt... Date of Log: 20080620
Opening egotrippen_20080621.txt... Date of Log: 20080621
Opening egotrippen_20080622.txt... Date of Log: 20080622
Opening egotrippen_20080623.txt... Date of Log: 20080623
Opening egotrippen_20080624.txt... Date of Log: 20080624
Opening egotrippen_20080625.txt... Date of Log: 20080625
Opening egotrippen_20080626.txt... Date of Log: 20080626
Opening egotrippen_20080627.txt... Date of Log: 20080627
Opening egotrippen_20080628.txt... Date of Log: 20080628
Opening egotrippen_20080629.txt... Date of Log: 20080629
Opening egotrippen_20080630.txt... Date of Log: 20080630
Opening egotrippen_20080701.txt... Date of Log: 20080701
Opening egotrippen_20080702.txt... Date of Log: 20080702
Opening egotrippen_20080703.txt... Date of Log: 20080703
Opening egotrippen_20080704.txt... Date of Log: 20080704
Opening egotrippen_20080705.txt... Date of Log: 20080705
Opening egotrippen_20080706.txt... Date of Log: 20080706
Opening egotrippen_20080707.txt... Date of Log: 20080707
Opening egotrippen_20080708.txt... Date of Log: 20080708
Opening egotrippen_20080709.txt... Date of Log: 20080709
Opening egotrippen_20080710.txt... Date of Log: 20080710
Opening egotrippen_20080711.txt... Date of Log: 20080711
Opening egotrippen_20080712.txt... Date of Log: 20080712
Opening egotrippen_20080713.txt... Date of Log: 20080713
Opening egotrippen_20080714.txt... Date of Log: 20080714
Opening egotrippen_20080715.txt... Date of Log: 20080715
Opening egotrippen_20080716.txt... Date of Log: 20080716
Opening egotrippen_20080717.txt... Date of Log: 20080717
Opening egotrippen_20080718.txt... Date of Log: 20080718
Opening egotrippen_20080719.txt... Date of Log: 20080719
Opening egotrippen_20080720.txt... Date of Log: 20080720



MafiaLog Parser v4.2 (c)Alliance From Hell


http://alliancefromhell.com/forum/viewtopic.php?t=125

Kmail issues and comments to QuantumNightmare
Script originally coded by VladimirPootin, First Among Comrades of the Excellency of the Soviet Republics
Thanks to the debuguinea pigs, darthdud, snarles2.

You owe Alliance From Hell 949990 meat for this service.
Collection officers will stop by shortly.  Have a nice day.

Feel free to change this, just give credit and please let me know about your improvements/modifications.
Really.


No parsed file is created. I was able to look at cream.txt by commenting out the 'unlink' line, but it looks like that doesn't have all the information the complete file would. There's no ascension in the first log, but I tried removing them all until a log with a new ascension, and then I tried editing that log so the new ascension was at the beginning, with not effect (I've restored it to how it was originally). I tried putting 'Ascension #' and the class etc. on the first line of the first one, also with no effect.

Any ideas? I do have a windowx XP installation, but the windows partition is small and cygwin is big, i'd rather keep OSX native if possible.

User avatar
QuantumNightmare
AFH
Posts: 1827
Joined: Mon Jan 29, 2007 10:28 pm
Location: Montreal

Post by QuantumNightmare » Sun Jul 27, 2008 10:59 pm

This is where my complete lack of experience with macs hurts. I'm not sure what I can do to help - other players have managed to get this script to work with linux and macs, so I know if can be done. Would you mind emaling me a zipped version of your logs, to see if your logs can be parsed in a widows environment? Send me a PM, and I'll give you my email.

User avatar
Flolle
Fie the Pie
Posts: 848
Joined: Mon Apr 02, 2007 10:13 am

Post by Flolle » Fri Aug 01, 2008 6:00 pm

Due to me not feeling like continuing development for the foreseeable future, I pulled this tool from my webspace.
Last edited by Flolle on Sun Aug 17, 2008 7:42 pm, edited 1 time in total.

User avatar
QuantumNightmare
AFH
Posts: 1827
Joined: Mon Jan 29, 2007 10:28 pm
Location: Montreal

Post by QuantumNightmare » Fri Aug 01, 2008 10:35 pm

egotrippen wrote:No parsed file is created.
After running through your logs on my computer, they weren't producing an output either. I uploaded a new version of the script that should catch your ascensions, let me know if it broke anything for everyone else!

User avatar
KujjieKujjieKoo
Spade Ninja
Posts: 2240
Joined: Mon Apr 30, 2007 8:50 pm
Location: !Chicago
Contact:

Post by KujjieKujjieKoo » Mon Aug 11, 2008 12:32 pm

Latest version is not creating output files for me. Rolled back one version, and that compiled everything just fine.
Image

Xtiatla
Just Plain Old Pie
Posts: 1
Joined: Sat Aug 16, 2008 10:23 am

Post by Xtiatla » Sat Aug 16, 2008 10:58 am

Ok, I just started my first HC run the other day, and I wanted to start using this. I believe I've got most of it right. I'm getting the


Opening Xtiatla_********.txt... Date of log...

schpiel, along with the end text, and as said above, it's not creating the output file. Also I appear to not have gotten the unix2dos portion installed, and I'm not sure where to find that.

What version are we talking about rolling back to above to get this working?

Thanks for the help, and thank you for all your hard work with this. It's things like this that ultimately help people enjoy their time as much as possible (especially if that = maximizing to the extreme =D)




EDIT:

Alright, I believe I got the Cygwin problem fixed, but still not creating the output files.
Xtiatla (#1400404)

User avatar
QuantumNightmare
AFH
Posts: 1827
Joined: Mon Jan 29, 2007 10:28 pm
Location: Montreal

Post by QuantumNightmare » Sat Aug 16, 2008 1:15 pm

I attempted to fix the issue again. Let me know if it works.

User avatar
deusnoctum
Statistically likely to return
Posts: 820
Joined: Wed May 07, 2008 4:00 pm

Post by deusnoctum » Sat Aug 16, 2008 7:37 pm

I've been using this with no problem on Windows using ActivePerl. You will need to do two things:
-Make sure the Perl executable is in your PATH system variable (instructions included with AP)
-Change all instances of "chop" in the parser file to "chomp"

It works fine, without needing to muck about in Unix or pseudo-Unix. QN, if you want, I can write up a short tutorial to go along with/in place of the Cygwin instructions.

User avatar
deusnoctum
Statistically likely to return
Posts: 820
Joined: Wed May 07, 2008 4:00 pm

Post by deusnoctum » Mon Aug 18, 2008 10:53 pm

Since I got a request for a tutorial for ActivePerl, here goes. I'll assume you're reasonably familiar with Windows and the command line.

Installation:
-Install ActivePerl. You can get it here. I'll assume you use the default installation location of C:\perl, obviously, modify these instructions if you install it elsewhere.
-Add Perl to your path variable. Right-click My Computer, go to properties, and click the "Advanced" tab. At the bottom, click "Environmental variables." In the bottom pane ("System variables"), scroll down until you see the Path variable, and click edit. Scroll all the way to the right of the "variable" field, and type the following:
;C:\perl\bin
Make sure to include the leading semicolon to separate it from the previous entry.
-Open the log parser in a text editor, and do a find/replace, changing all instances of "chop" to "chomp".
-Drop the log parser in your KoLMafia sessions folder.

To run:
-Open a command window.
-cd to your kolmafia sessions directory.
-Run the parser with "perl mafialogparser.pl -all username". Flags and username are case-sensitive, "perl" and the parser's filename are not.

VladimirPootin
AFH
Posts: 1236
Joined: Tue Mar 27, 2007 2:03 am
Location: Ad Absurdum

Post by VladimirPootin » Thu Aug 28, 2008 1:03 am

unix2dos can be selected from the cygwin installer.

i find cygwin friendlier than active perl because special character escaping and tab complete are atrocious on the windows command line, plus i have all the expected unix tools. ymmv.

i'm taking a look to see what the issue might be with the output. there is a possibility that you have no write permission in the directory?

in the terminal go up one dir and do 'chmod 777 [nameofdir]' (that bit of arcane script tells the computer anyone can do anything to any file in that directory (read, write, execute)... sort of. the details are sort of horrifying so i will spare you all.
[b]AFH: Now with more [i]new and improved[/i] moral ambiguity![/b]

User avatar
lostcalpolydude
Forum Maestro
Posts: 2940
Joined: Wed Apr 23, 2008 6:54 pm

Post by lostcalpolydude » Thu Aug 28, 2008 1:27 am

VladimirPootin wrote:in the terminal go up one dir and do 'chmod 777 [nameofdir]' (that bit of arcane script tells the computer anyone can do anything to any file in that directory (read, write, execute)... sort of. the details are sort of horrifying so i will spare you all.


Why go up a directory when you can do 'chmod 777 .' instead, without worrying about the name of the directory?
bmaher: Softcore character
lostcalpolydude: Hardcore character (abandoned)

User avatar
QuantumNightmare
AFH
Posts: 1827
Joined: Mon Jan 29, 2007 10:28 pm
Location: Montreal

Post by QuantumNightmare » Thu Aug 28, 2008 1:29 am

The issue with the script not printing an output was simple: the script was looking for the string "beginning new ascension" in order to output anything, and the new versions of mafia seem to only display that test on half of ascensions. So I fixed it to look for a different string on line 309, but the string I chose to look for wasn't being shown on all ascensions either and so the script broke for Xtiatla. So I added a bit of regex magic to line 309 to hopefully catch all ascensions, which worked in his/her case... at least with the files they sent me to look at.

VladimirPootin
AFH
Posts: 1236
Joined: Tue Mar 27, 2007 2:03 am
Location: Ad Absurdum

Post by VladimirPootin » Thu Aug 28, 2008 3:21 am

lostcalpolydude wrote:
VladimirPootin wrote:in the terminal go up one dir and do 'chmod 777 [nameofdir]' (that bit of arcane script tells the computer anyone can do anything to any file in that directory (read, write, execute)... sort of. the details are sort of horrifying so i will spare you all.


Why go up a directory when you can do 'chmod 777 .' instead, without worrying about the name of the directory?


Image
[b]AFH: Now with more [i]new and improved[/i] moral ambiguity![/b]

poxy
Just Plain Old Pie
Posts: 1
Joined: Sun Sep 07, 2008 7:08 pm

How does this script ever work?

Post by poxy » Sun Sep 07, 2008 7:53 pm

I think I am using QN version 4.3 on Mac OS X

#4.3: Rewrite ascension recognition (again) ...

I notice that the script begins with (no error checking...no cookie for you!)

open(OUTLOG, "> cream.txt");

but on the last line there is

unlink "./cream.txt";

Which just deletes the file that was created. Perhaps this is an overlooked line that was inserted while debugging? Maybe it works differently under windows than Unix?

Oh, and in the instructions for MacOSX users, the three things that need to be done are

(1) move the script to

~/Library/Application Support/KoLmafia/sessions/

(2) make the script executable

chmod a+x mafialLogPaser.pl

and (3) convert the line endings to unix

perl -pi.bak -e "s/\015\012?/\012/g" mafialLogPaser.pl

Post Reply