named
named: (GroundItemQuery, string) -> GroundItemQueryKeep only those whose whole item name matches, ignoring case and markup: | separates alternatives and * is any run of characters.
names- The name pattern.
scene:groundItems()| Method | Returns | Description |
|---|---|---|
named(string) | GroundItemQuery | Keep only those whose whole item name matches, ignoring case and markup: | separates alternatives and * is any run of characters. |
containing(string) | GroundItemQuery | Keep only those whose item name contains the text, ignoring case and markup: | separates alternatives. |
ids({ number }) | GroundItemQuery | Keep only these ids. A noted id and its unnoted id are the same item here. |
within(number) | GroundItemQuery | Keep only those within a radius of the local player. |
withinArea(WorldArea) | GroundItemQuery | Keep only those inside an area. |
reachable() | GroundItemQuery | Keep only those the local player can walk to. |
unitGeValueAtLeast(number) | GroundItemQuery | Keep only piles whose ONE item is worth at least this at Grand Exchange price, a noted pile as the item it notes. |
unitAlchValueAtLeast(number) | GroundItemQuery | Keep only piles whose ONE item alchs for at least this, a noted pile as the item it notes. |
stackValueAtLeast(number) | GroundItemQuery | Keep only piles worth at least this whole: price times quantity, coins at 1 each and platinum tokens at 1,000. |
mine() | GroundItemQuery | Keep the stacks nobody else owns: the player's, unowned and group stacks (item:getOwnership() ~= TileItem.OWNERSHIP_OTHER). |
lootable() | GroundItemQuery | Keep the stacks the player may pick up: mine ones, or every stack when the account is not an ironman. |
count() | number | How many survived the narrowing. Consumes the query. |
nearest() | TileItem? | The nearest survivor. Consumes the query. |
collect() | { TileItem } | Every survivor, nearest first. Consumes the query. |
| Method | Returns | Description |
|---|---|---|
SceneDomain.groundItems | GroundItemQuery | A query over every item on the floor, whose terminals hand out TileItem handles (item:getTile() is where one lies). |
namednamed: (GroundItemQuery, string) -> GroundItemQueryKeep only those whose whole item name matches, ignoring case and markup: | separates alternatives and * is any run of characters.
namescontainingcontaining: (GroundItemQuery, string) -> GroundItemQueryKeep only those whose item name contains the text, ignoring case and markup: | separates alternatives.
textidsids: (GroundItemQuery, { number }) -> GroundItemQueryKeep only these ids. A noted id and its unnoted id are the same item here.
idswithinwithin: (GroundItemQuery, number) -> GroundItemQueryKeep only those within a radius of the local player.
radiuswithinAreawithinArea: (GroundItemQuery, WorldArea) -> GroundItemQueryKeep only those inside an area.
areareachablereachable: (GroundItemQuery) -> GroundItemQueryKeep only those the local player can walk to.
unitGeValueAtLeastunitGeValueAtLeast: (GroundItemQuery, number) -> GroundItemQueryKeep only piles whose ONE item is worth at least this at Grand Exchange price, a noted pile as the item it notes.
coinsunitAlchValueAtLeastunitAlchValueAtLeast: (GroundItemQuery, number) -> GroundItemQueryKeep only piles whose ONE item alchs for at least this, a noted pile as the item it notes.
coinsstackValueAtLeaststackValueAtLeast: (GroundItemQuery, number) -> GroundItemQueryKeep only piles worth at least this whole: price times quantity, coins at 1 each and platinum tokens at 1,000.
local stack = scene:groundItems():within(10):stackValueAtLeast(5000):lootable():nearest()
if stack then stack:interact("Take") endcoinsminemine: (GroundItemQuery) -> GroundItemQueryKeep the stacks nobody else owns: the player's, unowned and group stacks (item:getOwnership() ~= TileItem.OWNERSHIP_OTHER).
scene:groundItems():ids(ids):within(dist), then :mine() for stacks nobody else owns or :lootable() for stacks the player may pick up, then :collect(), nearest first. Stacks at the same distance keep the scan order.
lootablelootable: (GroundItemQuery) -> GroundItemQueryKeep the stacks the player may pick up: mine ones, or every stack when the account is not an ironman.
Then :nearest() and interact("Take") take that stack (its id and its tile). Stacks at the same distance keep the scan order.
countcount: (GroundItemQuery) -> numberHow many survived the narrowing. Consumes the query.
nearestnearest: (GroundItemQuery) -> TileItem?The nearest survivor. Consumes the query.
nil when none survived.collectcollect: (GroundItemQuery) -> { TileItem }Every survivor, nearest first. Consumes the query.