customShopAvailable() -> bool
Whether the custom-shop hooks are published.
if not customShopAvailable() { stop }
17 customshop commands, generated from the engine's own registry — signatures, parameters and a worked example each. A does something command acts on the game; a needs x() one answers a confident wrong answer when its client hooks are missing.
customShopAvailable() -> bool
Whether the custom-shop hooks are published.
if not customShopAvailable() { stop }
customShopBuy(id: int, amount: int) -> boolcustomShopBuy(name: string, amount: int) -> bool
Buys from the shop and waits for the bag to gain them. Refuses without sending when the shop does not stock it, has none left, or the currency in hand will not cover it.
Buys by name and waits for the bag to gain them.
| Parameter | Type | What it does |
|---|---|---|
| idrequired | int | the item id |
| amountrequired | int | how many to buy |
| namerequired | string | the item name |
if not customShopBuy(151, 10) { return 1000 }
customShopBuy("Coal", 10)
customShopBuyable(id: int) -> shopstock?customShopBuyable(name: string) -> shopstock?
The line the shop sells for this item, or none.
The line the shop sells with this name, or none.
| Parameter | Type | What it does |
|---|---|---|
| idrequired | int | the item id |
| namerequired | string | the item name |
let line = customShopBuyable(151)
let line = customShopBuyable("Coal")
customShopBuying() -> list<shopstock>
What the shop SELLS to you. Empty while the window is closed.
for line in customShopBuying() { print(line.name) }
customShopCanAfford(id: int, amount: int) -> bool
True when the currency in hand covers this many. Checks the price and what you are carrying, so it answers false for an item the shop does not sell.
| Parameter | Type | What it does |
|---|---|---|
| idrequired | int | the item id |
| amountrequired | int | how many |
if customShopCanAfford(151, 10) { customShopBuy(151, 10) }
customShopCurrency() -> int
The item id this shop prices in. Usually NOT coins - that is the whole point of a points shop, so never assume 10.
let paidIn = customShopCurrency()
customShopCurrencyName() -> string
The currency's name, for a printed line worth reading.
print("costs " + customShopCurrencyName())
customShopExists() -> bool
Whether this client has a custom/points shop at all. False on every server except DragonFire.
if not customShopExists() { stop }
customShopHeld() -> int
How much of this shop's currency you are carrying.
if customShopHeld() < 500 { stop }
customShopIsOpen() -> bool
True while the custom shop window is up. Separate from shopIsOpen() - both can be closed, and either can be open without the other.
if not customShopIsOpen() { return 600 }
customShopMissing() -> string
Which custom-shop hooks are unbound, as one line, or empty when they all are.
print(customShopMissing())
customShopName() -> string
What the shop calls itself, or an empty string when the server has not named it.
print(customShopName())
customShopPayout(id: int) -> int
What the shop pays for one, or -1 when it will not take it.
| Parameter | Type | What it does |
|---|---|---|
| idrequired | int | the item id |
if customShopPayout(151) < 5 { stop }
customShopPrice(id: int) -> int
What one costs, in this shop's currency, or -1 when it does not sell it. -1 rather than 0 so "free" and "not for sale" are never the same answer.
| Parameter | Type | What it does |
|---|---|---|
| idrequired | int | the item id |
if customShopPrice(151) > 0 { customShopBuy(151, 1) }
customShopSell(id: int, amount: int) -> boolcustomShopSell(name: string, amount: int) -> bool
Sells to the shop and waits for the bag to lose them. Clamped to what is carried: the sell list says what the shop accepts, not how many you have.
Sells by name and waits for the bag to lose them.
| Parameter | Type | What it does |
|---|---|---|
| idrequired | int | the item id |
| amountrequired | int | how many to sell |
| namerequired | string | the item name |
if not customShopSell(151, 10) { return 1000 }
customShopSell("Coal", 10)
customShopSellable(id: int) -> shopstock?
The line the shop accepts for this item, or none.
| Parameter | Type | What it does |
|---|---|---|
| idrequired | int | the item id |
if customShopSellable(151) == none { stop }
customShopSelling() -> list<shopstock>
What the shop BUYS from you. A different set from customShopBuying() - a custom shop need not accept what it sells.
for line in customShopSelling() { print(line.name) }