Last active
August 15, 2022 10:38
-
-
Save ThaSiouL/c5b773d044ed9a341becfab5ce6fc5aa to your computer and use it in GitHub Desktop.
Sekiro savegame backup script. Credits for Original DS1 Remaster: https://reddit.com/u/AikonCWD https://github.com/aikoncwd/DS1-backup-tool
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''''''''''''''''''''''''''''''''''''''' | |
'' START CONFIG SECTION - EDIT THIS! '' | |
''''''''''''''''''''''''''''''''''''''' | |
SavegamePath = "\Sekiro\YOUR-STEAM-ID" 'to find your folder name: press Win+R, type in "%Appdata%\Sekiro" and press Enter. Copy the folder name. | |
SavegameFile = "S0000.sl2" 'Save Slot 1 | |
MaxBackupFiles = 10 'Number of maximun backup savegame files. 25 is ok | |
TimeBetweenBackups = 300000 'in ms: 1000 => 1sec | 180000 => 3 minutes | 600000 => 10 minutes | |
''''''''''''''''''''''''''''''''''''''' | |
'' END CONFIG SECTION - STOP EDITING '' | |
''''''''''''''''''''''''''''''''''''''' | |
Set oFSO = CreateObject("Scripting.FileSystemObject") | |
Set oWSH = CreateObject("WScript.Shell") | |
Set oWMI = GetObject("winmgmts:\\.\root\CIMV2") | |
Dim appDataPath | |
appDataPath = oWSH.expandEnvironmentStrings("%APPDATA%") | |
' Check if the config is OK, there must be a valid savegame on the given path... | |
If oFSO.FileExists(appDataPath & SavegamePath & "\" & SavegameFile) = False Then | |
MsgBox "There is a problem in your config, the file:" & vbCrLf & vbCrLf & appDataPath & SavegamePath & "\" & SavegameFile & vbCrLf & vbCrLf & "is missing!", vbError + vbOkOnly, "Sekiro Savegame Backup Tool" | |
WScript.Quit | |
End If | |
' Check if Sekiro is running, if not: execute it! | |
If isSekiroPlaying = False Then | |
oWSH.Run "steam://rungameid/814380" | |
WScript.Sleep 300000 ' Wait 5 Minutes until we start the backup routine | Value increased to prevent save corrupted file overwriting backup on startup | |
End If | |
counter = 1 | |
Do | |
If isSekiroPlaying = False Then | |
WScript.Quit ' Stop the backup-tool if Sekiro is closed | |
End If | |
oFSO.CopyFile appDataPath & SavegamePath & "\" & SavegameFile, appDataPath & SavegamePath & "\" & counter & "-" & SavegameFile | |
counter = counter + 1 | |
If counter > MaxBackupFiles Then counter = 1 | |
WScript.Sleep TimeBetweenBackups ' Wait until we backup the savegame again | |
Loop | |
' Routine to check if Sekiro is executed | |
Function isSekiroPlaying() | |
Set cProcess = oWMI.ExecQuery("Select * from Win32_Process") | |
isSekiroPlaying = False | |
For Each oProcess in cProcess | |
If UCase(oProcess.Name) = "SEKIRO.EXE" Then isSekiroPlaying = True | |
Next | |
End Function | |
' Credits /u/AikonCWD | |
' https://github.com/aikoncwd/DS1-backup-tool | |
' Version = 2.0 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment