Socket
Book a DemoInstallSign in
Socket

ruby_gs

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ruby_gs

0.2.0
bundlerRubygems
Version published
Maintainers
1
Created
Source

RubyGS

RubyGS is a Ruby Gem that allows Rubyists to view and edit .sav files for the Gold, Silver, and Crystal versions of Pokemon on the Gameboy Color.

These are typically files generated by a Gameboy/Gameboy Color emulator (or a physical backup device, for those of you who are more inclined) that contains the raw data acting as the SRAM on a game cartridge.

##Installation

$ gem install ruby_gs

##Usage

require 'ruby_gs'

saved_game = SaveFileReader.read "/path/to/save/file.sav" # => SaveFile containing data representing the raw SRAM of your cartridge

saved_game.trainer_name = "Reich" # Note: Most fields that accept a string are limited to 10-character strings or less

saved_game.rival_name = "Bugs"

saved_game.team.pokemon[0].species = 25 # Change our first team pokemon's species to someone very familiar

saved_game.set_team_species 0, 25 # This is an alternative to the previous line except it also updates the team menu species

saved_game.team.pokemon[5].happiness = 255 # That's one happy Pokemon!

saved_game.team.amount = 5 # Annnnnnd now it's gone (Not really, it's just hidden from view)

hours = 78
minutes = 33
seconds = 12
frames = 20

saved_game.time_played = [hours, minutes, seconds, frames] # The amount of frames is not visible to the player and is rather inconsequential in general.

saved_game.item_pocket[3].kind = 1 # Change the 3rd item in our Item Pocket to a Master Ball. 

saved_game.item_pocket[3].amount = 255 # Gotta make sure we have enough for our journey.

saved_game.write # This will write your changes directly to the same save file you opened initially.

saved_game.write "path/to/other/save/file.sav" # This will write your changes to a different location.

##Useful Links

  • List of item indices
  • List of Pokemon species indices

##TODO:

  • Support for Crystal.
  • Major refactoring.
  • Player Location editing.
  • Event Flag editing (and possibly documenting the purpose of each flag).

Special thanks to Bulbapedia for hosting the project to document G/S/C's SRAM innards.

FAQs

Package last updated on 12 Dec 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.