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.
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.
def ChangeProfileEx(ProfileName: str, ShardName: str, CharName: str) -> int: ...
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.
Disconnect()
Wait(5000)
result = ChangeProfileEx('MyProfile', 'Demise', 'MyChar')
if result == 0:
Connect()
Wait(10000)
else:
AddToSystemJournal(f'Failed, error: {result}')