From ee1b80b2dc8bf6231d77dfab4758b5d49d9dc4c5 Mon Sep 17 00:00:00 2001 From: Thijs Stobbelaar Date: Wed, 27 Sep 2023 15:06:47 +0200 Subject: [PATCH 1/2] formatting --- discord/report_new_matches.ps1 | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/discord/report_new_matches.ps1 b/discord/report_new_matches.ps1 index a6e4a6a..3767d31 100644 --- a/discord/report_new_matches.ps1 +++ b/discord/report_new_matches.ps1 @@ -82,18 +82,16 @@ foreach ($winid in $new_win_matches) { $content_winstats = '```' + ($win_stats | Format-Table | out-string) + '```' send-discord -content $content_winstats - $legenda = " - - Legenda: - - dmg_h: Schade aangericht aan echte spelers - dmg: Totale schade (aan zowel echte spelers als AI) - k_h: Aantal echte spelers die je hebt geƫlimineerd - K_a: Totale aantal eliminaties (inclusief AI) - t_serv: Overleefde tijd (in seconden) - k_t: Team eliminaties - - " + $legenda = ' +``` +dmg_h = Schade aangericht aan echte spelers +dmg = Totale schade (aan zowel echte spelers als AI) +k_h = Aantal echte spelers die je hebt geelimineerd +K_a = Totale aantal eliminaties (inclusief AI) +t_serv = Overleefde tijd (in seconden) +k_t = Team eliminaties +``` + ' send-discord -content $legenda -- 2.49.1 From c21b6139bae3beec5abf05822148d07711ac05f5 Mon Sep 17 00:00:00 2001 From: Thijs Stobbelaar Date: Wed, 27 Sep 2023 15:16:41 +0200 Subject: [PATCH 2/2] map_map --- discord/report_new_matches.ps1 | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/discord/report_new_matches.ps1 b/discord/report_new_matches.ps1 index 3767d31..bce9eb8 100644 --- a/discord/report_new_matches.ps1 +++ b/discord/report_new_matches.ps1 @@ -47,6 +47,20 @@ function send-discord { Invoke-RestMethod -Uri $webhookurl -Method Post -Body ($payload | ConvertTo-Json) -ContentType 'Application/Json' } +$map_map = @{ + "Baltic_Main" = "Erangel (Remastered)" + "Chimera_Main" = "Paramo" + "Desert_Main" = "Miramar" + "DihorOtok_Main" = "Vikendi" + "Erangel_Main" = "Erangel" + "Heaven_Main" = "Haven" + "Kiki_Main" = "Deston" + "Range_Main" = "Camp Jackal" + "Savage_Main" = "Sanhok" + "Summerland_Main" = "Karakin" + "Tiger_Main" = "Taego" +} + $player_matches = get-content "$scriptroot/../data/player_matches.json" | convertfrom-json -Depth 100 $new_win_matches = $player_matches.new_win_matches $win_stats = @() @@ -63,7 +77,7 @@ foreach ($winid in $new_win_matches) { send-discord -content "Gefeliciteerd $($players -join ' ')" send-discord -content "match mode $($winmatches[0].gameMode)" send-discord -content "match type $($winmatches[0].matchType)" - send-discord -content "map $($winmatches[0].mapName)" + send-discord -content "map $($map_map[$winmatches[0].mapName])" foreach ($player in $all_winners_of_match.name) { write-output "creating tble for player $player" -- 2.49.1