Advertisement
Guest User

DKS3script

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