ItemComposition

Methods
15
Fields
None

Getting one

client:getItemDefinition(…)
itemManager:getItemComposition(…)

Methods

MethodReturnsDescription
getId()numberThe item's id.
getName()stringThe name, as the client shows it ("Members object" for a members item on a free world).
getMembersName()stringThe name as on a members world.
getNote()numberThe note template (799) for a noted item, else -1.
getLinkedNoteId()numberThe other side of the note link (the noted item for an unnoted one, and back), else -1.
getPlaceholderId()numberThe bank placeholder's id (or, for a placeholder, the item's), else -1.
getPlaceholderTemplateId()numberThe placeholder template (14401) for a placeholder, else -1.
getPrice()numberThe store value.
getHaPrice()numberThe high alchemy value: getPrice() * 0.6 in single precision, truncated.
isMembers()booleanWhether it is a members item.
isStackable()booleanWhether it stacks.
isGeTradeable()booleanWhether the Grand Exchange trades it.
getInventoryActions(){ n: number, [number]: string? }The inventory actions, five slots, nil where there is none. Holes are nil and the array carries n, its length: walk it `for i = 1, acti…
getSubops(){{ n: number, [number]: string? }}Each inventory action's sub-options (nil where an action has none).
getShiftClickActionIndex()numberThe inventory action shift-click runs (0-based), -1 for none.

Returned by

MethodReturnsDescription
Client.getItemDefinitionItemCompositionItem id's definition, loaded through the client's cache on demand; an id with none answers the client's default (named "null").
ItemManager.getItemCompositionItemCompositionThe item's definition: client:getItemDefinition(itemId) (never nil: an unknown id is the client's default, named "null").

Method details

getName

getName: (ItemComposition) -> string

The name, as the client shows it ("Members object" for a members item on a free world).

getInventoryActions

getInventoryActions: (ItemComposition) -> { n: number, [number]: string? }

The inventory actions, five slots, nil where there is none. Holes are nil and the array carries n, its length: walk it for i = 1, actions.n. table.find stops at the first hole, so search it with your own contains(actions, x) that walks to n.

getSubops

getSubops: (ItemComposition) -> {{ n: number, [number]: string? }}

Each inventory action's sub-options (nil where an action has none).