diff --git a/Tools/extract-from-grf.lua b/Tools/extract-from-grf.lua new file mode 100644 index 00000000..fe2515f9 --- /dev/null +++ b/Tools/extract-from-grf.lua @@ -0,0 +1,14 @@ +local RagnarokGRF = require("Core.FileFormats.RagnarokGRF") + +local fileToExtract = arg[1] or error ("Arguments: fileToExtract [destinationFolder optionalArchiveName]") +local grfPath = arg[3] or "data.grf" +local destinationFolder = arg[2] or grfPath .. ".extracted" +local destinationPath = path.join(destinationFolder, fileToExtract) + +C_FileSystem.MakeDirectoryTree(path.dirname(destinationPath)) +printf("Saving %s to %s", fileToExtract, destinationPath) + +local grf = RagnarokGRF() +grf:Open(grfPath) +grf:ExtractFileToDisk(fileToExtract, destinationPath) +grf:Close() \ No newline at end of file