Advertisement
Tom_Neverwinter

Hawken resolution and server launcher

Apr 17th, 2023 (edited)
1,601
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. cls
  2. Write-Host "Hawken Launcher" -ForegroundColor Green
  3. Write-Host "=================================="
  4.  
  5. $resX = 1920
  6. $resY = 1080
  7. $gameMode = "Robots.R_TeamDeathmatch"
  8. $timeLimit = 10
  9. $goalScore = 40
  10.  
  11. do {
  12.     Write-Host "Choose an option:"
  13.     Write-Host "1) Change screen resolution"
  14.     Write-Host "2) Set up a Hawken server"
  15.     Write-Host "3) Start Hawken with selected settings"
  16.     Write-Host "4) Exit"
  17.     Write-Host "=================================="
  18.     $mainChoice = Read-Host "Enter your choice (1-4)"
  19.  
  20.     switch ($mainChoice) {
  21.         1 {
  22.             do {
  23.                 cls
  24.                 Write-Host "Hawken Resolution Changer" -ForegroundColor Green
  25.                 Write-Host "=================================="
  26.                 Write-Host "Choose a screen resolution:"
  27.                 Write-Host "1) 1280x720"
  28.                 Write-Host "2) 1366x768"
  29.                 Write-Host "3) 1600x900"
  30.                 Write-Host "4) 1920x1080"
  31.                 Write-Host "5) 2560x1440"
  32.                 Write-Host "6) 3840x2160"
  33.                 Write-Host "7) Back to main menu"
  34.                 Write-Host "=================================="
  35.                 $resChoice = Read-Host "Enter your choice (1-7)"
  36.  
  37.                 switch ($resChoice) {
  38.                     1 { $resX = 1280; $resY = 720; break }
  39.                     2 { $resX = 1366; $resY = 768; break }
  40.                     3 { $resX = 1600; $resY = 900; break }
  41.                     4 { $resX = 1920; $resY = 1080; break }
  42.                     5 { $resX = 2560; $resY = 1440; break }
  43.                     6 { $resX = 3840; $resY = 2160; break }
  44.                     7 { break }
  45.                 }
  46.             } while ($resChoice -eq 7)
  47.         }
  48.         2 {
  49.             do {
  50.                 cls
  51.                 Write-Host "Hawken Server Setup - Game Mode" -ForegroundColor Green
  52.                 Write-Host "=================================="
  53.                 Write-Host "Choose a game mode:"
  54.                 Write-Host "1) Team Deathmatch"
  55.                 Write-Host "2) Deathmatch"
  56.                 Write-Host "3) Back to main menu"
  57.                 Write-Host "=================================="
  58.                 $gameModeChoice = Read-Host "Enter your choice (1-3)"
  59.  
  60.                 switch ($gameModeChoice) {
  61.                     1 { $gameMode = "Robots.R_TeamDeathmatch"; break }
  62.                     2 { $gameMode = "Robots.R_Deathmatch"; break }
  63.                     3 { break }
  64.                 }
  65.  
  66.                 if ($gameModeChoice -ne 3) {
  67.                     do {
  68.                         cls
  69.                         Write-Host "Hawken Server Setup - Time Limit" -ForegroundColor Green
  70.                         Write-Host "=================================="
  71.                         Write-Host "Choose a time limit:"
  72.                         Write-Host "1) 10 minutes"
  73.                         Write-Host "2) 15 minutes"
  74.                         Write-Host "3) 20 minutes"                        
  75.                         Write-Host "4) Back to game mode menu"
  76.                         Write-Host "=================================="
  77.                         $timeChoice = Read-Host "Enter your choice (1-4)"
  78.  
  79.                         switch ($timeChoice) {
  80.                             1 { $timeLimit = 10; break }
  81.                             2 { $timeLimit = 15; break }
  82.                             3 { $timeLimit = 20; break }
  83.                             4 { break }
  84.                         }
  85.  
  86.                         if ($timeChoice -ne 4) {
  87.                             do {
  88.                                 cls
  89.                                 Write-Host "Hawken Server Setup - Goal Score" -ForegroundColor Green
  90.                                 Write-Host "=================================="
  91.                                 Write-Host "Choose a goal score:"
  92.                                 Write-Host "1) 40 points"
  93.                                 Write-Host "2) 60 points"
  94.                                 Write-Host "3) 80 points"
  95.                                 Write-Host "4) Back to time limit menu"
  96.                                 Write-Host "=================================="
  97.                                 $scoreChoice = Read-Host "Enter your choice (1-4)"
  98.  
  99.                                 switch ($scoreChoice) {
  100.                                     1 { $goalScore = 40; break }
  101.                                     2 { $goalScore = 60; break }
  102.                                     3 { $goalScore = 80; break }
  103.                                     4 { break }
  104.                                 }
  105.                             } while ($scoreChoice -eq 4)
  106.                             break
  107.                         }
  108.                     } while ($timeChoice -eq 4)
  109.                     break
  110.                 }
  111.             } while ($gameModeChoice -eq 3)
  112.         }
  113.         3 {
  114.             Write-Host "Starting Hawken with $resX x $resY resolution, game mode $gameMode, time limit $timeLimit minutes, and goal score $goalScore..."
  115.             Start-Process -FilePath ".\HawkenGame-Win32-Shipping.exe" -ArgumentList "-FULLSCREEN -resx=$resX -resy=$resY", "Server Sahara_DM_E3?NumPublicConnections=16?GoalScore=$goalScore?TimeLimit=$timeLimit?bIsLanMatch=True?game=$gameMode -log"
  116.             break
  117.         }
  118.         4 { exit }
  119.     }
  120. } while ($mainChoice -ne 4)
  121.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement