Advertisement
Guest User

Meowface File Script

a guest
Jun 11th, 2021
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.90 KB | None | 0 0
  1. #==============================================================================
  2. # ■ Meow Face Text File Output
  3. #------------------------------------------------------------------------------
  4. # Create .txt files using the preset data in Settings
  5. #==============================================================================
  6. # How to Use:
  7. # [1] Put this script below Material and above Main
  8. # [2] Set up the datas in Settings Area below
  9. #
  10. # Script Call:
  11. # txt_save("variable", "filename")
  12. #
  13. # eg. txt_save("DOC1", "Filename.txt")
  14. # will output DOC1 datas in settings to Filename.txt file
  15. #
  16. # open_file ("filename")
  17. #
  18. # eg. open_file ("Filename.txt")
  19. # will open Filename.txt file using its default program
  20. #
  21. # txt_save_folder("variable", "filename",'folder')
  22. # will output "variable" datas in settings to Filename.txt in the folder
  23. #
  24. #==============================================================================
  25. module MeowFaceDoc # Do not Remove!
  26. #==============================================================================
  27. # Settings Area
  28. #==============================================================================
  29. #------------------------------------------------------------------------------
  30. # The folder you want the files to be created
  31. #------------------------------------------------------------------------------
  32. FOLDER = '.'
  33. #------------------------------------------------------------------------------
  34. # This is where you add your text documents
  35. # Add as many new @DOCX as you like (where X = the document number)
  36. # You can use "\n" to start a new line, or simply enter a new line below (see example below)
  37. #------------------------------------------------------------------------------
  38. @DOC1 = "ヘブン{
  39. は未創造です[私の空いて]
  40. {
  41. いる部屋か{
  42. らの生活はありません。
  43. }
  44. 米国と一緒に火を楽しん[\.でください。 私たちは]
  45. とても孤独です。 スクラップ。 一人。 デッド。 さようなら"
  46.  
  47. @DOC2 = "ペット.名前(){
  48. 作成(保存)}"
  49.  
  50. @DOC3 = "Happy Kitty dancing in the hall
  51. Angry Mole rushing down the hole"
  52.  
  53. #==============================================================================
  54. # End of Settings Area
  55. # Edit Anything Pass This Line at Your Own Risk!
  56. #==============================================================================
  57. end
  58. class Game_Interpreter
  59. def txt_save(data, filename)
  60. @text = MeowFaceDoc.instance_variable_get("@#{data}")
  61. Dir::mkdir(MeowFaceDoc::FOLDER) if !Dir.exists?(MeowFaceDoc::FOLDER)
  62. @file = File.join(MeowFaceDoc::FOLDER,filename)
  63. if !File.exist?(@file)
  64. @CreateFile = File.open(@file, 'w')
  65. @CreateFile.puts(@text)
  66. @CreateFile.close
  67. @text.clear
  68. end
  69. end
  70.  
  71. def open_file (filename)
  72. @file = File.join(MeowFaceDoc::FOLDER,filename)
  73. system %{cmd /c "start #{@file}"} if File.exist?(@file)
  74. end
  75. end
  76.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement