SetCatchBag
Designates a container as the “catch bag” — all items received by the character (loot, trade, etc.) are automatically moved to this container.
ObjID — serial (ID) of the container to use as the catch bag. Pass 0 to clear the catch bag (equivalent to calling UnsetCatchBag).
Returns:
| Value | Meaning |
|---|---|
0 |
Catch bag cleared (ObjID was 0), or error (character not connected, object not found, or object is not a container) |
1 |
Catch bag set successfully |
The specified object must exist and must be a container. If the object is not found or is not a container, the catch bag is not set and 0 is returned.
Назначает контейнер в качестве «catch bag» — все предметы, получаемые персонажем (добыча, обмен и т.д.), автоматически перемещаются в этот контейнер.
ObjID — serial (ID) контейнера. Передайте 0 для сброса catch bag (эквивалент вызова UnsetCatchBag).
Возвращает:
| Значение | Смысл |
|---|---|
0 |
Catch bag сброшен (ObjID = 0), или ошибка (персонаж не подключён, объект не найден или не является контейнером) |
1 |
Catch bag установлен успешно |
Указанный объект должен существовать и быть контейнером. Если объект не найден или не является контейнером, catch bag не устанавливается и возвращается 0.
function SetCatchBag(ObjID: Cardinal): Byte;
def SetCatchBag(ObjID: int) -> int: ...
begin
if SetCatchBag(Backpack) = 1 then
AddToSystemJournal('Catch bag set to backpack')
else
AddToSystemJournal('Failed to set catch bag');
end.
if SetCatchBag(Backpack()) == 1:
AddToSystemJournal('Catch bag set to backpack')
else:
AddToSystemJournal('Failed to set catch bag')