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

DragItem

Picks up (“drags”) an item, placing it “on the finger” (cursor). The item is not moved to any container or location — use DropItem to complete the move.

Returns True on success, False if:

  • ObjID is 0 (silent fail, no log).
  • The character is dead.
  • Another item is already held “on the finger”.
  • The item with this ID was not found.

If the item is in a stack and Count exceeds the stack size, the entire stack is picked up. Use 0 for Count to pick up all items in the stack.

Берёт предмет, помещая его «на палец» (курсор). Предмет не перемещается в контейнер или на землю — для завершения перемещения используйте DropItem.

Возвращает True при успехе, False, если:

  • ObjID равен 0 (без лога).
  • Персонаж мёртв.
  • Другой предмет уже удерживается «на пальце».
  • Предмет с данным ID не найден.

Если предмет в стеке и Count превышает размер стека, берётся весь стек. Используйте 0 для Count, чтобы взять все предметы из стека.

Pascal

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

Parameters:

  • ObjID — ID of the item to pick up.
  • Count — quantity to pick up. 0 = take all.

Python

def DragItem(ObjID: int, Count: int) -> bool: ...

Pascal Example

procedure LootGold;
begin
  if FindType($0EED, Corpse) <> 0 then
  begin
    DragItem(FindItem, 0);  // pick up all gold
    Wait(300);
    DropItem(Backpack, 0, 0, 0);  // drop into backpack
    Wait(600);
  end;
end;

Python Example

if FindType(0x0EED, corpse) != 0:
    DragItem(FindItem(), 0)  # pick up all gold
    Wait(300)
    DropItem(Backpack(), 0, 0, 0)  # drop into backpack
    Wait(600)

See Also

DropItem, Grab, Drop, MoveItem