itemManager

Methods
11
Fields
None

Getting one

itemManager

Methods

MethodReturnsDescription
getImage(number)AsyncBufferedImage(ItemManager, number) -> AsyncBufferedImage: The item's 36x32 icon, with no quantity: getImage(itemId, 1, false).
getImage(number, number, boolean)AsyncBufferedImage
getItemOutline(number, number, Color)BufferedImageThe outline of the item's icon in outlineColor (`createItemSprite(itemId, itemQuantity, 1, 0, 0, false, CLIENT_DEFAULT_ZOOM).toBufferedOu…
getItemPrice(number)numberThe item's price: getItemPriceWithSource(itemID, true), the wiki price being the default source.
getItemPriceWithSource(number, boolean)numberThe item's price: coins 1, platinum tokens 1000, a noted item its unnoted one's, a worn variant its inventory one's, an untradeable mapped…
getWikiPrice(ItemPrice)numberThe wiki price, guarded: the guide price when the wiki has none, the wiki price up to 1000, else whichever is lower of it and five times th…
getItemStats(number)ItemStats?The item's stats, or nil for a noted item or one with no known stats: equipable, weight (kg), buy limit and equipment bonuses, of its can…
search(string){ItemPrice}The price list's rows whose name contains itemName, ignoring case, in the list's order.
canonicalize(number)numberThe item's un-noted, un-placeholdered id (and a worn variant's inventory id).
getItemComposition(number)ItemCompositionThe item's definition: client:getItemDefinition(itemId) (never nil: an unknown id is the client's default, named "null").
searchGeItems(string, number){number}The ids of the items the Grand Exchange lists (isGeTradeable(), getNote() == -1) whose lower-cased name contains query, compared as g…
fuzzySearchGeItems(string, number){number}The ids of the items searchGeItems walks whose FuzzySearchScorer:score(query, name) is above 0: best score first, then by name, equal n…

Method details

getImage

getImage: ((ItemManager, number) -> AsyncBufferedImage) & ((ItemManager, number, number, boolean) -> AsyncBufferedImage)

(ItemManager, number) -> AsyncBufferedImage: The item's 36x32 icon, with no quantity: getImage(itemId, 1, false).

(ItemManager, number, number, boolean) -> AsyncBufferedImage: The item's 36x32 icon as the client draws it in an interface (createItemSprite(itemId, quantity, 1, SpritePixels.DEFAULT_SHADOW_COLOR, stackable ? ALWAYS : NEVER, false, CLIENT_DEFAULT_ZOOM)): a black border, the shadow, and the quantity when stackable. Blank until the client renders it (at once on the client thread, else at a later client tick), then filled in; the same arguments give the same image while cached (128 are kept).

getItemOutline

getItemOutline: (ItemManager, number, number, Color) -> BufferedImage

The outline of the item's icon in outlineColor (createItemSprite(itemId, itemQuantity, 1, 0, 0, false, CLIENT_DEFAULT_ZOOM).toBufferedOutline(outlineColor)). On the client thread this renders at once; an outline that cannot render yet is blank until it can.

getItemPrice

getItemPrice: (ItemManager, number) -> number

The item's price: getItemPriceWithSource(itemID, true), the wiki price being the default source.

getItemPriceWithSource

getItemPriceWithSource: (ItemManager, number, boolean) -> number

The item's price: coins 1, platinum tokens 1000, a noted item its unnoted one's, a worn variant its inventory one's, an untradeable mapped to what it is worth (ItemMapping), else the price list's (the wiki price through getWikiPrice when useWikiPrice), else 0.

getWikiPrice

getWikiPrice: (ItemManager, ItemPrice) -> number

The wiki price, guarded: the guide price when the wiki has none, the wiki price up to 1000, else whichever is lower of it and five times the guide price.

getItemStats

getItemStats: (ItemManager, number) -> ItemStats?

The item's stats, or nil for a noted item or one with no known stats: equipable, weight (kg), buy limit and equipment bonuses, of its canonical id.

canonicalize

canonicalize: (ItemManager, number) -> number

The item's un-noted, un-placeholdered id (and a worn variant's inventory id).

searchGeItems

searchGeItems: (ItemManager, string, number) -> {number}

The ids of the items the Grand Exchange lists (isGeTradeable(), getNote() == -1) whose lower-cased name contains query, compared as given: the first limit by item id, then sorted by name, equal names by item id. A walk of getItemComposition over client:getItemCount() as one call: the names are read once and kept, so a search per keystroke reads no item. Raises for a negative limit.

fuzzySearchGeItems

fuzzySearchGeItems: (ItemManager, string, number) -> {number}

The ids of the items searchGeItems walks whose FuzzySearchScorer:score(query, name) is above 0: best score first, then by name, equal names by item id, at most limit. One call, the scoring included. A query with an empty word ("a b", " a", and - reads as a space) scores NaN, so finds nothing. Raises for a negative limit.