Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

extract a line of code from Scripts.rxdata

Status
Not open for further replies.
well.. I know the number of the script and the line number which should be enough to get the code of this line..

Code:
scripts = load_data('Data/Scripts.rxdata')
scripts[[I]script number[/I]][2]
gives me the code.. but somehow packed or encrypted..

now my question.. is there a possibility to convert this code to get a single line of code?

some might ask now "why the hell doesnt he simply copy the line out of the script editor?"
this is not possible because I dont know which line I need.. Im working on some kind of a debugging tool which is supposed to show the buggy line..

I hope someone can help me.. thanks.. ^^
 
Code:
  scripts = []
   File.open("Scripts.rxdata", "rb") do |f|
     scripts << Marshal.load(f)
   end

#now echo the folowing code :

   Zlib::Inflate.inflate(scripts[X][Y])
   where X = script id (same order as in editor)
   where Y = 0, 1 or 2.

   0 represents the section number
   1 represents the section name (script name)
   2 is the compressed code 

#then there is offcourse the RGSS_SCRIPTS constant global

   $RGSS_SCRIPTS.each { |s| }

#and of course write others script to file

   scripts = load_data("C:/Project0/Data/Scripts.rxdata")
   scripts.each { |s|    File.open("#{s[1]}.txt") {|f| f.puts(Zlib::Inflate.inflate(s[2]))}}

$RGSS_SCRIPTS.each { |s| p Zlib::Inflate.inflate(s[2])} ex.
 
Status
Not open for further replies.

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top