getId
getId: (Item) -> numberThe item id, -1 for an empty slot.
Item.new(…)
client:getItemContainer(…):getItem(…)| Method | Returns | Description |
|---|---|---|
getId() | number | The item id, -1 for an empty slot. |
getQuantity() | number | The quantity. |
getSlot() | number | The slot it was read from (ItemContainer:getItems(), getItem), -1 for an item not read from a slot. |
interact(string) | boolean | Choose option ("Eat", "Wield", "Drop", ...) on the item where it was read from, through the virtual mouse. It acts on an item `client:get… |
equals(any) | boolean | Whether other equals this Item, as == answers it (false for a value of another class). |
new(number, number) | Item | An item of id and quantity. |
| Method | Returns | Description |
|---|---|---|
ItemClass.new | Item | An item of id and quantity. |
ItemContainer.getItem | Item? | The item in slot, or nil for an empty slot or one past the end. |
ItemContainer.getItems | {Item} | Every slot's item, empty slots as id -1 quantity 0. |
getIdgetId: (Item) -> numberThe item id, -1 for an empty slot.
getQuantitygetQuantity: (Item) -> numberThe quantity.
getSlotgetSlot: (Item) -> numberThe slot it was read from (ItemContainer:getItems(), getItem), -1 for an item not read from a slot.
interactinteract: (Item, string) -> booleanChoose option ("Eat", "Wield", "Drop", ...) on the item where it was read from, through the virtual mouse. It acts on an item client:getItemContainer(InventoryID.INV) or .WORN handed out (getItems(), getItem(slot)): the op is resolved from the item's definition and the scheduler moves the virtual mouse onto its slot and clicks. false when the item came from another container, its slot no longer holds it, or it has no such option. Raises for an item not read from a slot (Item.new).
equalsequals: (Item, any) -> booleanWhether other equals this Item, as == answers it (false for a value of another class).
newnew: (number, number) -> ItemAn item of id and quantity.