Home API Manuals About Forum
Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

Grab

Picks up the specified item and moves it into the character’s backpack. This is a convenience method that combines DragItem and DropItem into a single call.

ObjID — ID of the item to grab.

Count — number of items to pick up from the stack. Use 0 to grab the entire stack.

Returns True if the item was successfully moved, False otherwise.

Подбирает указанный предмет и перемещает его в рюкзак персонажа. Это удобный метод, объединяющий DragItem и DropItem в один вызов.

ObjID — ID предмета для подбора.

Count — количество предметов из стопки. 0 — забрать всю стопку.

Возвращает True, если предмет успешно перемещён, False — в противном случае.

Pascal

function Grab(ObjID: Cardinal; Count: Integer): Boolean;

Python

def Grab(item_id: int, count: int) -> bool: ...

Pascal Example

begin
  if FindType($0EED, Ground) > 0 then
  begin
    if Grab(FindItem, 0) then
      AddToSystemJournal('Grabbed gold from the ground')
    else
      AddToSystemJournal('Failed to grab');
  end;
end.

Python Example

if FindType(0x0EED, Ground()) > 0:
    if Grab(FindItem(), 0):
        AddToSystemJournal('Grabbed gold from the ground')
    else:
        AddToSystemJournal('Failed to grab')

See Also

DragItem, DropItem, MoveItem