Skip to content

API UO ChangeProfile

Codex edited this page Sep 19, 2026 · 4 revisions

UO.ChangeProfile

ClassicUO / Basic IDE

Оглавление · Алфавитный указатель · Profiles & Configuration

Switches the disconnected Basic/ClassicUO profile selection to another existing character profile on the current server. Character metadata saved with the profile is used to configure the next login/reconnect. The current profile is saved and unloaded before the new selection is accepted.

Profiles are stored under the connected server display name:

Data/Profiles/<server name>/<0xSerial>/

Синтаксис

UO.ChangeProfile(Name:Any) -> Any

Регистр имени не важен. Any — динамическое значение Basic; Unit — отсутствие возвращаемого значения. Integer — знаковое 32-битное число, Decimal — число с плавающей точкой. Правила типов, serial, индексов и ожиданий.

Параметры

Имя Назначение
Name Значение для данной позиции; назначение и поддерживаемые варианты показаны в описании и примерах.

Параметры обязательны внутри каждой показанной сигнатуры. Опустить аргумент можно только при наличии более короткой перегрузки; пропуск позиции посередине не подразумевается.

Допустимые значения

Name — Quoted BASIC string. Fixed keywords/enums, when present, are listed in Behavior/Notes.

Ограничения

The client must be disconnected; an in-game or connecting client returns -2.

  • Only one Basic script may be active; otherwise -3 is returned.
  • Name is case-sensitive at the API level and must resolve to an existing canonical character profile; missing profiles return -4.
  • The command selects the profile/reconnect target; it does not itself force an immediate network connection. Use UO.Connect() when appropriate.

Примеры

Каждый блок — самостоятельный скрипт из мануала проекта. Параметры демонстрационного объекта/контейнера и условия действия необходимо сопоставить с вашей игровой ситуацией.

Пример 1

SUB Main()
    VAR rc = UO.ChangeProfile('0x12345678')
    IF rc = 0 THEN
        UO.Connect()
    END IF
END SUB

Пример 2

SUB Main()
    VAR result = UO.ChangeProfile('example')
    UO.Print(CStr(result))
END SUB

Пример 3

SUB Main()
    VAR arg1 = 'example' # Name
    VAR result = UO.ChangeProfile(arg1)
    UO.Print(CStr(result))
END SUB

Пример 4

SUB ReadResult()
    VAR arg1 = 'example' # Name
    VAR result = UO.ChangeProfile(arg1)
    UO.Print(CStr(result))
END SUB

SUB Main()
    ReadResult()
END SUB
Реализация и проверка контракта
  • InjectionScript.Runtime.InjectionApiUO+<>c__DisplayClass38_0.<RegisterStealthCompatibility>b__0

Соответствующая ветвь совместимого обработчика в InjectionApiUO.cs. Arg(i)/Text(i) читают позицию с нуля; bridge обращается к клиенту. Прямые типизированные перегрузки перечислены выше и могут иметь отдельный маршрут.

return new InjectionValue(bridge.ChangeProfileSelection(Text(0), string.Empty, string.Empty));

Источник реестра и отчёт сверки. Примеры проверяются загрузчиком/парсером включённого runtime. Действия на игровом сервере этой проверкой не исполняются.

Clone this wiki locally