Home API Manuals About Forum
Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

ExtChangeProfile

Extended version of ChangeProfile that additionally allows specifying the shard and character name.

Same prerequisites as ChangeProfile: character must be disconnected, only one script running, profile name is case-sensitive.

If ShardName and CharName are empty strings, a shard selection window will appear, or the connection will use the shard/char stored in the profile settings.

Returns 0 on success, or a negative error code (see ChangeProfile for the list).

In Python, this method is named ChangeProfileEx.

Расширенная версия ChangeProfile с возможностью указать шард и имя персонажа.

Те же требования, что у ChangeProfile: персонаж должен быть отключён, работает один скрипт, имя профиля чувствительно к регистру.

Если ShardName и CharName — пустые строки, появится окно выбора шарда, или подключение произойдёт с шардом/персонажем из настроек профиля.

В Python метод называется ChangeProfileEx.

Pascal

function ExtChangeProfile(ProfileName: String; ShardName: String = ''; CharName: String = ''): Integer;

Parameters:

  • ProfileName — profile name (case-sensitive).
  • ShardName — shard name. Empty string = use profile default or show selection window.
  • CharName — character name. Empty string = use profile default.

Python

def ChangeProfileEx(ProfileName: str, ShardName: str, CharName: str) -> int: ...

Pascal Example

begin
  Disconnect;
  Wait(5000);
  case ExtChangeProfile('MyProfile', 'Demise', 'MyChar') of
    0: begin Connect; Wait(10000); end;
    -2: AddToSystemJournal('Still connected!');
    -4: AddToSystemJournal('Profile not found');
  end;
end.

Python Example

Disconnect()
Wait(5000)
result = ChangeProfileEx('MyProfile', 'Demise', 'MyChar')
if result == 0:
    Connect()
    Wait(10000)
else:
    AddToSystemJournal(f'Failed, error: {result}')

See Also

ChangeProfile, ProfileName