Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <#
- .DESCRIPTION
- Generates a random mapcycle.txt for Halo PC SAPP server from the mapList.txt and gametypeList.txt.
- Creates mapList.txt and gametypeList.txt with originals maps and gametypes if they don't exist.
- #>
- $scriptPath = Split-Path -Parent $MyInvocation.MyCommand.Definition
- $mapListPath = "$scriptPath\mapList.txt"
- $gametypeListPath = "$scriptPath\gametypeList.txt"
- $mapcyclePath = "$scriptPath\mapcycle.txt"
- $mapcycleSize = 7
- $mapList = @(
- "bloodgulch",
- "beavercreek",
- "boardingaction",
- "carousel",
- "chillout",
- "dangercanyon",
- "deathisland",
- "direlict",
- "gephyrophobia",
- "hangemhigh",
- "icefield",
- "infinity",
- "longest",
- "prisoner",
- "putput",
- "ratrace",
- "sidewinder",
- "timberland",
- "wizard"
- )
- $gametypeList = @(
- "oddball",
- "slayer",
- "juggernaut",
- "king",
- "crazy king",
- "race",
- "ctf",
- "assault",
- "team slayer",
- "team oddball",
- "team race"
- )
- If (-Not (Test-Path -Path $mapListPath)) {
- Out-File -FilePath $mapListPath -InputObject $mapList
- }
- If (-Not (Test-Path -Path $gametypeListPath)) {
- Out-File -FilePath $gametypeListPath -InputObject $gametypeList
- }
- $finalMapList = Get-Content $mapListPath
- $finalGametypeList = Get-Content $gametypeListPath
- $mapcycle = ""
- For ($i=0; $i -lt $mapcycleSize;$i++) {
- $mapcycle = $mapcycle + "$($finalMapList[$(Get-Random -Minimum 0 -Maximum $finalMapList.Length)]):$($finalGametypeList[$(Get-Random -Minimum 0 -Maximum $finalGametypeList.Length)]):0:16`n"
- }
- $mapcycle = $mapcycle.Trim()
- [System.IO.File]::WriteAllText($mapcyclePath, $mapcycle)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement