GetContent
Returns the contents of the container with ID as an array of TContentItemData records.
Each record contains the item’s serial, graphic, color, position within the container, stack count, and parent container ID.
Возвращает содержимое контейнера с ID в виде массива записей TContentItemData.
Каждая запись содержит серийный номер предмета, его graphic, цвет, позицию внутри контейнера, количество в стеке и ID родительского контейнера.
function GetContent(ID: Cardinal): TArray<TContentItemData>;
function GetContent(ID: Cardinal): TContentItemDataArray;
Type definition:
TScript_ContentItemData = packed record
serial: Cardinal;
graphic: Word;
color: Word;
x: Word;
y: Word;
count: Word;
parent: Cardinal;
end;
def GetContent(ObjID: int) -> list[ContentItemData]: ...
var
Items: TArray<TContentItemData>;
i: Integer;
begin
Items := GetContent(Backpack);
for i := 0 to Length(Items) - 1 do
AddToSystemJournal('Item $' + IntToHex(Items[i].serial, 8) +
' type=$' + IntToHex(Items[i].graphic, 4) +
' count=' + IntToStr(Items[i].count));
end.
items = GetContent(Backpack())
for item in items:
AddToSystemJournal(f'Item ${item.serial:08X} type=${item.graphic:04X} count={item.count}')