RSCacheParser

RSCacheParser as the name implies is a record made to parse information from certain files that are part of the OSRS cache.

  • preferences.dat is where most client settings are stored.

  • preferences2.dat I have no idea? some values in address 00000020 seem to change after some times has passed randomly. (related to 6h log maybe!?!?)

  • random.dat in the user home directory seems to be a random identifier generated the first time you open a client if it doesn’t exist. while it exists, it seems to never change unless the user deletes it.


type RSCacheParser

type RSCacheParser = record(TSRLBaseRecord) class var
  Disabled: Boolean;
  Directory: String;
  Preferences: String;
  Preferences2: String;
end;

Type responsible for handling osrs cache parsing.


RSCacheParser.Setup

procedure RSCacheParser.Setup(); static;

Internal method called automatically simply by including WaspLib.


RSCacheParser.GetPreference

function RSCacheParser.GetPreference(prefNumber: Int32 = 1): String; static;

Read the preference file specified.


RSCacheParser.Update

function RSCacheParser.Update(): Boolean; static;

Method to check if the cache files were updated.


RSCacheParser.GetHexString

function RSCacheParser.GetHexString(prefNumber: Int32 = 1): String; static;

Print the cache files as a hex string.

Example:

WriteLn RSCacheParser.GetHexString(1);

RSCacheParser.Print

procedure RSCacheParser.Print(prefNumber: Int32 = 0); static;

Print the cache files as strings. This is only useful for debugging purposes.

Example:

RSCacheParser.Print();

RSCacheParser.GetOptionsAmount

function RSCacheParser.GetOptionsAmount(): Int32; static;

Returns the number of options saved in the cache. This is not very useful, AFAIK there’s only 2 possible values for this: 0 and 10. 0 is only if you haven’t accepted the EULA in the client.

Example:

WriteLn RSCacheParser.GetOptionsAmount();

RSCacheParser.RoofsHidden

function RSCacheParser.RoofsHidden(): Boolean; static;

Checks if the roofs are hidden.

Example:

WriteLn RSCacheParser.RoofsHidden();

RSCacheParser.TitleMusicDisabled

function RSCacheParser.TitleMusicDisabled(): Boolean; static;

Checks if the music is enabled in the login screen.

Example:

WriteLn RSCacheParser.TitleMusicDisabled();

RSCacheParser.WindowMode

function RSCacheParser.WindowMode(): Int32; static;

Returns 1 for fixed mode and 2 for resizable mode. Resizable modern and resizable classic make no difference here.

Example:

WriteLn RSCacheParser.WindowMode();

RSCacheParser.GetAuthenticatorAmount

function RSCacheParser.GetAuthenticatorAmount(): Int32; static;

Returns the number of authenticators saved for the next 30 days. If this is more than 0, you will have 8 bytes for each of the saved authenticators. This is important to know so we know where the saved username starts if we have saved authenticators.

Example:

WriteLn RSCacheParser.GetAuthenticatorAmount();

RSCacheParser.GetAuthenticators

function RSCacheParser.GetAuthenticators(): TStringArray; static;

Returns each authenticator saved in a TStringArray. Each string is 8 bytes like mentioned in RSCacheParser.GetAuthenticatorAmount() documentation.

Example:

WriteLn RSCacheParser.GetAuthenticators();

RSCacheParser.GetUsernameIndex

function RSCacheParser.GetUsernameIndex(): Int32; static;

Internal function that returns byte index where the username starts. This is required because depending on wether we have authenticators saved or not, the bytes shift.


RSCacheParser.GetUsername

function RSCacheParser.GetUsername(): String; static;

Returns the saved username in the osrs cache. This is the username you clicked to save on the client when logging in.

Example:

WriteLn RSCacheParser.GetUsername();

RSCacheParser.UsernameEndIndex

function RSCacheParser.UsernameEndIndex(): Int32; static;

Internal function used to get the index of the byte of where the username ends.


RSCacheParser.HideUsername

function RSCacheParser.HideUsername(): Boolean; static;

Returns true or false if we have the username hidden.

Example:

WriteLn RSCacheParser.HideUsername();

RSCacheParser.Brightness

function RSCacheParser.Brightness(): Int32; static;

Returns the brightness value converted to a 0-100 value.

Example:

WriteLn RSCacheParser.Brightness();

RSCacheParser.MusicVolume

function RSCacheParser.MusicVolume(): Int32; static;

Returns the music volume value converted to a 0-100 value.

Example:

WriteLn RSCacheParser.MusicVolume();

RSCacheParser.SoundEffectsVolume

function RSCacheParser.SoundEffectsVolume(): Int32; static;

Returns the sound effects volume value converted to a 0-100 value.

Example:

WriteLn RSCacheParser.SoundEffectsVolume();

RSCacheParser.AreaSoundVolume

function RSCacheParser.AreaSoundVolume(): Int32; static;

Returns the area sound volume value converted to a 0-100 value.

Example:

WriteLn RSCacheParser.AreaSoundVolume();

RSCacheParser.Field1247

function RSCacheParser.Field1247(): Int32; static;

I have absolutely no idea what this is. It’s supposedly something, but AFAIK it’s always 0.

Example:

WriteLn RSCacheParser.Field1247();

RSCacheParser.DisplayFPS

function RSCacheParser.DisplayFPS(): Boolean; static;

Returns true/false if we have Display FPS enabled. Display FPS can be enabled by typing ::displayfps in game.

Example:

WriteLn RSCacheParser.DisplayFPS();

RSCacheParser.Field1238

function RSCacheParser.Field1238(): Int32; static;

I have absolutely no idea what this is. It’s supposedly something, but AFAIK it’s always 0.

Example:

WriteLn RSCacheParser.Field1238();