Repository navigation
Restock Settings
Keeps you stocked with consumables such as arrows, bolts, sling rocks, throwing weapons and runestones. For each item in your restock: list, it counts how many you have. If you're low, it takes coins out of the bank, walks to the shop, buys enough to get back to your target, puts them away, and banks the change.
It runs once and exits. ;hunting-buddy runs it for you each time it starts (see Usage).
All of these go under restock: unless noted.
restock:
arrow:
quantity: 40
tk_ammo:
quantity: 5
min_quantity: 2For the keys below, restock already knows the shop, the price and how many come with each purchase (from data/base-consumables.yaml), for your hometown (or your fang_cove_override_town, if set). Only add what you want to change, usually quantity.
Put at least one setting under each item. An item with nothing under it (arrow: on its own line) stops the script with an error.
| Town | Key | Item | Per purchase | Default quantity |
|---|---|---|---|---|
| Crossing | arrow | boar-tusk arrows | 5 | 30 |
| bolt | crossbow bolts | 15 | 30 | |
| tk_ammo | short-handled kris | 1 | 3 | |
| rock | small rocks | 10 | 30 | |
| milk | fresh milk | 1 | 5 | |
| Langenfirth, Therenborough | arrow | long arrows | 15 | 30 |
| bolt | crossbow bolts | 15 | 30 | |
| rock | small rocks | 10 | 30 | |
| Shard | arrow | long arrows | 15 | 30 |
| bolt | crossbow bolts | 15 | 30 | |
| tk_ammo | brass razor | 1 | 1 | |
| rock | large rocks | 15 | 30 | |
| runestones | see Runestones below | 1 | 1 | |
| Riverhaven | arrow | barbed arrows | 15 | 30 |
| bolt | crossbow bolts | 15 | 30 | |
| Hibarnhvidar | arrow | long arrows | 10 | 30 |
| bolt | crossbow bolts | 15 | 30 | |
| tk_ammo | big-fist katar | 1 | 3 | |
| rock | smooth rocks | 30 | 30 | |
| Mer'Kresh | arrow | broad-barbed arrows | 10 | 30 |
| bolt | crossbow bolts | 15 | 30 | |
| Aesry | arrow | triple-fluted arrows | 10 | 20 |
| bolt | aged oak crossbow bolts | 15 | 15 | |
| rock | large rocks | 15 | 15 |
Therenborough's shop is behind citizenship, so Therenborough uses Langenfirth's shop. Other towns have no built-in items; use your own items instead (see below).
Shard only. The key is the spell's name, and must match exactly, capitals included.
| Key | Runestone |
|---|---|
| Arc Light | calavarite runestone |
| Athleticism | selenite runestone |
| Bless | elbaite runestone |
| Calm | xibaryl runestone |
| Clear Vision | avaes runestone |
| Compost | asketine runestone |
| Eagle's Cry | electrum runestone |
| Fire Shards | rhodonite runestone |
| Geyser | celestite runestone |
| Glythtide's Gift | axinite runestone |
| Protection from Evil | topaz runestone |
| Refresh | quartz runestone |
| Shadows | azurite runestone |
| Zephyr | imnera runestone |
| Setting | Default | Purpose |
|---|---|---|
| quantity | from the list | How many you want. When you have fewer, it buys enough to get back to at least this many. Purchases come in packs of size, so it can go over: with 27 Crossing arrows and quantity: 30, it buys one bundle of 5 and you end up with 32. |
| min_quantity | Wait until you have fewer than this before restocking, then buy back up to quantity. Without it, it restocks as soon as you have fewer than quantity. |
|
| container | The container to count this item in, and to put new ones into. See How counting works. | |
| countable_name | What to look for when counting, if it isn't name. Only used with container. |
|
| clerk | Get the item with ask <clerk> for <name> instead of buying it. |
|
| hometown | Buy this item in another town. See Buying in another town. | |
| name, size, room, price, stackable | from the list | You can change these too. See Your own items. |
restock:
my_item:
name: <what you type after BUY>
size: 1
room: 1234
price: 500
stackable: false
quantity: 10Any key that isn't in the list for your town needs all six of these. If one is missing, the item is skipped with No hometown of explicit data for '<key>'.
| Setting | Purpose |
|---|---|
| name | What you'd type after buy (or ask <clerk> for), for example boar-tusk arrows. It's also used to COUNT, TAP and PUT the item, so it has to work for those too. |
| size | How many you get for one purchase: 5 for a bundle of five arrows, 1 for a single item. |
| room | The shop's room id. |
| price | What one purchase costs, in coppers of that town's currency. It's only used to work out how much to take out of the bank. |
| stackable |
true for things that stack, where COUNT tells you how many are left, like arrows, bolts and rocks. false for single items. |
| quantity | How many you want, as above. |
restock:
Refresh:
hometown: Shard
name: quartz runestone
size: 1
room: 13105
price: 8118
stackable: false
quantity: 2An item with its own hometown is bought in that town. Restock doesn't look these up in the built-in list, even for a built-in key, so give it all six fields. You can copy them from data/base-consumables.yaml.
Restock does your own town first, then each other town in turn. In each town it takes the coins out of, and banks them in, that town's bank, in its currency. In other towns it doesn't take sell_loot_money_on_hand back out.
hometown: Fang Cove
fang_cove_override_town: CrossingTop level. Your hometown picks the built-in list, and it's where coins are withdrawn and banked for items without their own hometown.
Fang Cove has no built-in list, so with hometown: Fang Cove and no override, the built-in keys are skipped. Set fang_cove_override_town to the mainland town you shop in. Restock then uses that town for everything: its built-in list, its shops, and its bank, in its currency. It doesn't take sell_loot_money_on_hand back out there, and the dokoras you carry are left alone.
sell_loot_money_on_hand: 3 silver| Setting | Default | Purpose |
|---|---|---|
| sell_loot_money_on_hand | 3 silver | Top level, and shared with sell-loot. After buying in your hometown, restock deposits all your coins and takes this much back out. In any other town, including your fang_cove_override_town, it deposits without taking any back out. Write it as an amount and a coin, like 3 silver or 1 gold. |
If you use a bank bot (bankbot_enabled), withdrawals go through it when it's in its room, and through the bank otherwise. Deposits are always at the bank. The bot always pays out in your hometown's currency, even when restock is buying in another town. In a town with a different currency, such as your fang_cove_override_town, that money can't pay the shops.
storage_containers:
- backpack
- duffel bag
runestone_storage: backpack| Setting | Default | Purpose |
|---|---|---|
| storage_containers | Top level. Opened at the start, so what's inside can be counted. | |
| runestone_storage | backpack | Top level, and shared with invoke-rune. New runestones go here, unless the item has its own container. Any item with "runestone" in its name counts. |
There are no settings for these; this is what to expect.
-
Stackable items. It counts each stack with
count my first <name>,count my second <name>and so on, up to twenty stacks, and adds them up. It also understands items that show how many uses are left. An empty one counts as 0 and is left where it is, with the message<ordinal> <name> is empty; skipping it, so throw empty ones away yourself. If COUNT can't tell it anything, it treats the item as a single item instead. -
Single items (
stackable: false). With acontainer, it rummages that container and counts the matches. Without one, it TAPs the item to find which container the first one is in, and counts only that container. If TAP doesn't find one inside a container (you have none, or it's in your hands or worn), it counts 0 and buys the full amount.
Set container for single items you keep in more than one place, or that you wear or keep "on" something rather than "in" it.
There are no settings for these; this is what to expect.
- Opens your
storage_containers. - Counts each item for your hometown (or your
fang_cove_override_town). - For each item below
quantity(and belowmin_quantity, if set), works out how many purchases it needs: what's missing divided bysize, rounded up. - If nothing's needed, it stops there, without going to the bank.
- Stows whatever's in your hands.
- Gets the coins:
pricetimes the purchases for each item, plus 2,502 coppers per item to cover Shard's night-time bribes. It only withdraws what you don't already have on you. - For each purchase, walks to the shop and BUYs the item, OFFERing the price the shopkeeper asks (or ASKs the clerk). If you're too encumbered to take it, the shop leaves it on the counter and restock picks it up from there. Then it puts it away: in its
container, inrunestone_storagefor runestones, and otherwise with STOW. - Walks to the bank and deposits all your coins in that town's currency, not just the change. In your
hometown, it then takessell_loot_money_on_handback out. - Repeats steps 2 to 8 for each other town named by an item's
hometown.
It doesn't check that the withdrawal worked. If you don't have the money in the bank, it still walks to each shop and tries to buy.
hometown: Crossing
sell_loot_money_on_hand: 3 silver
storage_containers:
- backpack
runestone_storage: backpack
restock:
arrow:
quantity: 40
min_quantity: 15
tk_ammo:
quantity: 5
Refresh:
hometown: Shard
name: quartz runestone
size: 1
room: 13105
price: 8118
stackable: false
quantity: 2| Argument | Purpose |
|---|---|
| debug | Shows each item as read from your settings, the item list after the built-in values are filled in, each count, and the coins it needs. |
;restock
;restock debug
;hunting-buddy runs ;restock every time it starts and waits for it to finish, unless you have sell_loot_skip_bank: true. With nothing in restock:, that run just opens your storage containers.
With runestone_purchase: true, ;invoke-rune runs ;restock when it can't find the runestone in your runestone_storage (unless ;combat-trainer is running), then casts. Add that runestone to your restock: list: by spell name if your hometown is Shard, otherwise as an item with hometown: Shard (see Buying in another town). If restock doesn't buy it, invoke-rune runs restock over and over.
t2_before_startup:
- restockT2 waits for it to finish before it starts training.