-
Notifications
You must be signed in to change notification settings - Fork 0
API UO PetsCurrent en
ClassicUO / Basic IDE
Home · Все команды · Каталоги
Use these counters to decide whether your character has capacity for another tamed or summoned creature. Followers is occupied control slots; FollowersMax is the total limit. Neither is a count of nearby animals or the movement command Follow.
Reads the current player’s status counter: occupied follower control slots.
UO.PetsCurrent() -> Integer
No parameters.
Integer — occupied follower control slots, 0..255 in the client model. 0 can be a real value, unavailable data or a missing/destroyed Player. This is a quantity, not Boolean, ID or type: 1 means one unit, not success. It does not enumerate objects or return an array.
- With 3 of 5 slots occupied, 2 are free. A value of 4 may represent four one-slot creatures, one four-slot creature, or another combination. A two-slot creature needs maximum - current >= 2; current < maximum is insufficient. Creature cost and capacity are server rules: read FollowersMax instead of assuming 5.
- Zero does not prove that a pet was lost, killed or released: status may be empty or stale. An increase is only additional evidence of changed control, not proof of which animal was tamed. Check the creature and server messages. Control slots are distinct from stable capacity.
- This command takes no arguments. Use the exact signatures shown above.
- The game-thread read takes Player.Followers if the current Player exists and is not destroyed; otherwise 0. It does not search equipment, recompute bonuses, request status or wait for an update. A present ghost is not the same as a destroyed Player.
- PetsCurrent/Followers reports occupied control slots from own status type >= 3. A single pet can use several slots; summoned or tamed creatures follow the server’s rules. This is not a count of visible mobiles, a list of pet IDs or the number of nearby animals.
- CharacterStatus validates its fixed body before updates. Weight is present in own extended status, follower slots from type 3, Luck from type 4, and server WeightMax from type 5. Compact/older packets without an optional counter preserve its previous cache. A new Player starts with zero counters; the command does not prove that a fresh status has arrived.
- RegisterCharacterGetterAliases adds missing zero-argument functions and intrinsic names for this field. Existing compatibility branches read the same bridge field. Names ignore letter case; an intrinsic without parentheses is reread unless a script variable shadows it.
- Each call is a new local read. Stored variables are snapshots; separate reads can see different server updates. A nonzero result is not a connectivity check. A zero can be a real value or unavailable data.
Native stages of reading a cached status counter. The complete CanCarry, LuckAtLeast or CanAddFollower helper in the example is user-defined BASIC, not a hidden native action. It does not change inventory or followers.
RegisterCharacterGetterAliases adds missing zero-argument functions and intrinsic names for this field. Existing compatibility branches read the same bridge field. Names ignore letter case; an intrinsic without parentheses is reread unless a script variable shadows it.
PetsCurrent Followers GetPetsCurrent GetFollowers.
Project source: external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs; function RegisterCharacterGetterAliases.
The game-thread read takes Player.Followers if the current Player exists and is not destroyed; otherwise 0. It does not search equipment, recompute bonuses, request status or wait for an update. A present ghost is not the same as a destroyed Player.
Invoke reads on the game thread and honours script cancellation while waiting. No status request, target, network packet, attribute change or built-in delay is issued.
Project source: src/ClassicUO.Client/Game/Managers/ClassicUOInjectionApiBridge.cs; function Invoke.
CharacterStatus validates its fixed body before updates. Weight is present in own extended status, follower slots from type 3, Luck from type 4, and server WeightMax from type 5. Compact/older packets without an optional counter preserve its previous cache. A new Player starts with zero counters; the command does not prove that a fresh status has arrived.
PetsCurrent/Followers reports occupied control slots from own status type >= 3. A single pet can use several slots; summoned or tamed creatures follow the server’s rules. This is not a count of visible mobiles, a list of pet IDs or the number of nearby animals.
Project source: src/ClassicUO.Client/Network/PacketHandlers.cs; function CharacterStatus.
World.Clear removes Player. Later reads return 0 until a current player and its status are available; never keep a saved stat as proof that a reconnected character meets a requirement.
Integer — occupied follower control slots, 0..255 in the client model. 0 can be a real value, unavailable data or a missing/destroyed Player. This is a quantity, not Boolean, ID or type: 1 means one unit, not success. It does not enumerate objects or return an array.
Project source: src/ClassicUO.Client/Game/World.cs; function Clear.
Each call is a new local read. Stored variables are snapshots; separate reads can see different server updates. A nonzero result is not a connectivity check. A zero can be a real value or unavailable data.
# Calculate capacity before leaving
#
# Use these counters to decide whether your character has capacity for another tamed or summoned
# creature. Followers is occupied control slots; FollowersMax is the total limit. Neither is a
# count of nearby animals or the movement command Follow.
#
# Reads the current player’s status counter: occupied follower control slots.
#
# Integer — occupied follower control slots, 0..255 in the client model. 0 can be a real value,
# unavailable data or a missing/destroyed Player. This is a quantity, not Boolean, ID or type: 1
# means one unit, not success. It does not enumerate objects or return an array.
SUB Main()
# current is occupied, maximum is the limit, and freeSlots is their difference. Missing/zero
# capacity or inconsistent counters stop the example. These calls read cached status; they do
# not request an update.
VAR current = UO.PetsCurrent()
VAR maximum = UO.FollowersMax()
IF UO.Self() = 0 OR maximum <= 0 OR current > maximum THEN
UO.Print("Follower status is unavailable or inconsistent")
RETURN
END IF
VAR freeSlots = maximum - current
UO.Print("Control slots: " + CStr(current) + "/" + CStr(maximum))
UO.Print("Free slots: " + CStr(freeSlots))
END SUBParameter and execution notes:
- current is occupied, maximum is the limit, and freeSlots is their difference. Missing/zero capacity or inconsistent counters stop the example. These calls read cached status; they do not request an update.
# Check capacity before Animal Taming
#
# Use these counters to decide whether your character has capacity for another tamed or summoned
# creature. Followers is occupied control slots; FollowersMax is the total limit. Neither is a
# count of nearby animals or the movement command Follow.
#
# Reads the current player’s status counter: occupied follower control slots.
#
# Integer — occupied follower control slots, 0..255 in the client model. 0 can be a real value,
# unavailable data or a missing/destroyed Player. This is a quantity, not Boolean, ID or type: 1
# means one unit, not success. It does not enumerate objects or return an array.
SUB Main()
# Select the animal first so lasttarget contains its ID. requiredSlots=2 is an example setting:
# replace it with the actual server cost. Insufficient capacity queues no target and starts no
# skill. Otherwise the target is queued BEFORE UseSkill("Animal Taming"), which takes one
# argument. Starting an attempt does not prove success; skill, range, tameability and the server
# reply still matter.
VAR requiredSlots = 2
VAR current = UO.PetsCurrent()
VAR maximum = UO.FollowersMax()
IF UO.Self() = 0 OR maximum <= 0 OR maximum - current < requiredSlots THEN
UO.Print("Not enough known control slots")
RETURN
END IF
VAR animal = UO.LastTarget()
IF animal = 0 THEN
UO.Print("Select the animal first")
RETURN
END IF
UO.WaitTargetObject(animal)
UO.UseSkill("Animal Taming")
END SUBParameter and execution notes:
- Select the animal first so lasttarget contains its ID. requiredSlots=2 is an example setting: replace it with the actual server cost. Insufficient capacity queues no target and starts no skill. Otherwise the target is queued BEFORE UseSkill("Animal Taming"), which takes one argument. Starting an attempt does not prove success; skill, range, tameability and the server reply still matter.
# Reuse the check for different creature costs
#
# Use these counters to decide whether your character has capacity for another tamed or summoned
# creature. Followers is occupied control slots; FollowersMax is the total limit. Neither is a
# count of nearby animals or the movement command Follow.
#
# Reads the current player’s status counter: occupied follower control slots.
#
# Integer — occupied follower control slots, 0..255 in the client model. 0 can be a real value,
# unavailable data or a missing/destroyed Player. This is a quantity, not Boolean, ID or type: 1
# means one unit, not success. It does not enumerate objects or return an array.
SUB Main()
# CanAddFollower is the fully defined user helper, not a new UO command. It returns 1/True if
# cached capacity is sufficient, otherwise 0/False. extraSlots is the additional creature cost,
# not type/ID. The example 2 is configurable; the helper neither tames nor summons. Recheck
# immediately before the action.
IF CanAddFollower(2) THEN
UO.Print("Capacity check passed; verify the creature cost before acting")
ELSE
UO.Print("Insufficient capacity or unavailable status")
END IF
END SUB
SUB CanAddFollower(extraSlots)
IF extraSlots < 0 OR UO.Self() = 0 THEN
RETURN FALSE
END IF
VAR current = UO.PetsCurrent()
VAR maximum = UO.PetsMax()
IF maximum <= 0 THEN
RETURN FALSE
END IF
RETURN extraSlots <= maximum - current
END SUBParameter and execution notes:
- CanAddFollower is the fully defined user helper, not a new UO command. It returns 1/True if cached capacity is sufficient, otherwise 0/False. extraSlots is the additional creature cost, not type/ID. The example 2 is configurable; the helper neither tames nor summons. Recheck immediately before the action.
Русский · English · Українська · Deutsch · Français · Italiano · Español · 繁體中文 · 日本語 · 한국어
ClassicUO
Bad Newbie & Basic IDE
Найти в справочнике
Клиент и скрипты
Каталоги значений
Разработка и помощь