Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate

Lotro - Combat Log Analyzer


  • Please log in to reply
9 replies to this topic
Brainfart
  • Guests
  • Last active:
  • Joined: --
Hello Guys I have picked up the Game Lord Of the Rings Online and am going to attempt to make a 'recount' type Log Analyzer with Autohotkey at least for a post fight self analysis, the logs look like this: Names omitted and replaced with Enemy and Yourchar

Enemy scored a hit with a minor melee attack on Yourchar for 80 Common damage to Morale.
Yourchar scored a hit with Light of the Rising Dawn on the Enemy for 342 Light damage to Morale.

What I need help with is loop fileread to grab lines with "Yourchar scored" and out put the just the numbers to a seperate file - Its escaping me on how to do this.

Ive been thru the help files and I think im just getting old and stupid :D

Brainfart
  • Guests
  • Last active:
  • Joined: --
Hey Just updating as I has this out, will drop what Ive got so far.

FileSelectFile, SourceFile, 3,, Pick a Combat file to analyze.
if SourceFile =
    return  

SplitPath, SourceFile,, SourceFilePath,, SourceFileNoExt
DestFile = %SourceFilePath%\%SourceFileNoExt% acl.txt

IfExist, %DestFile%
{
    MsgBox, 4,, Overwrite the existing file? Press No to append to it.`n`nFILE: %DestFile%
    IfMsgBox, Yes
        FileDelete, %DestFile%
}

Loop, read, %SourceFile%
{
    IfInString, A_LoopReadLine, Yourchar  scored, FileAppend, %A_LoopReadLine%`n, %DestFile%
}
return


this is working so far, I replace "Yourchar" with my ingame name and it spits out a new file with only my chars hits to Enemys.


Things im still working on - further parsing to get all numbers from each line, adding Yourchar as a Variable so you can search for pets or see whats hitting you.

Brainfart
  • Guests
  • Last active:
  • Joined: --
Im stuck on getting just the numbers out of each line in the output.txt ; I've poored thru the help files again and again and have searched the forums but everything I seem to come across is complicating my mind - This might be really simple for someone to look at and solve. All I want now is the Numbers out of each line in the log and nothing else.

Ive tried and failed to understand regex and do not know how or where to fit isnum into this.

HotKeyIt
  • Moderators
  • 7439 posts
  • Last active: Jun 22 2016 09:14 PM
  • Joined: 18 Jun 2008
:?:
FileSelectFile, SourceFile, 3,, Pick a Combat file to analyze.

if SourceFile =

    return  



SplitPath, SourceFile,, SourceFilePath,, SourceFileNoExt

DestFile = %SourceFilePath%\%SourceFileNoExt% acl.txt



IfExist, %DestFile%

{

    MsgBox, 4,, Overwrite the existing file? Press No to append to it.`n`nFILE: %DestFile%

    IfMsgBox, Yes

        FileDelete, %DestFile%

}



Loop, read, %SourceFile%

    If RegexMatch(A_LoopReadLine,"Yourchar\sscored.*?(\d+)",match)

		text.=match1

;~ FileAppend,% text, % DestFile

MsgBox % text

return


Brainfart
  • Guests
  • Last active:
  • Joined: --
Hi thanks Ive tried this but its no ouput either to file or message box.

I'll drop a larger combat log in here so you can work with it if your up to it. So far the first scrip I have will weed out Yourchar or Yourpet - then it drops each of those lines into a new file. From that new file I then want to strip just the numbers out

i.e Yourchar scored a hit with Burning Embers on the Tarkrîp Raider for 233 Fire damage to Morale.

would just be 233, on a new line in a new text so that that file can be summed and divided by log time ( cheap ass recount dps )

### Chat Log: Combat 05/23 02:32 PM ###
You order your companion to attack.
Yourchar scored a hit with Burning Embers on the Tarkrîp Raider for 233 Fire damage to Morale.
Yourpet scored a devastating hit with Surprise Attack on the Tarkrîp Raider for 968 Common damage to Morale.
Yourpet defeated the Tarkrîp Raider.
Hardilot defeated the Tarkrîp Raider.
Yourchar scored a hit with Burning Embers on the Tarkrîp Picket for 276 Fire damage to Morale.
Your mighty blow defeated the Tarkrîp Picket.
Yourchar scored a hit with Light of the Rising Dawn on the Tarkrîp Picket for 349 Light damage to Morale.
Yourchar scored a hit with Improved Blinding Flash on the Wandering Cruel-beak.
Hardilot defeated the Tarkrîp Picket.
Yourchar scored a hit with Test of Will on the Wandering Cruel-beak for 198 Light damage to Morale.
Your mighty blow defeated the Wandering Cruel-beak.
You order your companion to attack.
Yourpet applied a benefit with Enter Stealthed State on Yourpet.
Yourchar scored a hit with Staff-sweep on the Tarkrîp Raider for 151 Ancient Dwarf-make damage to Morale.
Yourchar scored a devastating hit with Staff-sweep on the Tarkrîp Raider for 171 Ancient Dwarf-make damage to Morale.
Yourpet scored a hit with Surprise Attack on the Tarkrîp Raider for 357 Common damage to Morale.
Yourpet defeated the Tarkrîp Raider.
Yourchar scored a hit with a melee attack on the Tarkrîp Raider for 88 Ancient Dwarf-make damage to Morale.
Yourchar scored a hit with a melee attack on the Tarkrîp Raider for 50 Ancient Dwarf-make damage to Morale.
Your mighty blow defeated the Wandering Cruel-beak.
Yourchar scored a hit with Burning Embers on the Wandering Cruel-beak for 248 Fire damage to Morale.
Hardilot defeated the Tarkrîp Raider.
Yourpet applied a benefit with Enter Stealthed State on Yourpet.
Yourchar scored a hit with Light of the Rising Dawn on the Tarkrîp Raider for 386 Light damage to Morale.
Your companion failed to perform Surprise Attack.
Your mighty blow defeated the Tarkrîp Raider.
Yourchar scored a critical hit with Burning Embers on the Tarkrîp Raider for 585 Fire damage to Morale.
Yourchar scored a hit with Herb-lore on the Tarkrîp Raider.
Yourchar scored a hit with Ancient Craft on the Tarkrîp Raider.
The Tarkrîp Raider scored a hit with a weak melee attack on Yourchar for 42 Common damage to Morale.
Yourchar reflected 10 Common damage to the Morale of the Tarkrîp Raider.
The Tarkrîp Raider tried to use Primary Weapon: Disarmed on Yourchar but he resisted the attempt.
The Tarkrîp Raider scored a hit with Melee Disarm on Yourchar.
Your mighty blow defeated the Tarkrîp Raider.
Yourchar scored a devastating hit with Lightning-storm on the Tarkrîp Raider for 964 Lightning damage to Morale.
The Tarkrîp Raider scored a hit with a moderate melee attack on Yourchar for 48 Common damage to Morale.
Yourchar scored a hit with Lightning-storm on the Tarkrîp Raider for 308 Lightning damage to Morale.
Yourchar scored a hit with Lightning-storm on the Tarkrîp Raider for 352 Lightning damage to Morale.
The Tarkrîp Raider tried to use a weak melee attack on Yourchar but he evaded the attempt.
Yourchar scored a hit with Staff-sweep on the Tarkrîp Raider for 148 Ancient Dwarf-make damage to Morale.
Yourchar scored a hit with Staff-sweep on the Tarkrîp Raider for 102 Ancient Dwarf-make damage to Morale.
Yourpet defeated the Tarkrîp Raider.
Yourpet scored a hit with Surprise Attack on the Tarkrîp Raider for 365 Common damage to Morale.
Yourchar scored a hit with a melee attack on the Tarkrîp Raider for 98 Ancient Dwarf-make damage to Morale.
Yourchar scored a hit with a melee attack on the Tarkrîp Raider for 66 Ancient Dwarf-make damage to Morale.
Yourpet applied a benefit with Enter Stealthed State on Yourpet.


HotKeyIt
  • Moderators
  • 7439 posts
  • Last active: Jun 22 2016 09:14 PM
  • Joined: 18 Jun 2008
file=

(

### Chat Log: Combat 05/23 02:32 PM ###

You order your companion to attack.

Yourchar scored a hit with Burning Embers on the Tarkrîp Raider for 233 Fire damage to Morale.

Yourpet scored a devastating hit with Surprise Attack on the Tarkrîp Raider for 968 Common damage to Morale.

Yourpet defeated the Tarkrîp Raider.

Hardilot defeated the Tarkrîp Raider.

Yourchar scored a hit with Burning Embers on the Tarkrîp Picket for 276 Fire damage to Morale.

Your mighty blow defeated the Tarkrîp Picket.

Yourchar scored a hit with Light of the Rising Dawn on the Tarkrîp Picket for 349 Light damage to Morale.

...

)

;Instead above use FileRead,file,%SourceFile%

Loop, Parse, file,`n,`r

    If RegexMatch(A_LoopField,"Yourchar\sscored.*?(\d+)",match)

      text.=match1 "`n"

MsgBox % text

return



Brainfart
  • Guests
  • Last active:
  • Joined: --
Perfect - I kinda played with it a bit and come to this which is perfect its just pulling out the numbers for dmg per name and putting it to each file on a separate line /kiss

FileSelectFile, SourceFile, 3,, Pick a Combat file to analyze.
if SourceFile =
    return 

SplitPath, SourceFile,, SourceFilePath,, SourceFileNoExt
DestFile = %SourceFilePath%\%SourceFileNoExt% refined.txt


IfExist, %DestFile%
{
    MsgBox, 4,, Overwrite the existing file? Press No to append to it.`n`nFILE: %DestFile%
    IfMsgBox, Yes
        FileDelete, %DestFile%
}

Loop, read, %SourceFile%
    If RegexMatch(A_LoopReadLine,"Yourchar\sscored.*?(\d+)",match)
      text.=match1 "`n"
FileAppend,% text, % DestFile
MsgBox % text
return


  • Guests
  • Last active:
  • Joined: --
Ughh I feel real stupid today - maybe its all the beer, maybe its my age, maybe I just dont get it..


Im at the place now where this file gives me all the numbers from dmg out in a file and I cant figure out how to add each line together to get total dmg.

Ill leave you with a sample of the file and appriciate you helping.


The above code in this thread produces this file, I wish to have all these numbers totaled.



365
202
283
302
163
234
188
380
667
284
494
399
496
168
731
122
126
78
128
39
145
243
448
100
63
97
43
128
407
118
129
49
129
48
139
101
107
47
259
207
215
119
170
102
48
356
76
62
181
283
148
448
162
88
122
106
249
174
158
100
62
148
86
62
279
391
189
580
143
96
108
60
160
102
49
153
85
42
159
79
52
237
324
59
195
205
165
229
331
105
318
96
77
359
308
320
111
77
156
75
100
167
151
55
106
60
278


nimda
  • Members
  • 4368 posts
  • Last active: Aug 09 2015 02:36 AM
  • Joined: 26 Dec 2010
file =

(

1

1234

92

)

Loop, Parse, File, `n

   var += A_LoopField

MsgBox % var


Brainfart
  • Guests
  • Last active:
  • Joined: --
Ok - so I got it all put together and this is what I have.

Step 1:
Create aliases in game and bind them to [ & ] to turn on and off chat logging while on the combat tab. I turn it on when I start an encounter and off when I finish it dumps the encounter time out to a file. I have a master AHK script with a key to invoke this timer script:


DestFile = time.txt
IfExist, %DestFile%
{
        FileDelete, %DestFile%
}
~[::
StartTime := A_TickCount
return
~]::
ElapsedTime := (A_TickCount - StartTime)/1000
MsgBox,  Encounter was %ElapsedTime% seconds long. 
FileAppend,% ElapsedTime, % DestFile
exitapp

Step 2: I now have the Encounter duration in seconda and a log that I can refine to get the damage per name. At this points I have 2 one whith my user name where you see Yourchar in this script, and second one with my pets user name ( I dont know why but I cant put a var in the regex bracket ? ) this is all still very WIP

FileSelectFile, SourceFile, 3,, Pick a Combat file to analyze.
if SourceFile =
    return 
SplitPath, SourceFile,, SourceFilePath,, SourceFileNoExt
DestFile = refined.txt
IfExist, %DestFile%
{
        FileDelete, %DestFile%
}
Loop, read, %SourceFile%
    If RegexMatch(A_LoopReadLine,"Yourchar\sscored.*?(\d+)",match)
      text.=match1 "`n"
FileAppend,% text, % DestFile

Step3: This just ads everything together for Yourchar to get the total dmg which is used to divide by the time I got from my encounter timer.

destfile = dmg.txt
IfExist, %DestFile%
{
        FileDelete, %DestFile%
}
FileRead, sumdmg, %A_scriptdir%\refined.txt
if not ErrorLevel  ; Successfully loaded.
{
Loop, Parse, sumdmg, `n
   var += A_LoopField
msgbox, % var
FileAppend,% var, % DestFile
}


step 4: Finaly take that total dmg and divide it by the encounter time

DestFile = DPS.txt
IfExist, %DestFile%
{
        FileDelete, %DestFile%
}
FileRead, dps, %A_scriptdir%\time.txt
if not ErrorLevel  ;
FileRead, dmgc, %A_scriptdir%\dmg.txt
if not ErrorLevel  ;
ydps := dmgc / dps
msgbox, %ydps%
fileappend, % ydps, % Destfile



So I got myself a neat crude DPS tally - Thanks to all you guys for your Help so far - Im sure it could be streamlined possibly have a GUI and OSD - still needs a ton of work but like I said as I go ill just keep dropping the results in here.