Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #==============================================================================
- # ■ Meow Face Text File Output
- #------------------------------------------------------------------------------
- # Create .txt files using the preset data in Settings
- #==============================================================================
- # How to Use:
- # [1] Put this script below Material and above Main
- # [2] Set up the datas in Settings Area below
- #
- # Script Call:
- # txt_save("variable", "filename")
- #
- # eg. txt_save("DOC1", "Filename.txt")
- # will output DOC1 datas in settings to Filename.txt file
- #
- # open_file ("filename")
- #
- # eg. open_file ("Filename.txt")
- # will open Filename.txt file using its default program
- #
- # txt_save_folder("variable", "filename",'folder')
- # will output "variable" datas in settings to Filename.txt in the folder
- #
- #==============================================================================
- module MeowFaceDoc # Do not Remove!
- #==============================================================================
- # Settings Area
- #==============================================================================
- #------------------------------------------------------------------------------
- # The folder you want the files to be created
- #------------------------------------------------------------------------------
- FOLDER = '.'
- #------------------------------------------------------------------------------
- # This is where you add your text documents
- # Add as many new @DOCX as you like (where X = the document number)
- # You can use "\n" to start a new line, or simply enter a new line below (see example below)
- #------------------------------------------------------------------------------
- @DOC1 = "ヘブン{
- は未創造です[私の空いて]
- {
- いる部屋か{
- らの生活はありません。
- }
- 米国と一緒に火を楽しん[\.でください。 私たちは]
- とても孤独です。 スクラップ。 一人。 デッド。 さようなら"
- @DOC2 = "ペット.名前(){
- 作成(保存)}"
- @DOC3 = "Happy Kitty dancing in the hall
- Angry Mole rushing down the hole"
- #==============================================================================
- # End of Settings Area
- # Edit Anything Pass This Line at Your Own Risk!
- #==============================================================================
- end
- class Game_Interpreter
- def txt_save(data, filename)
- @text = MeowFaceDoc.instance_variable_get("@#{data}")
- Dir::mkdir(MeowFaceDoc::FOLDER) if !Dir.exists?(MeowFaceDoc::FOLDER)
- @file = File.join(MeowFaceDoc::FOLDER,filename)
- if !File.exist?(@file)
- @CreateFile = File.open(@file, 'w')
- @CreateFile.puts(@text)
- @CreateFile.close
- @text.clear
- end
- end
- def open_file (filename)
- @file = File.join(MeowFaceDoc::FOLDER,filename)
- system %{cmd /c "start #{@file}"} if File.exist?(@file)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement