# Profiles Page dedicated to handling profile accounts. - - - ## ProfileIndex variable This variable is what tells WaspLib which account you will be using of the ones you have in a {ref}`TProfileArray` you want to use for this botting session. - - - ## TProfile Record holding account credentials and world preferences. - - - ## TProfileArray Type that holds player account information for {ref}`login`, world hopping and {ref}`bankpin` handling. - - - ## TProfileArray.Add ```pascal procedure TProfileArray.Add(user, pass: String; pin: String = ''; worlds: TIntegerArray = []); ``` Adds a TProfile to the TProfileArray. Example: ```pascal Profiles.Add('username', 'password', '0000'); ``` - - - ## TProfileArray.NextPlayer ```pascal procedure TProfileArray.NextPlayer(disableCurrent: Boolean); ``` Switches to the next active profile. If `disableCurrent` is True, the current profile is marked inactive. - - - ## Profiles.Get ```pascal function TProfileArray.Get(): TProfile; ``` Returns the currently selected TProfile. The currently selected TProfile is decided by `ProfileIndex` which is an index of the TProfileArray. Example: ```pascal WriteLn Profiles.Get().Username; ``` - - - ## Profiles.Update ```pascal procedure TProfileArray.Update(const profile: TProfile); ``` Updates the currently selected TProfile. The currently selected TProfile is decided by `ProfileIndex` which is an index of the TProfileArray. The way this works is a little bit special as `Profiles[ProfileIndex]` is not not completely updated: - `Profiles[ProfileIndex].Active` is never changed. - `Profiles[ProfileIndex].Name`, `Profiles[ProfileIndex].Username`, `Profiles[ProfileIndex].Password` and `Profiles[ProfileIndex].Pin` are only updated if the values of the passed in profile are not `''`. - `Profiles[ProfileIndex].Worlds` is always set to `profile.Worlds` Example: ```pascal WriteLn Profiles.Get(); Profiles.Update(['', '', '', ''. [311, 312]]); WriteLn Profiles.Get(); ``` - - - ## Profiles.GetPin ```pascal function TProfileArray.GetPin(): String; ``` Get the current Player bank pin. Example: ```pascal if BankPin.IsOpen() then BankPin.Enter(Profiles.GetPin()); ``` - - - ## Profiles.Load ```pascal procedure TProfileArray.Load(); ``` Loads all account profiles from the accounts JSON files (0.json, 1.json, etc). - - - ## TProfileArray.Contains ```pascal function TProfileArray.Contains(name: String): Boolean; ``` Checks if a profile with the given name already exists. - - - ## Profiles variable Global {ref}`TProfileArray` variable.