Advertisement
HarvDad

unpackfiles

Apr 18th, 2014
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1.  
  2. function string.starts(String,Start)
  3. return string.sub(String,1,string.len(Start))==Start
  4. end
  5.  
  6. function string.ends(String,End)
  7. return End=='' or string.sub(String,-string.len(End))==End
  8. end
  9.  
  10. fName = ""
  11.  
  12. for line in io.lines("allfiles") do
  13. if string.starts(line, "***") then
  14. fName = string.sub(line, 6)
  15. print("\"", fName, "\"")
  16. io.output(fName)
  17. if outFile ~= nil then
  18. outFile:close()
  19. end
  20. outFile = io.open(fName, "w")
  21. else
  22. print(fName, ": ", line)
  23. outFile:write(line)
  24. outFile:write("\n")
  25. end
  26. end
  27. outFile:close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement