Server Powershell Automation
Use as a logon script with your palworld server. (Works best if you use a dedicated server/vm/pc for this with only palworld server installed via steam.) update your paths.
Theres not a api or command from steam to wait for updates so I gave it a window of 10 minutes to update the palworld server client (Feel free to adjust) and then it launches the server with command arguments for multithreading.
I reboot my server nightly at 5am since thats like the dead zone where no one is playing. And this just kicks off at bootup.
In the future i might find a way of implementing steamCMD to fetch the update but for now this is what i have.
Happy automation!
# Path to Steam executable (replace with the actual path)
$steamPath = 'C:\Program Files (x86)\Steam\Steam.exe'
# Path to Palworld server executable (replace with the actual path)
$palworldServerPath = 'C:\Program Files (x86)\Steam\steamapps\common\PalServer\PalServer.exe'
# Launch options for Palworld
$palworldLaunchOptions = "-useperfthreads -NoAsyncLoadingThread -UseMultithreadForDS"
# Start Steam
Start-Process -FilePath $steamPath
Echo "Launching Steam..."
# Wait for Steam to initialize (adjust the sleep duration as needed)
Start-Sleep -Seconds 25
# Update all games in the library
Start-Process -FilePath "$steamPath" -ArgumentList "-validate" -Wait
Echo "Updating Libary..."
# Wait for 10 minutes for updating (adjust the sleep duration as needed)
Start-Sleep -Seconds 600
# Start Palworld server with launch options
Start-Process -FilePath $palworldServerPath -ArgumentList $palworldLaunchOptions
Echo "Launching Palworld..."
# Close Steam
Stop-Process -Name Steam -Force -ErrorAction SilentlyContinue
Exit
Be the first to comment