Middle-earth™: Shadow of War™ Guide

Backup save script for Middle-earth™: Shadow of War™

Backup save script

Overview

Backup save script I madeMade a script with Autohotkey that will make backups of your(my) saves. I would compile it so people don’t need autohotkey but last time I did that I had morons talking about virusus because of the way it packs files(I guess?) and the false positives.So thi is easier for meTake the code paste it in noptepad and name it “Whateveryouwant.ahk” put it in a place that is easy for you to find than download and install autohotkey(free) so you can run it.I have it so that it will only ask where Steam is installed one time and than saves the location in a INI file in the same folder I told it to backup the saves to. The Hotkeys are: ALT+Q QuitN Backup save filesTommorow I will addon a way to replace the current saves with older ones with a press of a key like the backup key #NoEnv#SingleInstance Force;==========================================;Shadow of War Program Files (x86)SteamSteamuserdataXXXXXXXX356190;Shadow of War Second Save Location C:UsersXXXXXXXXXAppDataLocalwb gamesShadow of War;—————;The folder to be created for backed up saves in My DocumentsShadow of Warflenme = %A_MyDocuments%ShadowofWar;========;INI File reading for user settingsIniRead, usrstng1, %flenme%SOWSavebckp.ini, section1, key3;========;+++++++++++++IF usrstng1 =7{IniRead, Steamsaves , %flenme%SOWSavebckp.ini, section1, key1IniRead, Steamsaves2, %flenme%SOWSavebckp.ini, section1, key2}Else{;===========================================;Finding Steams correct location for save file extractionFileSelectFile, SelectedFile, 3, C:Program Files (x86)SteamSteam, Find Steam’s Exe, Steam (Steam.exe)if SelectedFile = MsgBox, Must select Steam.exe EXITING.else StringTrimRight, OutputVar, SelectedFile, 10 MsgBox, %OutputVar%userdata fldr1 = %OutputVar%userdataIf( InStr( FileExist(fldr1), “D”) ){FileList =Loop, Files, %fldr1%*.* , FD FileList = %FileList%%A_LoopFileTimeModified%`t%A_LoopFileName%`nSort, FileList ,R ; Sort by date.Loop, Parse, FileList, `n{ if A_LoopField = continue StringSplit, FileItem, A_LoopField, %A_Tab% Steamsaves = %fldr1%%FileItem2%356190 break}};===========================================;===========================================;Finding Windows Appdata location for SOW’s second save file extractionflct = %A_AppData%;MsgBox %flct%flct = %A_AppData%StringTrimRight, OutputVar, flct, 8;MsgBox % OutputVarSteamsaves2 = %OutputVar%Localwb gamesShadow of War;===========================================;========;INI File writing for settings to be “remembered”IniWrite, %Steamsaves% , %flenme%SOWSavebckp.ini, section1, key1IniWrite, %Steamsaves2%, %flenme%SOWSavebckp.ini, section1, key2;This value is a arbitrary value to designate that the settings are saved , no need to ask user again;For locationsIniWrite, 7, %flenme%SOWSavebckp.ini, section1, key3;========};+++++++++++++;========;Diag messageboxes for troubleshooting;msgbox % Steamsaves;MsgBox % Steamsaves2;========;Creating Save folders for backup of saves games;Each save backed up twice incase of corruption;Variable definition;save1 = Program Files (x86)SteamSteamuserdataXXXXXXXX356190;save1a = C:UsersXXXXXXXXAppDataLocalwb gamesShadow of War;save2 and save2a = Secondary backup incase of corruption (mirror of save1 and 1a)IfNotExist, %flenme%fldr5 = 356190fldr2 = Shadow of WarFileCreateDir, %flenme%save1%fldr5%FileCreateDir, %flenme%save1a%fldr5%FileCreateDir, %flenme%save2%fldr2%FileCreateDir, %flenme%save2a%fldr2%;—————;Pause script (usualy so you can write in chat etc…)hotkey, <!q, Psescipt;Exit scripthotkey, NumpadAdd, emergencyshutdwn;Save keyhotkey, N , savebckpreturn;++++++++++++++++++++++++++++++++++++++++++++++++++++++emergencyshutdwn: ExitApp Return;++++++++++++++++++++++++++++++++++++++++++++++++++++++Psescipt:SuspendPause,,1SoundBeepreturn;++++++++++++++++++++++++++++++++++++++++++++++++++++++savebckp: If getkeystate(a_thishotkey, "p"){Sleep, 100;Save files backed up twice incase of corruption;Shadow of War has two save folder locations so I made twofldr5 = 356190fldr2 = Shadow of WarFileCopyDir, %Steamsaves% , %flenme%save1%fldr5% , 1FileCopyDir, %Steamsaves% , %flenme%save1a%fldr5% , 1FileCopyDir, %Steamsaves2%, %flenme%save2%fldr2% , 1FileCopyDir, %Steamsaves2%, %flenme%save2a%fldr2% , 1Sleep, 200SoundBeep}return;++++++++++++++++++++++++++++++++++++++++++++++++++++++

Script

#NoEnv #SingleInstance Force ;========================================== ;Shadow of War Program Files (x86)SteamSteamuserdataXXXXXXXX356190 ;Shadow of War Second Save Location C:UsersXXXXXXXXXAppDataLocalwb gamesShadow of War ;————— ;The folder to be created for backed up saves in My DocumentsShadow of War flenme = %A_MyDocuments%ShadowofWar ;======== ;INI File reading for user settings IniRead, usrstng1, %flenme%SOWSavebckp.ini, section1, key3 ;======== ;+++++++++++++ IF usrstng1 =7 { IniRead, Steamsaves , %flenme%SOWSavebckp.ini, section1, key1 IniRead, Steamsaves2, %flenme%SOWSavebckp.ini, section1, key2 } Else { ;=========================================== ;Finding Steams correct location for save file extraction FileSelectFile, SelectedFile, 3, C:Program Files (x86)SteamSteam, Find Steam’s Exe, Steam (Steam.exe) if SelectedFile = MsgBox, Must select Steam.exe EXITING. else StringTrimRight, OutputVar, SelectedFile, 10 MsgBox, %OutputVar%userdata fldr1 = %OutputVar%userdata If( InStr( FileExist(fldr1), “D”) ) { FileList = Loop, Files, %fldr1%*.* , FD FileList = %FileList%%A_LoopFileTimeModified%`t%A_LoopFileName%`n Sort, FileList ,R ; Sort by date. Loop, Parse, FileList, `n { if A_LoopField = continue StringSplit, FileItem, A_LoopField, %A_Tab% Steamsaves = %fldr1%%FileItem2%356190 break } } ;=========================================== ;=========================================== ;Finding Windows Appdata location for SOW’s second save file extraction flct = %A_AppData% ;MsgBox %flct% flct = %A_AppData% StringTrimRight, OutputVar, flct, 8 ;MsgBox % OutputVar Steamsaves2 = %OutputVar%Localwb gamesShadow of War ;=========================================== ;======== ;INI File writing for settings to be “remembered” IniWrite, %Steamsaves% , %flenme%SOWSavebckp.ini, section1, key1 IniWrite, %Steamsaves2%, %flenme%SOWSavebckp.ini, section1, key2 ;This value is a arbitrary value to designate that the settings are saved , no need to ask user again ;For locations IniWrite, 7, %flenme%SOWSavebckp.ini, section1, key3 ;======== } ;+++++++++++++ ;======== ;Diag messageboxes for troubleshooting ;msgbox % Steamsaves ;MsgBox % Steamsaves2 ;======== ;Creating Save folders for backup of saves games ;Each save backed up twice incase of corruption ;Variable definition ;save1 = Program Files (x86)SteamSteamuserdataXXXXXXXX356190 ;save1a = C:UsersXXXXXXXXAppDataLocalwb gamesShadow of War ;save2 and save2a = Secondary backup incase of corruption (mirror of save1 and 1a) IfNotExist, %flenme% fldr5 = 356190 fldr2 = Shadow of War FileCreateDir, %flenme%save1%fldr5% FileCreateDir, %flenme%save1a%fldr5% FileCreateDir, %flenme%save2%fldr2% FileCreateDir, %flenme%save2a%fldr2% ;————— ;Pause script (usualy so you can write in chat etc…) hotkey, <!q, Psescipt ;Exit script hotkey, NumpadAdd, emergencyshutdwn ;Save key hotkey, n, savebckp return ;++++++++++++++++++++++++++++++++++++++++++++++++++++++ emergencyshutdwn: ExitApp Return ;++++++++++++++++++++++++++++++++++++++++++++++++++++++ Psescipt: Suspend Pause,,1 SoundBeep return ;++++++++++++++++++++++++++++++++++++++++++++++++++++++ savebckp: If getkeystate(a_thishotkey, “p”) { Sleep, 100 ;Save files backed up twice incase of corruption ;Shadow of War has two save folder locations so I made two fldr5 = 356190 fldr2 = Shadow of War FileCopyDir, %Steamsaves% , %flenme%save1%fldr5% , 1 FileCopyDir, %Steamsaves% , %flenme%save1a%fldr5% , 1 FileCopyDir, %Steamsaves2%, %flenme%save2%fldr2% , 1 FileCopyDir, %Steamsaves2%, %flenme%save2a%fldr2% , 1 Sleep, 200 SoundBeep } return ;++++++++++++++++++++++++++++++++++++++++++++++++++++++
SteamSolo.com