Programming Visual Analytics and other reporting for a Draft league I am in

Hi Everyone!
I tried to get a response from reddit to no avail. I am in a Pokemon draft league and am also a data nerd. I am trying to either create or locate something to transcribe battle logs to usable data to make some infographics or interactive visuals for my draft league.

For example:

Code:
Lasagna Slice joined.
GAINZ4JESUS joined.
Format:
[Gen 7] OU
Baton Pass Clause: Limit one Baton Passer, can't pass Spe and other stats simultaneously
Sleep Clause Mod: Limit one foe put to sleep
Species Clause: Limit one of each Pokémon
OHKO Clause: OHKO moves are banned
Moody Clause: Moody is banned
Evasion Moves Clause: Evasion moves are banned
Endless Battle Clause: Forcing endless battles is banned
HP Percentage Mod: HP is shown in percentages
Lasagna Slice's team:
Dragonite / Victini / Scizor / Gyarados / Raikou / Celebi
GAINZ4JESUS's team:
Salamence / Kingdra / Serperior / Absol / Conkeldurr / Gardevoir
Not Shanksys joined.
Battle between Lasagna Slice and GAINZ4JESUS started!
Go! Victini!
GAINZ4JESUS sent out Salamence!
[Opposing Salamence's Intimidate!]
Victini's Attack fell!
Turn 1
Not Shanksys left.
The opposing Salamence used Dragon Dance!
The opposing Salamence's Attack rose! The opposing Salamence's Speed rose!
Victini used Substitute!
Victini put in a substitute!
Victini lost 24.9% of its health!
Turn 2
The opposing Salamence used Dragon Dance!
The opposing Salamence's Attack rose! The opposing Salamence's Speed rose!
Victini used Psyshock!
A critical hit! The opposing Salamence lost 62.5% of its health!
Turn 3
The opposing Salamence used Earthquake!
It's super effective! Victini's substitute faded!
Victini used Psyshock!
The opposing Salamence lost 36.3% of its health!
Turn 4
Victini, come back!
Go! Dragonite!
The opposing Salamence used Earthquake!
It doesn't affect Dragonite...
Turn 5
The opposing Salamence used Outrage!
It's super effective! Dragonite lost 100% of its health!
Dragonite fainted!
Go! Victini!
Turn 6
The opposing Salamence used Outrage!
Victini lost 75.1% of its health!
Victini fainted!
☆Lasagna Slice: welp im gettin swept
☆GAINZ4JESUS: HOLY SHIT LOL
Go! Gyarados!
Turn 7
☆GAINZ4JESUS: wasn't expecting that
The opposing Salamence used Outrage!
Gyarados lost 100% of its health!
The opposing Salamence became confused due to fatigue!
Gyarados fainted!
☆Lasagna Slice: dis be gg
Go! Celebi!
Turn 8
The opposing Salamence is confused!
The opposing Salamence used Outrage!
Celebi lost 100% of its health!
Celebi fainted!
Go! Raikou!
[Raikou's Pressure!]
Raikou is exerting its pressure!
Turn 9
The opposing Salamence is confused!
The opposing Salamence used Outrage!
Raikou lost 100% of its health!
Raikou fainted!
Go! Scizor!
Turn 10
The opposing Salamence snapped out of confusion!
The opposing Salamence used Outrage!
It's not very effective... Scizor lost 83.3% of its health!
The opposing Salamence became confused due to fatigue!
Scizor used Bug Buzz!
It's not very effective... The opposing Salamence lost 1.2% of its health!
The opposing Salamence fainted!
Scizor restored a little HP using its Leftovers!
GAINZ4JESUS sent out Absol!
[Opposing Absol's Pressure!]
The opposing Absol is exerting its pressure!
Turn 11
The opposing Absol's Absolite is reacting to the Key Stone!
The opposing Absol has Mega Evolved into Mega Absol!
The opposing Absol used Fire Blast!
It's super effective! Scizor lost 22.8% of its health!
Scizor fainted!
GAINZ4JESUS won the battle!
☆Lasagna Slice: that took
☆Lasagna Slice: a whole
☆Lasagna Slice: not even minute
☆GAINZ4JESUS: lmao salamence op
Alone, this is a fairly difficult text to read through an process. But maybe if we had a program read each line, we could have it isolate each group of words that are after each turn.

For example:

In comes the lines
Turn 1
We have (json object?) create a new object of turn one and have it populate with a Pokemon, move and effect. I could have a python or java script pharse the log into a json object like so:

Code:
{
"Turn : "1",
"Pokemonz1" : "Salamence",
"PokemonMove1" : {
    "MoveName" : "Dragon Dance",
    "Damage" : "Null",
    "Effect" : "Attack and Speed Rose 1 stage" }
}

It would then break the inflow, and start back up again on turn 2. Until you had which pokemon got oked, on whos side, and a number of other analytics.

If we had a number of those, we could put the data though tableau or something along those lines, and see how players are doing, what Pokemon they use the most, which player has the most valuable Pokemon. I feel like this could be a very good fun project that could be used by draft leagues everywhere. What are your thought? Does anyone know of any API's to pull data from the damage calculator or from smogon's pokemon database? I could have the names and moves link to what ever information is pulled on smogon along with typing and such. Also is anyone interested?
 

Scotteh

Memelord Extraordinaire
is a Battle Simulator Admin Alumnusis a Community Leader Alumnus
In terms of parsing the output, you shouldn't have much issue. In the actual battle room on PS, the protocol is written directly to the console. If you're looking at it via a replay, you should be able to find a script tag with a class of "log" in the page source. Inside that tag you'll find the same raw protocol, which is documented here.
 
Scotteh I found the battle log on the page source, which is super awesome. This will help a lot. The log for the above battle for anyone curious:

Code:
|j|Lasagna Slice
|j|GAINZ4JESUS
|player|p1|Lasagna Slice|170
|player|p2|GAINZ4JESUS|2
|gametype|singles
|gen|7
|tier|[Gen 7] OU
|seed|6459,61731,53800,35052
|clearpoke
|poke|p1|Dragonite, M|item
|poke|p1|Victini|item
|poke|p1|Scizor, M|item
|poke|p1|Gyarados, F|item
|poke|p1|Raikou|item
|poke|p1|Celebi|item
|poke|p2|Salamence, F|item
|poke|p2|Kingdra, F|item
|poke|p2|Serperior, M|
|poke|p2|Absol, F|item
|poke|p2|Conkeldurr, F|
|poke|p2|Gardevoir, F|item
|rule|Baton Pass Clause: Limit one Baton Passer, can't pass Spe and other stats simultaneously
|rule|Sleep Clause Mod: Limit one foe put to sleep
|rule|Species Clause: Limit one of each Pokémon
|rule|OHKO Clause: OHKO moves are banned
|rule|Moody Clause: Moody is banned
|rule|Evasion Moves Clause: Evasion moves are banned
|rule|Endless Battle Clause: Forcing endless battles is banned
|rule|HP Percentage Mod: HP is shown in percentages
|teampreview
|j|Not Shanksys
|choice|team 2, team 1, team 3, team 4, team 5, team 6|team 1, team 2, team 3, team 4, team 5, team 6
|
|start
|switch|p1a: Victini|Victini|341\/341
|switch|p2a: Salamence|Salamence, F|331\/331
|-ability|p2a: Salamence|Intimidate|boost
|-unboost|p1a: Victini|atk|1
|turn|1
|l|Not Shanksys
|choice|move substitute|move dragondance
|
|move|p2a: Salamence|Dragon Dance|p2a: Salamence
|-boost|p2a: Salamence|atk|1
|-boost|p2a: Salamence|spe|1
|move|p1a: Victini|Substitute|p1a: Victini
|-start|p1a: Victini|Substitute
|-damage|p1a: Victini|256\/341
|
|upkeep
|turn|2
|choice|move psyshock|move dragondance
|
|move|p2a: Salamence|Dragon Dance|p2a: Salamence
|-boost|p2a: Salamence|atk|1
|-boost|p2a: Salamence|spe|1
|move|p1a: Victini|Psyshock|p2a: Salamence
|-crit|p2a: Salamence
|-damage|p2a: Salamence|124\/331
|
|upkeep
|turn|3
|choice|move psyshock|move earthquake
|
|move|p2a: Salamence|Earthquake|p1a: Victini
|-supereffective|p1a: Victini
|-end|p1a: Victini|Substitute
|move|p1a: Victini|Psyshock|p2a: Salamence
|-damage|p2a: Salamence|4\/331
|
|upkeep
|turn|4
|choice|switch 2|move earthquake
|
|switch|p1a: Dragonite|Dragonite, M|323\/323
|move|p2a: Salamence|Earthquake|p1a: Dragonite
|-immune|p1a: Dragonite|[msg]
|
|upkeep
|turn|5
|choice|move dragonclaw|move outrage
|
|move|p2a: Salamence|Outrage|p1a: Dragonite
|-supereffective|p1a: Dragonite
|-damage|p1a: Dragonite|0 fnt
|faint|p1a: Dragonite
|
|upkeep
|choice|switch 2|
|
|switch|p1a: Victini|Victini|256\/341
|turn|6
|choice|move psyshock|move outrage
|
|move|p2a: Salamence|Outrage|p1a: Victini|[from]lockedmove
|-damage|p1a: Victini|0 fnt
|faint|p1a: Victini
|
|upkeep
|c|☆Lasagna Slice|welp im gettin swept
|c|☆GAINZ4JESUS|HOLY SHIT LOL
|choice|switch 4|
|
|switch|p1a: Gyarados|Gyarados, F|331\/331
|turn|7
|c|☆GAINZ4JESUS|wasn't expecting that
|choice|move hydropump|move outrage
|
|move|p2a: Salamence|Outrage|p1a: Gyarados|[from]lockedmove
|-damage|p1a: Gyarados|0 fnt
|-start|p2a: Salamence|confusion|[fatigue]
|faint|p1a: Gyarados
|
|upkeep
|c|☆Lasagna Slice|dis be gg
|choice|switch 6|
|
|switch|p1a: Celebi|Celebi|341\/341
|turn|8
|choice|move grassknot|move outrage
|
|-activate|p2a: Salamence|confusion
|move|p2a: Salamence|Outrage|p1a: Celebi
|-damage|p1a: Celebi|0 fnt
|faint|p1a: Celebi
|
|upkeep
|choice|switch 5|
|
|switch|p1a: Raikou|Raikou|321\/321
|-ability|p1a: Raikou|Pressure
|turn|9
|choice|move discharge|move outrage
|
|-activate|p2a: Salamence|confusion
|move|p2a: Salamence|Outrage|p1a: Raikou|[from]lockedmove
|-damage|p1a: Raikou|0 fnt
|faint|p1a: Raikou
|
|upkeep
|choice|switch 3|
|
|switch|p1a: Scizor|Scizor, M|281\/281
|turn|10
|choice|move bugbuzz|move outrage
|
|-end|p2a: Salamence|confusion
|move|p2a: Salamence|Outrage|p1a: Scizor|[from]lockedmove
|-resisted|p1a: Scizor
|-damage|p1a: Scizor|47\/281
|-start|p2a: Salamence|confusion|[fatigue]
|move|p1a: Scizor|Bug Buzz|p2a: Salamence
|-resisted|p2a: Salamence
|-damage|p2a: Salamence|0 fnt
|faint|p2a: Salamence
|
|-heal|p1a: Scizor|64\/281|[from] item: Leftovers
|upkeep
|choice||switch 4
|
|switch|p2a: Absol|Absol, F|271\/271
|-ability|p2a: Absol|Pressure
|turn|11
|choice|move flashcannon|move fireblast mega
|
|detailschange|p2a: Absol|Absol-Mega, F
|-mega|p2a: Absol|Absol|Absolite
|move|p2a: Absol|Fire Blast|p1a: Scizor
|-supereffective|p1a: Scizor
|-damage|p1a: Scizor|0 fnt
|faint|p1a: Scizor
|
|win|GAINZ4JESUS
|c|☆Lasagna Slice|that took
|c|☆Lasagna Slice|a whole
|c|☆Lasagna Slice|not even minute
|c|☆GAINZ4JESUS|lmao salamence op</script>

Now that I have a unified log, is there a way to link to the smogon strategy dex or the damage calculator?
I found https://github.com/Zarel/honko-damagecalc/tree/master/js/data which seems like it could be what I am looking for, but is it updated manually?
 

Users Who Are Viewing This Thread (Users: 1, Guests: 0)

Top