output_directory = "ScriptTexts" # 输出目录
Dir.mkdir(output_directory) unless File.directory?(output_directory)
load_data("Data/Scripts.rvdata2").each_with_index {|script, index|
tag = script[1]
unless tag.empty?
contents = Zlib::Inflate.inflate(script[2].force_encoding("utf-8"))
unless contents.empty?
tag = tag.gsub(/[\\\/\:\"\?\*\<\>\|]/) {'_'}
name = sprintf("#{output_directory}/[%04d]#{tag}.txt", index)
txt = File.open(name, "wb")
txt.write(contents)
txt.close
end
end
}
output_directory = "ScriptTexts" # 输出目录
Dir.mkdir(output_directory) unless File.directory?(output_directory)
load_data("Data/Scripts.rvdata2").each_with_index {|script, index|
tag = script[1]
unless tag.empty?
contents = Zlib::Inflate.inflate(script[2].force_encoding("utf-8"))
unless contents.empty?
tag = tag.gsub(/[\\\/\:\"\?\*\<\>\|]/) {'_'}
name = sprintf("#{output_directory}/[%04d]#{tag}.txt", index)
txt = File.open(name, "wb")
txt.write(contents)
txt.close
end
end
}
靠,居然有人先弄了。