# 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. ```{note} For more information check this file: https://github.com/open-osrs/runelite/blob/dd4478eff7d90fcb3e85584171d5836809eb150a/runescape-client/src/main/java/ClientPreferences.java ``` - - - ## type TRSCacheParser ```pascal type TRSCacheParser = record(TSRLBaseRecord) Disabled: Boolean; Directory: String; Preferences: String; Preferences2: String; end; ``` Type responsible for handling osrs cache parsing. - - - ## RSCacheParser.Setup ```pascal procedure TRSCacheParser.Setup(); ``` Internal method called automatically simply by including WaspLib. - - - ## RSCacheParser.GetPreference ```pascal function TRSCacheParser.GetPreference(prefNumber: Int32 = 1): String; ``` Read the preference file specified. - - - ## RSCacheParser.Update ```pascal function TRSCacheParser.Update(): Boolean; ``` Method to check if the cache files were updated. - - - ## RSCacheParser.GetHexString ```pascal function TRSCacheParser.GetHexString(prefNumber: Int32 = 1): String; ``` Print the cache files as a hex string. Example: ```pascal WriteLn RSCacheParser.GetHexString(1); ``` - - - ## RSCacheParser.Print ```pascal procedure TRSCacheParser.Print(prefNumber: Int32 = 0); ``` Print the cache files as strings. This is only useful for debugging purposes. Example: ```pascal RSCacheParser.Print(); ``` - - - ## RSCacheParser.GetOptionsAmount ```pascal function TRSCacheParser.GetOptionsAmount(): Int32; ``` 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: ```pascal WriteLn RSCacheParser.GetOptionsAmount(); ``` - - - ## RSCacheParser.RoofsHidden ```pascal function TRSCacheParser.RoofsHidden(): Boolean; ``` Checks if the roofs are hidden. Example: ```pascal WriteLn RSCacheParser.RoofsHidden(); ``` - - - ## RSCacheParser.TitleMusicDisabled ```pascal function TRSCacheParser.TitleMusicDisabled(): Boolean; ``` Checks if the music is enabled in the login screen. Example: ```pascal WriteLn RSCacheParser.TitleMusicDisabled(); ``` - - - ## RSCacheParser.WindowMode ```pascal function TRSCacheParser.WindowMode(): Int32; ``` Returns 1 for fixed mode and 2 for resizable mode. Resizable modern and resizable classic make no difference here. Example: ```pascal WriteLn RSCacheParser.WindowMode(); ``` - - - ## RSCacheParser.GetAuthenticatorAmount ```pascal function TRSCacheParser.GetAuthenticatorAmount(): Int32; ``` 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: ```pascal WriteLn RSCacheParser.GetAuthenticatorAmount(); ``` - - - ## RSCacheParser.GetAuthenticators ```pascal function TRSCacheParser.GetAuthenticators(): TStringArray; ``` Returns each authenticator saved in a TStringArray. Each string is 8 bytes like mentioned in RSCacheParser.GetAuthenticatorAmount() documentation. Example: ```pascal WriteLn RSCacheParser.GetAuthenticators(); ``` - - - ## RSCacheParser.GetUsernameIndex ```pascal function TRSCacheParser.GetUsernameIndex(): Int32; ``` 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 ```pascal function TRSCacheParser.GetUsername(): String; ``` Returns the saved username in the osrs cache. This is the username you clicked to save on the client when logging in. Example: ```pascal WriteLn RSCacheParser.GetUsername(); ``` - - - ## RSCacheParser.UsernameEndIndex ```pascal function TRSCacheParser.UsernameEndIndex(): Int32; ``` Internal function used to get the index of the byte of where the username ends. - - - ## RSCacheParser.HideUsername ```pascal function TRSCacheParser.HideUsername(): Boolean; ``` Returns true or false if we have the username hidden. Example: ```pascal WriteLn RSCacheParser.HideUsername(); ``` - - - ## RSCacheParser.Brightness ```pascal function TRSCacheParser.Brightness(): Int32; ``` Returns the brightness value converted to a 0-100 value. Example: ```pascal WriteLn RSCacheParser.Brightness(); ``` - - - ## RSCacheParser.MusicVolume ```pascal function TRSCacheParser.MusicVolume(): Int32; ``` Returns the music volume value converted to a 0-100 value. Example: ```pascal WriteLn RSCacheParser.MusicVolume(); ``` - - - ## RSCacheParser.SoundEffectsVolume ```pascal function TRSCacheParser.SoundEffectsVolume(): Int32; ``` Returns the sound effects volume value converted to a 0-100 value. Example: ```pascal WriteLn RSCacheParser.SoundEffectsVolume(); ``` - - - ## RSCacheParser.AreaSoundVolume ```pascal function TRSCacheParser.AreaSoundVolume(): Int32; ``` Returns the area sound volume value converted to a 0-100 value. Example: ```pascal WriteLn RSCacheParser.AreaSoundVolume(); ``` - - - ## RSCacheParser.Field1247 ```pascal function TRSCacheParser.Field1247(): Int32; ``` I have absolutely no idea what this is. It's supposedly something, but AFAIK it's always 0. Example: ```pascal WriteLn RSCacheParser.Field1247(); ``` - - - ## RSCacheParser.DisplayFPS ```pascal function TRSCacheParser.DisplayFPS(): Boolean; ``` Returns true/false if we have Display FPS enabled. Display FPS can be enabled by typing ::displayfps in game. Example: ```pascal WriteLn RSCacheParser.DisplayFPS(); ``` - - - ## RSCacheParser.Field1238 ```pascal function TRSCacheParser.Field1238(): Int32; ``` I have absolutely no idea what this is. It's supposedly something, but AFAIK it's always 0. Example: ```pascal WriteLn RSCacheParser.Field1238(); ```