Sparked by a post on Reddit shortly after posting my MSFCalc for raid lane assignment, I’ve built a PowerShell based Team Builder for Marvel’s Strike Force.
The team builder will let you assign 5 heroes, based on each ‘stat’ category, will NOT let you use a hero in more than one category, shows you how many ‘positives’ there are for each hero selected, how many for each ‘stat’, and gives you the total count for the team. You are also able to save / export teams and import previously saved teams.
As noted by a user, depending on the restrictions for running scripts on your computer, you may need to run PowerShell as Admin to run the command ‘Set-ExecutionPolicy -ExecutionPolicy Bypass’ to enable scripts to run (instead of Bypass, you may need to use Unrestricted). This script itself does not need Admin rights.
Note: As this is PowerShell, you’re free to modify and distribute as you wish, but please do give proper credit to me for this original work.
Changelog
- V1.4 – Added Tier list rankings from Khasino. Selecting the Battletype will display the tier info for the heroes as 1=Trash, 2=Medicore, 3=Usable, 4=Demigod, 5=God
- V1.3 – Updated with 1.4.1 Blitz infographic data from Khasino
- V1.2 – Fixed stat calculations for columns and rows
- V1.1 – Added stat calculations? I forget 🙂
- V1.0 – Initial Release
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 | # MSFTeamBuilder - Marvel's Strike Force Sure To Win Team Builder # # Created by Archimedez @ FrontRunnerTek.com # # Created: 2018-08-10 # Modified: 2018-08-14 # Version: 1.4 # Updated for 1.4.1 Blitz Infographic and Tier list from Khasino # ====================================================================== Add-Type -AssemblyName System.Windows.Forms Add-Type -AssemblyName System.Drawing $POSHGUI_MyForm = New-Object System.Windows.Forms.Form $POSHGUI_MyForm.Text="MSFTeamBuilder" Try{$POSHGUI_MyForm.Icon="C:\MyIcon\MyIcon.ico"}Catch{} $POSHGUI_MyForm.StartPosition = "CenterScreen" $POSHGUI_MyForm.Size = New-Object System.Drawing.Size(820,350) $POSHGUI_cmb_Hero1 = New-Object System.Windows.Forms.ComboBox $POSHGUI_cmb_Hero1.Top="30" $POSHGUI_cmb_Hero1.Left="10" $POSHGUI_cmb_Hero1.Anchor="Left,Top" $POSHGUI_cmb_Hero1.Parent="" $POSHGUI_MyForm.Controls.Add($POSHGUI_cmb_Hero1) $POSHGUI_cmb_Hero1.Text="" $POSHGUI_cmb_Hero1.Size = New-Object System.Drawing.Size(100,23) $POSHGUI_cmb_Hero2 = New-Object System.Windows.Forms.ComboBox $POSHGUI_cmb_Hero2.Top="30" $POSHGUI_cmb_Hero2.Left="140" $POSHGUI_cmb_Hero2.Anchor="Left,Top" $POSHGUI_cmb_Hero2.Parent="" $POSHGUI_MyForm.Controls.Add($POSHGUI_cmb_Hero2) $POSHGUI_cmb_Hero2.Text="" $POSHGUI_cmb_Hero2.Size = New-Object System.Drawing.Size(100,23) $POSHGUI_cmb_Hero3 = New-Object System.Windows.Forms.ComboBox $POSHGUI_cmb_Hero3.Top="30" $POSHGUI_cmb_Hero3.Left="270" $POSHGUI_cmb_Hero3.Anchor="Left,Top" $POSHGUI_cmb_Hero3.Parent="" $POSHGUI_MyForm.Controls.Add($POSHGUI_cmb_Hero3) $POSHGUI_cmb_Hero3.Text="" $POSHGUI_cmb_Hero3.Size = New-Object System.Drawing.Size(100,23) $POSHGUI_cmb_Hero4 = New-Object System.Windows.Forms.ComboBox $POSHGUI_cmb_Hero4.Top="30" $POSHGUI_cmb_Hero4.Left="400" $POSHGUI_cmb_Hero4.Anchor="Left,Top" $POSHGUI_cmb_Hero4.Parent="" $POSHGUI_MyForm.Controls.Add($POSHGUI_cmb_Hero4) $POSHGUI_cmb_Hero4.Text="" $POSHGUI_cmb_Hero4.Size = New-Object System.Drawing.Size(100,23) $POSHGUI_cmb_Hero5 = New-Object System.Windows.Forms.ComboBox $POSHGUI_cmb_Hero5.Top="30" $POSHGUI_cmb_Hero5.Left="540" $POSHGUI_cmb_Hero5.Anchor="Left,Top" $POSHGUI_cmb_Hero5.Parent="" $POSHGUI_MyForm.Controls.Add($POSHGUI_cmb_Hero5) $POSHGUI_cmb_Hero5.Text="" $POSHGUI_cmb_Hero5.Size = New-Object System.Drawing.Size(100,23) $POSHGUI_cmb_Battletype = New-Object System.Windows.Forms.ComboBox $POSHGUI_cmb_Battletype.Top="30" $POSHGUI_cmb_Battletype.Left="680" $POSHGUI_cmb_Battletype.Anchor="Left,Top" $POSHGUI_cmb_Battletype.Parent="" $POSHGUI_MyForm.Controls.Add($POSHGUI_cmb_Battletype) $POSHGUI_cmb_Battletype.Text="" $POSHGUI_cmb_Battletype.Size = New-Object System.Drawing.Size(110,23) $POSHGUI_Label6 = New-Object System.Windows.Forms.Label $POSHGUI_Label6.Top="15" $POSHGUI_Label6.Left="680" $POSHGUI_Label6.Anchor="Left,Top" $POSHGUI_Label6.Parent="" $POSHGUI_MyForm.Controls.Add($POSHGUI_Label6) $POSHGUI_Label6.Text="Battle Type" $POSHGUI_Label6.Size = New-Object System.Drawing.Size(120,23) $POSHGUI_Label1 = New-Object System.Windows.Forms.Label $POSHGUI_Label1.Top="15" $POSHGUI_Label1.Left="540" $POSHGUI_Label1.Anchor="Left,Top" $POSHGUI_Label1.Parent="" $POSHGUI_MyForm.Controls.Add($POSHGUI_Label1) $POSHGUI_Label1.Text="Damage with Utility" $POSHGUI_Label1.Size = New-Object System.Drawing.Size(120,23) $POSHGUI_Label2 = New-Object System.Windows.Forms.Label $POSHGUI_Label2.Top="15" $POSHGUI_Label2.Left="400" $POSHGUI_Label2.Anchor="Left,Top" $POSHGUI_Label2.Parent="" $POSHGUI_MyForm.Controls.Add($POSHGUI_Label2) $POSHGUI_Label2.Text="Massive AOE Damage" $POSHGUI_Label2.Size = New-Object System.Drawing.Size(120,23) $POSHGUI_Label3 = New-Object System.Windows.Forms.Label $POSHGUI_Label3.Top="15" $POSHGUI_Label3.Left="270" $POSHGUI_Label3.Anchor="Left,Top" $POSHGUI_Label3.Parent="" $POSHGUI_MyForm.Controls.Add($POSHGUI_Label3) $POSHGUI_Label3.Text="Enemy Buff Purge" $POSHGUI_Label3.Size = New-Object System.Drawing.Size(120,23) $POSHGUI_Label4 = New-Object System.Windows.Forms.Label $POSHGUI_Label4.Top="15" $POSHGUI_Label4.Left="140" $POSHGUI_Label4.Anchor="Left,Top" $POSHGUI_Label4.Parent="" $POSHGUI_MyForm.Controls.Add($POSHGUI_Label4) $POSHGUI_Label4.Text="Early Burst Damage" $POSHGUI_Label4.Size = New-Object System.Drawing.Size(120,23) $POSHGUI_Label5 = New-Object System.Windows.Forms.Label $POSHGUI_Label5.Top="15" $POSHGUI_Label5.Left="8" $POSHGUI_Label5.Anchor="Left,Top" $POSHGUI_Label5.Parent="" $POSHGUI_MyForm.Controls.Add($POSHGUI_Label5) $POSHGUI_Label5.Text="Team Wide Defense" $POSHGUI_Label5.Size = New-Object System.Drawing.Size(120,23) $POSHGUI_lbl_SureToWin = New-Object System.Windows.Forms.Label $POSHGUI_lbl_SureToWin.Top="58" $POSHGUI_lbl_SureToWin.Left="540" $POSHGUI_lbl_SureToWin.Anchor="Left,Top" $POSHGUI_lbl_SureToWin.Parent="" $POSHGUI_MyForm.Controls.Add($POSHGUI_lbl_SureToWin) $POSHGUI_lbl_SureToWin.Text="" $POSHGUI_lbl_SureToWin.Size = New-Object System.Drawing.Size(200,22) $POSHGUI_DGV_TeamResults = New-Object System.Windows.Forms.DataGridView $POSHGUI_DGV_TeamResults.Top="80" $POSHGUI_DGV_TeamResults.Left="12" $POSHGUI_DGV_TeamResults.Anchor="Left,Top" $POSHGUI_DGV_TeamResults.Parent="" $POSHGUI_MyForm.Controls.Add($POSHGUI_DGV_TeamResults) $POSHGUI_DGV_TeamResults.Text="DataGridView1" $POSHGUI_DGV_TeamResults.Size = New-Object System.Drawing.Size(780,200) $POSHGUI_btn_reset = New-Object System.Windows.Forms.Button $POSHGUI_btn_reset.Top="55" $POSHGUI_btn_reset.Left="10" $POSHGUI_btn_reset.Anchor="Left,Top" $POSHGUI_btn_reset.Parent="" $POSHGUI_MyForm.Controls.Add($POSHGUI_btn_reset) $POSHGUI_btn_reset.Text="Reset" $POSHGUI_btn_reset.Size = New-Object System.Drawing.Size(100,23) $POSHGUI_btn_export = New-Object System.Windows.Forms.Button $POSHGUI_btn_export.Top="55" $POSHGUI_btn_export.Left="150" $POSHGUI_btn_export.Anchor="Left,Top" $POSHGUI_btn_export.Parent="" $POSHGUI_MyForm.Controls.Add($POSHGUI_btn_export) $POSHGUI_btn_export.Text="Export Team" $POSHGUI_btn_export.Size = New-Object System.Drawing.Size(100,23) $POSHGUI_btn_import = New-Object System.Windows.Forms.Button $POSHGUI_btn_import.Top="55" $POSHGUI_btn_import.Left="300" $POSHGUI_btn_import.Anchor="Left,Top" $POSHGUI_btn_import.Parent="" $POSHGUI_MyForm.Controls.Add($POSHGUI_btn_import) $POSHGUI_btn_import.Text="Import Team" $POSHGUI_btn_import.Size = New-Object System.Drawing.Size(100,23) # Add Custom Code Below - Do NOT Edit This Line! # Rank: 5=GOD, 4=Demigod, 3=Useable, 2=Mediocre, 1=Trash $csvData = @" Hero,Team Wide Defense Buff,Enemy Buff Purge,Massive AOE Damage,Damage with Utility,Early Burst Damage,Campaign-RaidRank,ArenaOffense-Blitz,ArenaDefense-AI Vision,No,Yes,Yes,Yes,No,5,5,4 Yondu,No,Yes,Yes,Yes,No,5,5,5 Black Widow,No,Yes,No,Yes,No,5,5,5 Doctor Strange,No,Yes,No,Yes,No,4,5,4 Hawkeye,No,Yes,No,Yes,No,4,4,4 Quake,No,Yes,Yes,No,No,5,5,5 Antman,No,Yes,No,No,No,3,4,3 Elektra,No,Yes,No,No,No,3,3,3 Hand Archer,No,Yes,No,No,No,3,3,2 Jessica Jones,No,Yes,No,No,No,4,4,4 Shield Operative,No,Yes,No,No,No,3,3,3 Captain America,Yes,Yes,No,No,No,4,4,4 Thanos,No,No,Yes,Yes,Yes,5,4,4 Wasp,No,No,Yes,Yes,Yes,4,4,3 Iron Man,No,No,Yes,No,Yes,5,4,4 Korath,No,No,No,Yes,Yes,4,5,4 Rocket Racoon,No,No,Yes,No,Yes,4,4,4 Starlord,No,No,No,Yes,Yes,4,4,3 Black Panther,No,No,No,Yes,No,5,4,3 Bullseye,No,No,No,No,Yes,3,3,3 Cable,No,No,No,Yes,No,4,5,3 Crossbones,No,No,Yes,No,No,4,4,4 Daredevil,No,No,No,No,Yes,4,4,3 Deadpool,No,No,No,No,Yes,5,5,4 Gamora,No,No,No,No,Yes,4,4,3 Merc Lieutenant,No,No,No,Yes,No,4,4,3 Merc Sniper,No,No,No,No,Yes,3,3,2 Mordo,No,No,No,Yes,No,4,4,3 Nobu,No,No,No,Yes,No,3,4,3 Spiderman,No,No,No,Yes,No,5,5,4 Thor,No,No,Yes,No,No,3,3,3 Winter Soldier,No,No,No,No,Yes,4,4,4 Hand Sentry,Yes,No,No,No,No,4,4,4 Kingpin,Yes,No,No,No,No,5,5,5 Luke Cage,Yes,No,No,No,No,4,3,3 Merc Riot Guard,Yes,No,No,No,No,4,4,4 Scarlet Witch,Yes,No,No,Yes,No,4,4,3 Loki,No,No,No,Yes,Yes,4,4,4 Okoye,No,No,No,Yes,Yes,4,4,3 Nick Fury,No,No,No,Yes,No,4,4,5 Ms Marvel,No,No,No,No,Yes,3,3,3 "@ # Import Character Data $charDataImport = $csvData | ConvertFrom-Csv Function Load-ComboBoxes { # Clear comboboxes $POSHGUI_cmb_Hero1.Items.Clear() # Team-Wide Defense Buff $POSHGUI_cmb_Hero2.Items.Clear() # Early Burst Damage $POSHGUI_cmb_Hero3.Items.Clear() # Enemy Buff Purge $POSHGUI_cmb_Hero4.Items.Clear() # Massive AOE $POSHGUI_cmb_Hero5.Items.Clear() # Damage with Utility $POSHGUI_cmb_Battletype.Items.Clear() $POSHGUI_cmb_Hero1.Text = "" $POSHGUI_cmb_Hero2.Text = "" $POSHGUI_cmb_Hero3.Text = "" $POSHGUI_cmb_Hero4.Text = "" $POSHGUI_cmb_Hero5.Text = "" $POSHGUI_cmb_Battletype.Text = "" $POSHGUI_lbl_SureToWin.Text = "" [void]$POSHGUI_cmb_Battletype.Items.Add("Arena Defense / AI") [void]$POSHGUI_cmb_Battletype.Items.Add("Arena Offense / Blitz") [void]$POSHGUI_cmb_Battletype.Items.Add("Raid / Campaign") # Add characters to comboboxes ForEach ($char in $charDataImport){ If ($char.'Team Wide Defense Buff' -eq 'Yes' -or $char.'Team Wide Defense Buff' -eq 'Meh'){ [void]$POSHGUI_cmb_Hero1.items.Add($char.Hero) } If ($char.'Early Burst Damage' -eq 'Yes'){ [void]$POSHGUI_cmb_Hero2.items.Add($char.Hero) } If ($char.'Enemy Buff Purge' -eq 'Yes'){ [void]$POSHGUI_cmb_Hero3.items.Add($char.Hero) } If ($char.'Massive AOE Damage' -eq 'Yes'){ [void]$POSHGUI_cmb_Hero4.items.Add($char.Hero) } If ($char.'Damage with Utility' -eq 'Yes'){ [void]$POSHGUI_cmb_Hero5.items.Add($char.Hero) } } } Load-comboboxes # Create Datatable for team building output $Global:DToutput = New-Object System.Data.DataTable [void]$Global:DToutput.Columns.Add("STAT") [void]$Global:DToutput.Columns.Add("Hero 1") [void]$Global:DToutput.Columns.Add("Hero 2") [void]$Global:DToutput.Columns.Add("Hero 3") [void]$Global:DToutput.Columns.Add("Hero 4") [void]$Global:DToutput.Columns.Add("Hero 5") [void]$Global:DToutput.Columns.Add("Sure To Win?") $POSHGUI_DGV_TeamResults.DataSource = $Global:DToutput $POSHGUI_DGV_TeamResults.AutoSizeColumnsMode = "AllCells" $POSHGUI_DGV_TeamResults.ReadOnly = $true $POSHGUI_DGV_TeamResults.AllowUserToAddRows = $false Function Show-TeamOutput { # $POSHGUI_cmb_Hero1.SelectedItem = "Kingpin" $Hero1output = $charDataImport | Where-Object {$_.Hero -eq $POSHGUI_cmb_Hero1.SelectedItem} $Hero2output = $charDataImport | Where-Object {$_.Hero -eq $POSHGUI_cmb_Hero2.SelectedItem} $Hero3output = $charDataImport | Where-Object {$_.Hero -eq $POSHGUI_cmb_Hero3.SelectedItem} $Hero4output = $charDataImport | Where-Object {$_.Hero -eq $POSHGUI_cmb_Hero4.SelectedItem} $Hero5output = $charDataImport | Where-Object {$_.Hero -eq $POSHGUI_cmb_Hero5.SelectedItem} $DTteam = $Global:DToutput.Clone() $row1 = $DTteam.NewRow() $row1.STAT = "Team Wide Defense Buff" $row1.'Hero 1' = $Hero1output.'Team Wide Defense Buff' $row1.'Hero 2' = $Hero2output.'Team Wide Defense Buff' $row1.'Hero 3' = $Hero3output.'Team Wide Defense Buff' $row1.'Hero 4' = $Hero4output.'Team Wide Defense Buff' $row1.'Hero 5' = $Hero5output.'Team Wide Defense Buff' $row1Count = 0 If ($Hero1output.'Team Wide Defense Buff' -eq 'Yes'){$row1Count += 1} ElseIf ($Hero1output.'Team Wide Defense Buff' -eq 'Meh'){$row1Count += 0.5} If ($Hero2output.'Team Wide Defense Buff' -eq 'Yes'){$row1Count += 1} ElseIf ($Hero2output.'Team Wide Defense Buff' -eq 'Meh'){$row1Count += 0.5} If ($Hero3output.'Team Wide Defense Buff' -eq 'Yes'){$row1Count += 1} ElseIf ($Hero3output.'Team Wide Defense Buff' -eq 'Meh'){$row1Count += 0.5} If ($Hero4output.'Team Wide Defense Buff' -eq 'Yes'){$row1Count += 1} ElseIf ($Hero4output.'Team Wide Defense Buff' -eq 'Meh'){$row1Count += 0.5} If ($Hero5output.'Team Wide Defense Buff' -eq 'Yes'){$row1Count += 1} ElseIf ($Hero5output.'Team Wide Defense Buff' -eq 'Meh'){$row1Count += 0.5} $row1.'Sure To Win?' = $row1Count $DTteam.rows.Add($row1) $row2 = $DTteam.NewRow() $row2.STAT = "Enemy Buff Purge" $row2.'Hero 1' = $Hero1output.'Enemy Buff Purge' $row2.'Hero 2' = $Hero2output.'Enemy Buff Purge' $row2.'Hero 3' = $Hero3output.'Enemy Buff Purge' $row2.'Hero 4' = $Hero4output.'Enemy Buff Purge' $row2.'Hero 5' = $Hero5output.'Enemy Buff Purge' $row2Count = 0 If ($Hero1output.'Enemy Buff Purge' -eq 'Yes'){$row2Count += 1} If ($Hero2output.'Enemy Buff Purge' -eq 'Yes'){$row2Count += 1} If ($Hero3output.'Enemy Buff Purge' -eq 'Yes'){$row2Count += 1} If ($Hero4output.'Enemy Buff Purge' -eq 'Yes'){$row2Count += 1} If ($Hero5output.'Enemy Buff Purge' -eq 'Yes'){$row2Count += 1} $row2.'Sure To Win?' = $row2Count $DTteam.rows.Add($row2) $row3 = $DTteam.NewRow() $row3.STAT = "Massive AOE Damage" $row3.'Hero 1' = $Hero1output.'Massive AOE Damage' $row3.'Hero 2' = $Hero2output.'Massive AOE Damage' $row3.'Hero 3' = $Hero3output.'Massive AOE Damage' $row3.'Hero 4' = $Hero4output.'Massive AOE Damage' $row3.'Hero 5' = $Hero5output.'Massive AOE Damage' $row3Count = 0 If ($Hero1output.'Massive AOE Damage' -eq 'Yes'){$row3Count += 1} If ($Hero2output.'Massive AOE Damage' -eq 'Yes'){$row3Count += 1} If ($Hero3output.'Massive AOE Damage' -eq 'Yes'){$row3Count += 1} If ($Hero4output.'Massive AOE Damage' -eq 'Yes'){$row3Count += 1} If ($Hero5output.'Massive AOE Damage' -eq 'Yes'){$row3Count += 1} $row3.'Sure To Win?' = $row3Count $DTteam.rows.Add($row3) $row4 = $DTteam.NewRow() $row4.STAT = "Damage with Utility" $row4.'Hero 1' = $Hero1output.'Damage with Utility' $row4.'Hero 2' = $Hero2output.'Damage with Utility' $row4.'Hero 3' = $Hero3output.'Damage with Utility' $row4.'Hero 4' = $Hero4output.'Damage with Utility' $row4.'Hero 5' = $Hero5output.'Damage with Utility' $row4Count = 0 If ($Hero1output.'Damage with Utility' -eq 'Yes'){$row4Count += 1} If ($Hero2output.'Damage with Utility' -eq 'Yes'){$row4Count += 1} If ($Hero3output.'Damage with Utility' -eq 'Yes'){$row4Count += 1} If ($Hero4output.'Damage with Utility' -eq 'Yes'){$row4Count += 1} If ($Hero5output.'Damage with Utility' -eq 'Yes'){$row4Count += 1} $row4.'Sure To Win?' = $row4Count $DTteam.rows.Add($row4) $row5 = $DTteam.NewRow() $row5.STAT = "Early Burst Damage" $row5.'Hero 1' = $Hero1output.'Early Burst Damage' $row5.'Hero 2' = $Hero2output.'Early Burst Damage' $row5.'Hero 3' = $Hero3output.'Early Burst Damage' $row5.'Hero 4' = $Hero4output.'Early Burst Damage' $row5.'Hero 5' = $Hero5output.'Early Burst Damage' $row5Count = 0 If ($Hero1output.'Early Burst Damage' -eq 'Yes'){$row5Count += 1} If ($Hero2output.'Early Burst Damage' -eq 'Yes'){$row5Count += 1} If ($Hero3output.'Early Burst Damage' -eq 'Yes'){$row5Count += 1} If ($Hero4output.'Early Burst Damage' -eq 'Yes'){$row5Count += 1} If ($Hero5output.'Early Burst Damage' -eq 'Yes'){$row5Count += 1} $row5.'Sure To Win?' = $row5Count $DTteam.rows.Add($row5) $row6 = $DTteam.NewRow() $row6.STAT = "Total Positives" $Hero1Count = 0 $DTteam.Where{$_.'Hero 1' -eq 'Yes' }.ForEach({$Hero1Count += 1}) $DTteam.Where{$_.'Hero 1' -eq 'Meh' }.ForEach({$Hero1Count += 0.5}) $row6.'Hero 1' = $Hero1Count $Hero2Count = 0 $DTteam.Where{$_.'Hero 2' -eq 'Yes' }.ForEach({$Hero2Count += 1}) $row6.'Hero 2' = $Hero2Count $Hero3Count = 0 $DTteam.Where{$_.'Hero 3' -eq 'Yes' }.ForEach({$Hero3Count += 1}) $row6.'Hero 3' = $Hero3Count $Hero4Count = 0 $DTteam.Where{$_.'Hero 4' -eq 'Yes' }.ForEach({$Hero4Count += 1}) $row6.'Hero 4' = $Hero4Count $Hero5Count = 0 $DTteam.Where{$_.'Hero 5' -eq 'Yes' }.ForEach({$Hero5Count += 1}) $row6.'Hero 5' = $Hero5Count $totalCountPositives = [int]$row6.'Hero 1' + [int]$row6.'Hero 2' + [int]$row6.'Hero 3' + [int]$row6.'Hero 4' + [int]$row6.'Hero 5' $row6.'Sure To Win?' = $totalCountPositives $DTteam.rows.Add($row6) $row7 = $DTteam.NewRow() $row7.STAT = "Hero Tier: 1 (Trash) to 5 (God)" Switch ($POSHGUI_cmb_Battletype.SelectedItem){ # Campaign-RaidRank,ArenaOffense-Blitz,ArenaDefense-AI "Arena Defense / AI" { $row7.'Hero 1' = $Hero1output.'ArenaDefense-AI' $row7.'Hero 2' = $Hero2output.'ArenaDefense-AI' $row7.'Hero 3' = $Hero3output.'ArenaDefense-AI' $row7.'Hero 4' = $Hero4output.'ArenaDefense-AI' $row7.'Hero 5' = $Hero5output.'ArenaDefense-AI' } "Arena Offense / Blitz" { $row7.'Hero 1' = $Hero1output.'ArenaOffense-Blitz' $row7.'Hero 2' = $Hero2output.'ArenaOffense-Blitz' $row7.'Hero 3' = $Hero3output.'ArenaOffense-Blitz' $row7.'Hero 4' = $Hero4output.'ArenaOffense-Blitz' $row7.'Hero 5' = $Hero5output.'ArenaOffense-Blitz' } "Raid / Campaign" { $row7.'Hero 1' = $Hero1output.'Campaign-RaidRank' $row7.'Hero 2' = $Hero2output.'Campaign-RaidRank' $row7.'Hero 3' = $Hero3output.'Campaign-RaidRank' $row7.'Hero 4' = $Hero4output.'Campaign-RaidRank' $row7.'Hero 5' = $Hero5output.'Campaign-RaidRank' } } $DTteam.rows.Add($row7) $POSHGUI_DGV_TeamResults.DataSource = $DTteam } $POSHGUI_cmb_Hero1.Add_SelectedValueChanged({ $POSHGUI_cmb_Hero2.Items.Remove($POSHGUI_cmb_Hero1.SelectedItem) $POSHGUI_cmb_Hero3.Items.Remove($POSHGUI_cmb_Hero1.SelectedItem) $POSHGUI_cmb_Hero4.Items.Remove($POSHGUI_cmb_Hero1.SelectedItem) $POSHGUI_cmb_Hero5.Items.Remove($POSHGUI_cmb_Hero1.SelectedItem) If ($POSHGUI_cmb_Hero1.SelectedIndex -ne -1 -and $POSHGUI_cmb_Hero2.SelectedIndex -ne -1 -and $POSHGUI_cmb_Hero3.SelectedIndex -ne -1 ` -and $POSHGUI_cmb_Hero4.SelectedIndex -ne -1 -and $POSHGUI_cmb_Hero5.SelectedIndex -ne -1 -and $POSHGUI_cmb_Battletype.SelectedIndex -ne -1){ $POSHGUI_lbl_SureToWin.Text = "Team Is Sure To Win!!! (Probably)" Show-TeamOutput } }) $POSHGUI_cmb_Hero2.Add_SelectedValueChanged({ $POSHGUI_cmb_Hero1.Items.Remove($POSHGUI_cmb_Hero2.SelectedItem) $POSHGUI_cmb_Hero3.Items.Remove($POSHGUI_cmb_Hero2.SelectedItem) $POSHGUI_cmb_Hero4.Items.Remove($POSHGUI_cmb_Hero2.SelectedItem) $POSHGUI_cmb_Hero5.Items.Remove($POSHGUI_cmb_Hero2.SelectedItem) If ($POSHGUI_cmb_Hero1.SelectedIndex -ne -1 -and $POSHGUI_cmb_Hero2.SelectedIndex -ne -1 -and $POSHGUI_cmb_Hero3.SelectedIndex -ne -1 ` -and $POSHGUI_cmb_Hero4.SelectedIndex -ne -1 -and $POSHGUI_cmb_Hero5.SelectedIndex -ne -1 -and $POSHGUI_cmb_Battletype.SelectedIndex -ne -1){ $POSHGUI_lbl_SureToWin.Text = "Team Is Sure To Win!!! (Probably)" Show-TeamOutput } }) $POSHGUI_cmb_Hero3.Add_SelectedValueChanged({ $POSHGUI_cmb_Hero1.Items.Remove($POSHGUI_cmb_Hero3.SelectedItem) $POSHGUI_cmb_Hero2.Items.Remove($POSHGUI_cmb_Hero3.SelectedItem) $POSHGUI_cmb_Hero4.Items.Remove($POSHGUI_cmb_Hero3.SelectedItem) $POSHGUI_cmb_Hero5.Items.Remove($POSHGUI_cmb_Hero3.SelectedItem) If ($POSHGUI_cmb_Hero1.SelectedIndex -ne -1 -and $POSHGUI_cmb_Hero2.SelectedIndex -ne -1 -and $POSHGUI_cmb_Hero3.SelectedIndex -ne -1 ` -and $POSHGUI_cmb_Hero4.SelectedIndex -ne -1 -and $POSHGUI_cmb_Hero5.SelectedIndex -ne -1 -and $POSHGUI_cmb_Battletype.SelectedIndex -ne -1){ $POSHGUI_lbl_SureToWin.Text = "Team Is Sure To Win!!! (Probably)" Show-TeamOutput } }) $POSHGUI_cmb_Hero4.Add_SelectedValueChanged({ $POSHGUI_cmb_Hero1.Items.Remove($POSHGUI_cmb_Hero4.SelectedItem) $POSHGUI_cmb_Hero2.Items.Remove($POSHGUI_cmb_Hero4.SelectedItem) $POSHGUI_cmb_Hero3.Items.Remove($POSHGUI_cmb_Hero4.SelectedItem) $POSHGUI_cmb_Hero5.Items.Remove($POSHGUI_cmb_Hero4.SelectedItem) If ($POSHGUI_cmb_Hero1.SelectedIndex -ne -1 -and $POSHGUI_cmb_Hero2.SelectedIndex -ne -1 -and $POSHGUI_cmb_Hero3.SelectedIndex -ne -1 ` -and $POSHGUI_cmb_Hero4.SelectedIndex -ne -1 -and $POSHGUI_cmb_Hero5.SelectedIndex -ne -1 -and $POSHGUI_cmb_Battletype.SelectedIndex -ne -1){ $POSHGUI_lbl_SureToWin.Text = "Team Is Sure To Win!!! (Probably)" Show-TeamOutput } }) $POSHGUI_cmb_Hero5.Add_SelectedValueChanged({ $POSHGUI_cmb_Hero1.Items.Remove($POSHGUI_cmb_Hero5.SelectedItem) $POSHGUI_cmb_Hero2.Items.Remove($POSHGUI_cmb_Hero5.SelectedItem) $POSHGUI_cmb_Hero3.Items.Remove($POSHGUI_cmb_Hero5.SelectedItem) $POSHGUI_cmb_Hero4.Items.Remove($POSHGUI_cmb_Hero5.SelectedItem) If ($POSHGUI_cmb_Hero1.SelectedIndex -ne -1 -and $POSHGUI_cmb_Hero2.SelectedIndex -ne -1 -and $POSHGUI_cmb_Hero3.SelectedIndex -ne -1 ` -and $POSHGUI_cmb_Hero4.SelectedIndex -ne -1 -and $POSHGUI_cmb_Hero5.SelectedIndex -ne -1 -and $POSHGUI_cmb_Battletype.SelectedIndex -ne -1){ $POSHGUI_lbl_SureToWin.Text = "Team Is Sure To Win!!! (Probably)" Show-TeamOutput } }) $POSHGUI_cmb_Battletype.Add_SelectedValueChanged({ If ($POSHGUI_cmb_Hero1.SelectedIndex -ne -1 -and $POSHGUI_cmb_Hero2.SelectedIndex -ne -1 -and $POSHGUI_cmb_Hero3.SelectedIndex -ne -1 ` -and $POSHGUI_cmb_Hero4.SelectedIndex -ne -1 -and $POSHGUI_cmb_Hero5.SelectedIndex -ne -1 -and $POSHGUI_cmb_Battletype.SelectedIndex -ne -1){ $POSHGUI_lbl_SureToWin.Text = "Team Is Sure To Win!!! (Probably)" Show-TeamOutput } }) Function Reset-All { Load-ComboBoxes $POSHGUI_DGV_TeamResults.DataSource.Clear() } $POSHGUI_btn_reset.Add_Click({ Reset-All }) $POSHGUI_btn_export.Add_Click({ Export-Team }) $POSHGUI_btn_import.Add_Click({ Import-Team }) Function Export-Team { $teamExportFile = Get-FileNameExport -initialDirectory $DefaultPath If ($teamExportFile){ $team = [PSCustomObject] @{ Hero1 = $POSHGUI_cmb_Hero1.SelectedItem Hero2 = $POSHGUI_cmb_Hero2.SelectedItem Hero3 = $POSHGUI_cmb_Hero3.SelectedItem Hero4 = $POSHGUI_cmb_Hero4.SelectedItem Hero5 = $POSHGUI_cmb_Hero5.SelectedItem } $team | ConvertTo-Json | Out-File $teamExportFile } } Function Import-Team { $teamImportFile = Get-FileNameImport -initialDirectory $DefaultPath If ($teamImportFile){ Reset-All $team = Get-Content $teamImportFile | ConvertFrom-Json $POSHGUI_cmb_Hero1.SelectedItem = $team.Hero1 $POSHGUI_cmb_Hero2.SelectedItem = $team.Hero2 $POSHGUI_cmb_Hero3.SelectedItem = $team.Hero3 $POSHGUI_cmb_Hero4.SelectedItem = $team.Hero4 $POSHGUI_cmb_Hero5.SelectedItem = $team.Hero5 } } $DefaultPath = "$env:USERPROFILE\Documents" Function Get-FileNameExport($initialDirectory) { $SaveFileDialog = New-Object System.Windows.Forms.SaveFileDialog $SaveFileDialog.initialDirectory = $initialDirectory $SaveFileDialog.filter = “JSON files (*.json)|*.json” $SaveFileDialog.ShowDialog() | Out-Null $SaveFileDialog.filename } Function Get-FileNameImport($initialDirectory) { $OpenFileDialog = New-Object System.Windows.Forms.OpenFileDialog $OpenFileDialog.initialDirectory = $initialDirectory $OpenFileDialog.filter = “JSON files (*.json)|*.json” $OpenFileDialog.ShowDialog() | Out-Null $OpenFileDialog.filename } # Add Custom Code Above - Do NOT Edit This Line! $null = $POSHGUI_MyForm.ShowDialog() |