Advertisement
Guest User

Untitled

a guest
Oct 28th, 2018
274
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.09 KB | None | 0 0
  1. #Location of Arma 3 server exe
  2. $CMD= 'C:\Program Files (x86)\Steam\steamapps\common\Arma 3\arma3server_x64_performance_184_144943_v01.exe'
  3.  
  4. #Directory of server profile data
  5. $profileDir='C:\Program Files (x86)\Steam\steamapps\common\Arma 3\Arma 3 Run Scripts\Arma 3 Server Profiles\s7MainServer\'
  6. #Details on this folder can be found here:
  7. #https://community.bistudio.com/wiki/server.cfg
  8. $profiles='"-config=' + $profileDir + 'config.cfg"'
  9. #Details on this folder can be found here:
  10. #https://community.bistudio.com/wiki/basic.cfg
  11. $profiles+='"-cfg=' + $profileDir + 'basic.cfg"'
  12. #Setting the directory of server profile data.
  13. #This is the directory that contains all the server logs
  14. $profiles+='"-profiles=' + $profileDir + '"'
  15.  
  16. #Parameters for the server
  17. #All parameters can be found here
  18. #https://community.bistudio.com/wiki/Arma_3_Startup_Parameters
  19. $args='-malloc=cma_x64.dll -enableHT -exThreads=7 -hugePages -cpuCount=4 -noPause -name=S7 -port=2302'
  20.  
  21. #Change mod directory to Workshop folder
  22. $modDir='C:\Program Files (x86)\Steam\steamapps\common\Arma 3\!Workshop\'
  23.  
  24. #Add mods from Worksop folder to the server startup
  25. $mods=' "-mod=argo;curator;heli;jets;kart;mark;orange;'
  26. $mods+= $modDir + '@CBA_A3' + ';'
  27. $mods+= $modDir + '@S7-COMPAT' + ';'
  28. $mods+= $modDir + '@Ctab Blufor Tracker' + ';'
  29. $mods+= $modDir + '@CUP Terrains - Core' + ';'
  30. $mods+= $modDir + '@CUP Terrains - CWA' + ';'
  31. $mods+= $modDir + '@CUP Terrains - Maps' + ';'
  32. $mods+= $modDir + '@G.O.S Al Rayak' + ';'
  33. $mods+= $modDir + '@Enhanced Movement' + ';'
  34. $mods+= $modDir + '@Project OPFOR' + ';'
  35. $mods+= $modDir + '@RHSAFRF' + ';'
  36. $mods+= $modDir + '@RHSGREF' + ';'
  37. $mods+= $modDir + '@RHSSAF' + ';'
  38. $mods+= $modDir + '@RHSUSAF' + ';'
  39. $mods+= $modDir + '@Specialist Military Arms (SMA) Version 2.7.1' + ';'
  40. $mods+= $modDir + '@Task Force Arrowhead Radio (BETA!!!)' + ';'
  41. $mods+= $modDir + '@VSM All-In-One Collection' + ';'
  42. $mods+= '"'
  43.  
  44. #Add mods from Worksop folder to the server startup
  45. #$modDir='C:\Program Files (x86)\Steam\steamapps\common\Arma 3\!Workshop\'
  46.  
  47. $mods+= ' "-serverMod='
  48. $mods+= $modDir + '@Advanced Sling Loading' + ';'
  49. $mods+= $modDir + '@Achilles' + ';'
  50. $mods+= $modDir + '@Blastcore Edited (standalone version)' + ';'
  51. $mods+= $modDir + '@RHS HMDs' + ';'
  52. $mods+= $modDir + '@ShackTac User Interface' + ';'
  53. $mods+= $modDir + '@HMDs MOD' + ';'
  54. $mods+= $modDir + '@Lingor+Dingor Island v3.82' + ';'
  55. $mods+= $modDir + '@Diyala Map' + ';'
  56. $mods+= $modDir + '@PLP Containers' + ';'
  57.  
  58. #Changing the mod directory to to the extra mods folder
  59. $modDir='C:\Users\Administrator\Documents\Arma 3 Mods\'
  60.  
  61. #Add the mods from the extra mods folder to the server startup
  62. $mods+= $modDir + '@[OPXT] Operators eXtreme Tactical - Task Force Radio 1.0 Addons' + ';'
  63. $mods+= '"'
  64.  
  65. $args=$profiles + $args
  66. $args+=$mods
  67.  
  68. $server = Start-Process -FilePath $CMD -ArgumentList $args -passthru
  69. $server.ProcessorAffinity=15
  70. $server.PriorityClass = 'High'
  71.  
  72. #Restart Sript
  73.  
  74. $H = Get-Host
  75. $Win = $H.UI.RawUI.WindowSize
  76. $Win.Height = 10
  77. $Win.Width = 65
  78. $H.UI.RawUI.Set_WindowSize($Win)
  79.  
  80. #When to Restart in HHmmss
  81. $restartTime = 070000
  82. $restartCounter = 0
  83. Register-EngineEvent PowerShell.Exiting -Action {Stop-Process -id $server.Id}
  84. while ($true) {
  85. #Get time and convert into Int
  86. $time = [convert]::ToInt32((Get-Date -Format HHmmss), 10)
  87. #If between restartTime and restartTime + 10 shut down the server and restart
  88. if (($time -ge $restartTime) -and ($time -le ($restartTime + 2))) {
  89. Clear-Host
  90. Stop-Process -id $server.Id
  91. $restartCounter++
  92. Start-Sleep -Seconds 3
  93. $server = Start-Process -FilePath $CMD -ArgumentList $args -passthru
  94. $server.ProcessorAffinity=15
  95. $server.PriorityClass = 'High'
  96. }
  97. #If process is not found shut down the script
  98. if (Get-Process -Id $server.Id){
  99. Clear-Host
  100. "S7 Main Sever"
  101. Get-Process -Id $server.Id
  102. "Amount of times restarted:"+$restartCounter
  103. } else {
  104. Clear-Host
  105. ""
  106. ""
  107. "Server Not Found"
  108. "Shutting Down."
  109. Start-Sleep -Seconds 3
  110. Break
  111. }
  112. Start-Sleep -Seconds 1
  113. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement