Shiny Language Reference
Language Reference > Registry Functions
readprofileint
int readprofileint(string Value, int Default);
Synonyms:
int rpint(string Value, int Default);
Reads a profile integer from the registry
READPROFILEINT returns the contents of the specified integer (DWORD or BINARY) value in the registry. When a new SSE is loaded by Brass, a registry key is created for it under HKCU\Software\32Bits\Brass\Shiny<plugin_filename>. This key is used to store the position, size and configuration of the display panel as well as associated settings that all plugins have access to (for example, hotkeys). Plugins may read values from and write values to this registry key to manage their configuration and internal settings. The standard registry profile functions are not designed for general-purpose registry access. Instead they are intended to allow plugins to store configuration and ensure that any such configuration stored is unique to the plugin instance. This is why the registry functions do not allow the selection of registry keys. Refer to GETSELFNAME for more information on unique instances.
READPROFILEINT must only be used to retrieve data from registry values specified as binary or dwords.
This statement is only valid in the RegRead handler
Parameters
Value
The name of the registry value to read
Default
If the value doesn't exist (for example, this is the first time the plugin has been loaded), the value specified here is used as the return value for the statement. This ensures READPROFILEINT always returns a sensible value without requiring a separate check to see if the registry value exists.
Return Value
The data read from the value, or the default value if the registry value doesn't exist.
Example Code
// Get the contents of the ScoreVal value from the registry
int ScoreVal = readprofileint("ScoreVal", 0);