PickupedItem
ID of the item currently held “on the finger” (cursor), or 0 when nothing is held.
The item gets there through DragItem (or any method built on it — MoveItem, Grab, Equip), and when the item is dragged by hand in the attached game client. The value is cleared by DropItem and WearItem, by a server refusal to lift the item (packet 0x27), and on character reset.
Assigning the variable replaces the ID only — the item type remembered by the last DragItem stays as it is, and DropItem still uses that type when stacking onto an item of the same type. Assign 0 to drop a stale “item on the finger” state that makes DragItem refuse to work after a lost packet or a manual action in the game client.
In Python, use GetPickupedItem() / SetPickupedItem(value). Unlike the variable, SetPickupedItem also refreshes the remembered item type.
ID предмета, который сейчас удерживается «на пальце» (на курсоре), или 0, если руки пусты.
Предмет попадает туда через DragItem (или построенные на нём MoveItem, Grab, Equip), а также когда предмет берут вручную в подключённом игровом клиенте. Значение сбрасывают DropItem и WearItem, отказ сервера поднять предмет (пакет 0x27) и сброс персонажа.
Присвоение переменной меняет только ID — тип предмета, запомненный последним DragItem, остаётся прежним, и DropItem по-прежнему использует его при состыковке со стопкой того же типа. Присвойте 0, чтобы сбросить застрявший «предмет на пальце», из-за которого DragItem отказывается работать после потерянного пакета или ручного действия в игровом клиенте.
В Python используйте GetPickupedItem() / SetPickupedItem(value). В отличие от переменной, SetPickupedItem заодно обновляет запомненный тип предмета.
var PickupedItem: Cardinal;
def GetPickupedItem() -> int: ...
def SetPickupedItem(ObjID: int) -> None: ...
begin
if PickupedItem <> 0 then
begin
DropItem(Backpack, 0, 0, 0);
Wait(DropDelay);
end;
DragItem(FindItem, 0);
end.
if GetPickupedItem() != 0:
DropItem(Backpack(), 0, 0, 0)
Wait(600)
DragItem(FindItem(), 0)