Last active
July 16, 2022 22:27
-
-
Save karoltheguy/b1585271b35aa341c64bcc11fe66700d to your computer and use it in GitHub Desktop.
Hunt Showdown - Extract MMR
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function Get-HuntTeamMmr { | |
$HuntDir = "C:\Program Files (x86)\Steam\steamapps\common\Hunt Showdown" | |
$File = Get-Item "$HuntDir\user\profiles\default\attributes.xml" | |
$NameSuffix = "_blood_line_name" | |
$MmrSuffix = "_mmr" | |
$TeamSuffix = "_ownteam" | |
[xml]$Data = Get-Content $File | |
$FlatData = $Data.ChildNodes.selectNodes("*") | |
$TeamPrefix = ($FlatData | Where-Object {($_.name -like "*$TeamSuffix") ` | |
-and ($_.value -eq "true")}).name.Replace("Team", "Player").Replace("$TeamSuffix", "") | |
[PSObject]$TeamPlayers = $FlatData | Where-Object {$_.name -like "$($TeamPrefix[0])_?$NameSuffix"} | |
$Results = @() | |
ForEach ($Player in $TeamPlayers) { | |
$PlayerMmr = ($FlatData | Where-Object {$_.name -eq ($Player.name.Replace($NameSuffix, $MmrSuffix))}).value | |
$Results += [PSCustomObject]@{ | |
Name = $Player.value | |
MMR = $PlayerMmr | |
} | |
} | |
Return $Results | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment