isOpen
isOpen: (Shop) -> booleanWhether a shop interface is open.
Shop stock and buy/sell actions.
shop| Method | Returns | Description |
|---|---|---|
isOpen() | boolean | Whether a shop interface is open. |
close() | boolean | Close the shop. |
contains(number) | boolean | Whether the shop stocks an item. |
containsName(string) | boolean | Whether the shop stocks an item whose whole name matches, ignoring case: | separates alternatives and * is any run of characters. |
items() | { ShopItem } | Everything the shop has in stock; empty when it is shut. |
item(number) | ShopItem? | The row stocking an item, resolved live. |
stock(number) | number | How many of an item the shop currently holds. |
buyOptions(number) | { number } | Which buy quantities the shop offers for an item, in menu order. |
buy1(number) | boolean | Buy one of an item by id. |
buy5(number) | boolean | Buy five of an item by id. |
buy10(number) | boolean | Buy ten of an item by id. |
buy50(number) | boolean | Buy fifty of an item by id. |
sellOptions(number) | { number } | Which sell quantities the shop offers for an item, in menu order. |
sell1(number) | boolean | Sell one, by id. |
sell5(number) | boolean | Sell five, by id. |
sell10(number) | boolean | Sell ten, by id. |
sell50(number) | boolean | Sell fifty, by id. |
isOpenisOpen: (Shop) -> booleanWhether a shop interface is open.
closeclose: (Shop) -> booleanClose the shop.
false when no shop is open.containscontains: (Shop, number) -> booleanWhether the shop stocks an item.
itemIdcontainsNamecontainsName: (Shop, string) -> booleanWhether the shop stocks an item whose whole name matches, ignoring case: | separates alternatives and * is any run of characters.
name"Air rune" or "* rune".itemsitems: (Shop) -> { ShopItem }Everything the shop has in stock; empty when it is shut.
itemitem: (Shop, number) -> ShopItem?The row stocking an item, resolved live.
Shop layout is not fixed, so a slot is not a stable way to name what you want -- an id is.
itemIdnil when the shop is shut or does not stock it.stockstock: (Shop, number) -> numberHow many of an item the shop currently holds.
itemId0 when it is not stocked, or the shop is shut.buyOptionsbuyOptions: (Shop, number) -> { number }Which buy quantities the shop offers for an item, in menu order.
A shop quantity is a MENU OPTION, not a number: the row's right-click is Value / Buy 1 / Buy 5 / Buy 10 / Buy 50, and some shops omit 50. That is why the buys below are four named calls rather than one taking a count -- an unavailable quantity has no option to click.
itemIdbuy1buy1: (Shop, number) -> booleanBuy one of an item by id.
itemIdItemID.AIR_RUNE.buy5buy5: (Shop, number) -> booleanBuy five of an item by id.
itemIdbuy10buy10: (Shop, number) -> booleanBuy ten of an item by id.
itemIdbuy50buy50: (Shop, number) -> booleanBuy fifty of an item by id.
The game truncates to available stock, so this buys twelve when twelve are stocked. Keep the option at or below your own remaining target.
itemIdsellOptionssellOptions: (Shop, number) -> { number }Which sell quantities the shop offers for an item, in menu order.
itemIdsell1sell1: (Shop, number) -> booleanSell one, by id.
itemIdsell5sell5: (Shop, number) -> booleanSell five, by id.
itemIdsell10sell10: (Shop, number) -> booleanSell ten, by id.
itemIdsell50sell50: (Shop, number) -> booleanSell fifty, by id.
itemId