Advertisement
Guest User

DKS3 script

a guest
May 8th, 2016
366
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. objStartFolder = "D:\Games\DarkSoulsIII\Game\Data1"   'Path to execute stuff in, change to whatever
  2. binderToolPath = "D:\Games\DarkSoulsIII\Game\bindertool.exe"
  3. texConvPath = "D:\Games\DarkSoulsIII\Game\texconv.exe"
  4.  
  5. Set objFSO = CreateObject("Scripting.FileSystemObject")
  6. Set objFolder = objFSO.GetFolder(objStartFolder)
  7. Set oShell = CreateObject ("WScript.Shell")
  8. Set objSuperFolder = objFSO.GetFolder(objStartFolder)
  9.  
  10.  
  11. '******** Start bindertool to extract all BND, comment/remove line if you don't want it
  12. Call ExtractBND (objSuperFolder)
  13.  
  14. '******** Start bindertool to extract all TPF, comment/remove line if you don't want it
  15. Call ExtractTPF (objSuperFolder)
  16.  
  17. '******** Start texconv to convert DDS to PNG, comment/remove line if you don't want it
  18. Call ConvertDDS (objSuperFolder)
  19.  
  20. Sub ExtractBND(fFolder)
  21.     Set objFolder = objFSO.GetFolder(fFolder.Path)
  22.     Set colFiles = objFolder.Files
  23.     For Each objFile in colFiles
  24.         If UCase(objFSO.GetExtensionName(objFile.Name)) = "BND" Then
  25.         runline = "cmd.exe /c " & binderToolPath & " " & objFile.Path
  26.         wscript.echo runline
  27.         oShell.run runline 
  28.         End if
  29.     Next
  30.  
  31.     For Each Subfolder in fFolder.SubFolders
  32.         ExtractTPF(Subfolder)
  33.     Next
  34. End Sub
  35.  
  36. Sub ExtractTPF(fFolder)
  37.     Set objFolder = objFSO.GetFolder(fFolder.Path)
  38.     Set colFiles = objFolder.Files
  39.     For Each objFile in colFiles
  40.         If UCase(objFSO.GetExtensionName(objFile.Name)) = "TPF" Then
  41.         runline = "cmd.exe /c " & binderToolPath & " " & objFile.Path
  42.         wscript.echo runline
  43.         oShell.run runline 
  44.         End if
  45.     Next
  46.  
  47.     For Each Subfolder in fFolder.SubFolders
  48.         ExtractTPF(Subfolder)
  49.     Next
  50. End Sub
  51.  
  52. Sub ConvertDDS(fFolder)
  53.     Set objFolder = objFSO.GetFolder(fFolder.Path)
  54.     Set colFiles = objFolder.Files
  55.     For Each objFile in colFiles
  56.         If UCase(objFSO.GetExtensionName(objFile.Name)) = "DDS" Then
  57.         runline = "cmd.exe /c " & texConvPath & " -ft PNG " & objFile.Path & " -o " & objFile.ParentFolder
  58.         wscript.echo runline
  59.         oShell.run runline 
  60.         End if
  61.     Next
  62.  
  63.     For Each Subfolder in fFolder.SubFolders
  64.         ConvertDDS(Subfolder)
  65.     Next
  66. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement