Ellye

[VXA] Dump Switches and Variables

Mar 9th, 2016
272
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.54 KB | None | 0 0
  1. class Dump
  2.  
  3.   def self.Write
  4.     txt = "SWITCHES: \n"
  5.     $data_system.switches.each.with_index do |v,i|
  6.       txt += "\n[Switch " + i.to_s + "] " + v.to_s + " = "
  7.       txt += $game_switches[i] ? "[ON]" : "[OFF]"
  8.     end
  9.    
  10.     txt += "\n\n====================\n\n"
  11.     txt += "VARIABLES: \n"
  12.     $data_system.variables.each.with_index do |v,i|
  13.       txt += "\n[Variable " + i.to_s + "] " + v.to_s + " = "
  14.       txt += $game_variables[i].to_s
  15.     end
  16.    
  17.    
  18.     open('dump.txt', 'w') { |f|
  19.       f.puts txt
  20.     }
  21.   end
  22.  
  23. end
Add Comment
Please, Sign In to add comment