Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -------------------
- -- decodeSTA.lua --
- -------------------
- -- For some game, I don't even know what it is lol.
- -- Run this within a folder with some STA files in it.
- -- TXT file conversions will be created in the same folder.
- -- Pre-existing TXT files will be replaced without prompting.
- require "lfs"
- for entry in lfs.dir(lfs.currentdir()) do if entry:sub(-4):lower() == ".sta" then
- local input = io.open(entry, "rb")
- local output = io.open(entry:sub(1, #entry - 3) .. "txt", "w")
- local strCount = 0
- input:read(16) -- header crap, skip for now
- while true do
- local long = input:read(4)
- if not long then break end
- output:write("\n*Do*Not*Edit*This*Line* " .. strCount .. "\n" .. input:read(long:byte(1) * 256^3 + long:byte(2) * 256^2 + long:byte(3) * 256 + long:byte(4)))
- strCount = strCount + 1
- end
- input:close()
- output:close()
- end end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement