Advertisement
Guest User

Untitled

a guest
Sep 18th, 2019
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #Start Logging - Log @ path below.
  2.     Start-Transcript -Path 'C:\Program Files\Steam\steamapps\arma3server\arma3server-primaryscript.log' -Append
  3.  
  4. <#
  5.     COPY THIS FILE BEFORE EDITING
  6.          
  7.     IF YOU BREAK THE SERVER, PLEASE DO NOT LEAVE IT BROKEN! COMMENT OUT YOUR NEW LINES!
  8.  
  9. #>
  10.  
  11. ## DEFAULT MODS
  12. #Mod Command Line
  13.  
  14.     #Ensure mod command line is cleared.
  15.             $mod = ""
  16.             $modNameList = ""
  17.             $modIDList = ""
  18.     #Mod By Load Order
  19.             #Core Mods
  20.             $mod = [pscustomobject]@(@{ModName="@CBA_A3";ModID="450814997"})
  21.             $mod += [pscustomobject]@(@{ModName="@ace";ModID="463939057"})
  22.             $mod += [pscustomobject]@(@{ModName="@ACEX";ModID="708250744"})
  23.             $mod += [pscustomobject]@(@{ModName="@CUPTerrains_C";ModID="583496184"})
  24.             $mod += [pscustomobject]@(@{ModName="@RHSAFRF";ModID="843425103"})
  25.             $mod += [pscustomobject]@(@{ModName="@RHSUSAF";ModID="843577117"})
  26.             $mod += [pscustomobject]@(@{ModName="@RHSGREF";ModID="843593391"})
  27.             $mod += [pscustomobject]@(@{ModName="@tfar_beta";ModID="894678801"})
  28.  
  29.             #Mod Compats
  30.             $mod += [pscustomobject]@(@{ModName="@ACEC-USAF";ModID="773125288"})
  31.             $mod += [pscustomobject]@(@{ModName="@ACEC-AFRF";ModID="773131200"})
  32.             $mod += [pscustomobject]@(@{ModName="@ACEC-GREF";ModID="884966711"})
  33.  
  34.             #Maps
  35.             $mod += [pscustomobject]@(@{ModName="@CUPTerrains_M";ModID="583544987"})
  36.             $mod += [pscustomobject]@(@{ModName="@Anizay";ModID="1537973181"})
  37.             $mod += [pscustomobject]@(@{ModName="@Leskovets";ModID="855464203"})
  38.             $mod += [pscustomobject]@(@{ModName="@Reshmaan";ModID="843362862"})
  39.             $mod += [pscustomobject]@(@{ModName="@Kunduz";ModID="421620913"})
  40.  
  41.             #Vehicles
  42.             $mod += [pscustomobject]@(@{ModName="@MELB";ModID="561177050"})
  43.             $mod += [pscustomobject]@(@{ModName="@FA18";ModID="743099837"})
  44.             $mod += [pscustomobject]@(@{ModName="@6X6";ModID="1190934425"})
  45.  
  46.             #Fancy Vehicle Mods
  47.             $mod += [pscustomobject]@(@{ModName="@ITC";ModID="1321663083"})
  48.             $mod += [pscustomobject]@(@{ModName="@ITCLand";ModID="1388192893"})
  49.             $mod += [pscustomobject]@(@{ModName="@ITC-RHSUSAFCompat";ModID="1501132392"})
  50.             $mod += [pscustomobject]@(@{ModName="@ITCLand-USAFCompat";ModID="1393769392"})
  51.  
  52.             #WTF I dunno
  53.             $mod += [pscustomobject]@(@{ModName="@tfw_radios";ModID="873999690"})
  54.             $mod += [pscustomobject]@(@{ModName="@MLO";ModID="823636749"})
  55.             $mod += [pscustomobject]@(@{ModName="@SMA";ModID="699630614"})
  56.             $mod += [pscustomobject]@(@{ModName="@ProjectOPFOR";ModID="735566597"})
  57.  
  58.             #UI Enhancements
  59.             $mod += [pscustomobject]@(@{ModName="@EMove";ModID="333310405"})
  60.             $mod += [pscustomobject]@(@{ModName="@DUI";ModID="1638341685"})
  61.  
  62.             #Propriatary
  63.             $mod += [pscustomobject]@(@{ModName="@16thJSOC";ModID="1609947849"})
  64.  
  65. #SERVER SHIT BELOW THIS LINE - SERVER SHIT BELOW THIS LINE - SERVER SHIT BELOW THIS LINE - SERVER SHIT BELOW THIS LINE - SERVER SHIT BELOW THIS LINE
  66. #SERVER SHIT BELOW THIS LINE - SERVER SHIT BELOW THIS LINE - SERVER SHIT BELOW THIS LINE - SERVER SHIT BELOW THIS LINE - SERVER SHIT BELOW THIS LINE
  67. #SERVER SHIT BELOW THIS LINE - SERVER SHIT BELOW THIS LINE - SERVER SHIT BELOW THIS LINE - SERVER SHIT BELOW THIS LINE - SERVER SHIT BELOW THIS LINE
  68.  
  69. #!!!FUCK OFF DO NOT EDIT!!!
  70. #This is for Talven to screw with.
  71.  
  72.             $modAdded = 0
  73.             foreach ($i in $mod) {
  74.                 $modAdded += 1
  75.                 if (-not ($modAdded -eq $mod.Count)) {
  76.                     $modNameList += $i.ModName + "; "
  77.                 } elseif ($modAdded -eq $mod.Count) {
  78.                     $modNameList += $i.ModName
  79.                 }
  80.             }
  81.  
  82.  
  83.     #Server Only Mods
  84.         $serveronlymod='@VCOM;'
  85.  
  86.  
  87.  
  88. ## STOP RUNNING SERVER
  89.     Stop-Process -Name arma3server* -Force  #We need to start doing this by process ID. -T
  90.  
  91. #Let's update Arma 3!
  92. # http://media.steampowered.com/installer/steamcmd.zip
  93.  
  94.     #$SteamLogin="Anonymous"
  95.     #$SteamLogin=""
  96.     #$SteamPass=""
  97.     $SteamLogin=""
  98.     $SteamPass=""
  99.     $ServerBRANCH="233780 -beta"
  100.         # For stable use 233780 -beta
  101.         # For Dev use 233780 -beta development
  102.                 # Note, the missing qotation marks, these need to be wrapped around the entire "+app_data......"
  103.                 # There is no DEV branch data yet for Arma 3 Dedicated Server package !!!
  104.  
  105.     $ServerPath="C:\Program Files\Steam\steamapps\Arma3Server"
  106.     $SteamPath="C:\Program Files\Steam"
  107.  
  108. & $SteamPath\steamcmd.exe +login $SteamLogin $SteamPass +force_install_dir $ServerPath +"app_update $ServerBRANCH" validate +quit
  109.  
  110. #Let's update mods!
  111. foreach ($i in $mod) {
  112.     $WorkshopDownloadItem = '+workshop_download_item "107410 ' + $i.ModID + '"'
  113.     & $SteamPath\steamcmd.exe +login $STEAMLOGIN $Steampass $WorkshopDownloadItem +quit
  114.     Write-Host "Errorlevel: "$LASTEXITCODE
  115.     if ($LASTEXITCODE -eq 0) {
  116.         $ModName = $i.ModName
  117.         $ModID = $i.ModID
  118.         Remove-Item $ModName -ErrorAction SilentlyContinue
  119.         if (-not (test-path "$ServerPath\$ModName")) {
  120.             md "$ServerPath\$ModName"
  121.         }
  122.         Write-Host 'Copying '$Modname' to arma directory.'
  123.         Copy-Item -Recurse "$SteamPath\steamapps\workshop\content\107410\$ModID\*" "$ServerPath\$ModName" -Force
  124.     } else {
  125.         Write-Host "ERROR DOWNLOADING: "$i.ModName
  126.     }
  127. }
  128.  
  129. ## SERVER COMMAND LINE
  130.     #$servermodcmd = ('"' + $mod + '"') #Wrap above mods in quotes so we don't confuse Bohemia.
  131.     $servermodcmd = ('"' + $modNameList + '"') #Wrap above mods in quotes so we don't confuse Bohemia.
  132.     $serveronlymodcmd = ('"' + $serveronlymod + '"') #Wrap above mods in quotes so we don't confuse Bohemia.
  133.     CD "C:\Program Files\Steam\steamapps\arma3server\"
  134. #Test with -netlog ensure all proper logging still happens.
  135.     Write-Host "Staring Arma 3 server..."
  136.     Write-Host C:\Progra~1\Steam\steamapps\arma3server\arma3server_x64.exe "-profiles=C:\Progra~1\Steam\steamapps\arma3server\" -filepatching -port=2302 -config="server.cfg" -mod="$servermodcmd" -serverMod="$serveronlymodcmd"
  137.  
  138. #Wait for server startup.
  139.     Start-Sleep -s 60
  140.  
  141. #Start headless client.
  142.     #$headlessmodcmd = ('"' + $mod + $serveronlymod + '"') #Wrap above mods in quotes so we don't confuse Bohemia.
  143.     #C:\Progra~1\Steam\steamapps\arma3server\arma3server_x64.exe "-profiles=C:\Progra~1\Steam\steamapps\arma3server\" -client -nosound -connect="127.0.0.1:2302" -mod="$headlessmodcmd"
  144.     #Start-Sleep -s 60
  145.  
  146. #Set Arma 3 Server Process to HIGH priority.
  147.     Write-Host "Setting process to high priority..."
  148.     $arma3process = (Get-Process Arma3Server_x64) #We need to do this by process ID. -T
  149.  
  150.     foreach ($process in $arma3process) {
  151.         $process.PriorityClass = "High"
  152.     }
  153.  
  154. #Stop Logging
  155. Write-Host "Startup complete."    
  156. Stop-Transcript
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement