Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Location of Arma 3 server exe
- $CMD= 'C:\Program Files (x86)\Steam\steamapps\common\Arma 3\arma3server_x64_performance_184_144943_v01.exe'
- #Directory of server profile data
- $profileDir='C:\Program Files (x86)\Steam\steamapps\common\Arma 3\Arma 3 Run Scripts\Arma 3 Server Profiles\s7MainServer\'
- #Details on this folder can be found here:
- #https://community.bistudio.com/wiki/server.cfg
- $profiles='"-config=' + $profileDir + 'config.cfg"'
- #Details on this folder can be found here:
- #https://community.bistudio.com/wiki/basic.cfg
- $profiles+='"-cfg=' + $profileDir + 'basic.cfg"'
- #Setting the directory of server profile data.
- #This is the directory that contains all the server logs
- $profiles+='"-profiles=' + $profileDir + '"'
- #Parameters for the server
- #All parameters can be found here
- #https://community.bistudio.com/wiki/Arma_3_Startup_Parameters
- $args='-malloc=cma_x64.dll -enableHT -exThreads=7 -hugePages -cpuCount=4 -noPause -name=S7 -port=2302'
- #Change mod directory to Workshop folder
- $modDir='C:\Program Files (x86)\Steam\steamapps\common\Arma 3\!Workshop\'
- #Add mods from Worksop folder to the server startup
- $mods=' "-mod=argo;curator;heli;jets;kart;mark;orange;'
- $mods+= $modDir + '@CBA_A3' + ';'
- $mods+= $modDir + '@S7-COMPAT' + ';'
- $mods+= $modDir + '@Ctab Blufor Tracker' + ';'
- $mods+= $modDir + '@CUP Terrains - Core' + ';'
- $mods+= $modDir + '@CUP Terrains - CWA' + ';'
- $mods+= $modDir + '@CUP Terrains - Maps' + ';'
- $mods+= $modDir + '@G.O.S Al Rayak' + ';'
- $mods+= $modDir + '@Enhanced Movement' + ';'
- $mods+= $modDir + '@Project OPFOR' + ';'
- $mods+= $modDir + '@RHSAFRF' + ';'
- $mods+= $modDir + '@RHSGREF' + ';'
- $mods+= $modDir + '@RHSSAF' + ';'
- $mods+= $modDir + '@RHSUSAF' + ';'
- $mods+= $modDir + '@Specialist Military Arms (SMA) Version 2.7.1' + ';'
- $mods+= $modDir + '@Task Force Arrowhead Radio (BETA!!!)' + ';'
- $mods+= $modDir + '@VSM All-In-One Collection' + ';'
- $mods+= '"'
- #Add mods from Worksop folder to the server startup
- #$modDir='C:\Program Files (x86)\Steam\steamapps\common\Arma 3\!Workshop\'
- $mods+= ' "-serverMod='
- $mods+= $modDir + '@Advanced Sling Loading' + ';'
- $mods+= $modDir + '@Achilles' + ';'
- $mods+= $modDir + '@Blastcore Edited (standalone version)' + ';'
- $mods+= $modDir + '@RHS HMDs' + ';'
- $mods+= $modDir + '@ShackTac User Interface' + ';'
- $mods+= $modDir + '@HMDs MOD' + ';'
- $mods+= $modDir + '@Lingor+Dingor Island v3.82' + ';'
- $mods+= $modDir + '@Diyala Map' + ';'
- $mods+= $modDir + '@PLP Containers' + ';'
- #Changing the mod directory to to the extra mods folder
- $modDir='C:\Users\Administrator\Documents\Arma 3 Mods\'
- #Add the mods from the extra mods folder to the server startup
- $mods+= $modDir + '@[OPXT] Operators eXtreme Tactical - Task Force Radio 1.0 Addons' + ';'
- $mods+= '"'
- $args=$profiles + $args
- $args+=$mods
- $server = Start-Process -FilePath $CMD -ArgumentList $args -passthru
- $server.ProcessorAffinity=15
- $server.PriorityClass = 'High'
- #Restart Sript
- $H = Get-Host
- $Win = $H.UI.RawUI.WindowSize
- $Win.Height = 10
- $Win.Width = 65
- $H.UI.RawUI.Set_WindowSize($Win)
- #When to Restart in HHmmss
- $restartTime = 070000
- $restartCounter = 0
- Register-EngineEvent PowerShell.Exiting -Action {Stop-Process -id $server.Id}
- while ($true) {
- #Get time and convert into Int
- $time = [convert]::ToInt32((Get-Date -Format HHmmss), 10)
- #If between restartTime and restartTime + 10 shut down the server and restart
- if (($time -ge $restartTime) -and ($time -le ($restartTime + 2))) {
- Clear-Host
- Stop-Process -id $server.Id
- $restartCounter++
- Start-Sleep -Seconds 3
- $server = Start-Process -FilePath $CMD -ArgumentList $args -passthru
- $server.ProcessorAffinity=15
- $server.PriorityClass = 'High'
- }
- #If process is not found shut down the script
- if (Get-Process -Id $server.Id){
- Clear-Host
- "S7 Main Sever"
- Get-Process -Id $server.Id
- "Amount of times restarted:"+$restartCounter
- } else {
- Clear-Host
- ""
- ""
- "Server Not Found"
- "Shutting Down."
- Start-Sleep -Seconds 3
- Break
- }
- Start-Sleep -Seconds 1
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement