I don't know how useful it is for some people, but it helps me quickly compile the full RMX-OS from over 20 script slots with just one click so I thought I should share it.
file = File.open('./Data/Scripts.rxdata', 'r')
scripts = Marshal.load(file)
file.close
file = File.open('./Scripts.txt', 'w')
scripts.each {|script| file.write((Zlib::Inflate.inflate(script[2]) + "\n").gsub("\r") {''})}
file.close
exit
This one will save each script in a separate file:
file = File.open('./Data/Scripts.rxdata', 'r')
scripts = Marshal.load(file)
file.close
scripts.each {|script|
begin
raise if script[1] == ''
file = File.open("./#{script[1]}.txt", 'w')
rescue
file = File.open("./Script #{script[0]}.txt", 'w')
end
file.write((Zlib::Inflate.inflate(script[2]) + "\n").gsub("\r") {''})
file.close
}
exit
Just put it anywhere in your scripts and run the game. Don't forget to remove it from your scripts again before running the game again.
Yeah i can see why this is usefull, but i like it with many, so i wont use it :P
Doesnt this in a way backup all of your scripts? I find it really useful
Is it possible to make it extract each script into its own text file? Using it like this
Script 1
Script 2
or maybe even use the scripts name?
So it names it
Game_Temp
Game_System
etc.
I knew somebody was going to ask this earlier or later. I put it in the first post.
Since it's possible to name a script using characters that are forbidden in filenames, I had to add a little safety mechanism which will name the files using their ID.
Blizz you're a mind reader!!!