Appearance
sdk.storage
Live depot discovery and deterministic depot-box operations. A route checkpoint is the search anchor; the locker itself is selected from the current viewport so plans do not depend on one city's appearance id.
lua
local M = require("sdk.storage")Constants
Lua 5.4 has no enums — these are integer (or string) fields on the module.
| Name | Value | Summary |
|---|---|---|
DEPOT_BOXES | DEPOT_BOXES | — |
find
function · find(origin, range, opts)
Nearest depot locker in the current viewport, plus the full candidate list. Origin is only a sort key (usually the player tile); the locker itself is picked from live WorldObjects so city-specific appearance ids stay out of plans. Same-floor by default; same_floor=false allows observed lockers upstairs.
is_open
function · is_open(inventory)
True when a depot/locker window is already open on this inventory snapshot. Prefers openContainers name/flags, then items{where="depot"} (nil err means open). Common: check this before walking to the locker or sending OpenDepot.
depot_box_info
function · depot_box_info(box_number)
Catalog row for depot box I..XX (clamped). Ids are official appearance ids. Common: use .id for MoveObject / UseObject and .name to match the open window.
depot_chest_entry
function · depot_chest_entry(inventory)
The locker chest (id 3502) inside an open depot — the parent of the 20 boxes. Missing means the locker UI is open but the chest row has not arrived yet.
depot_box_entry
function · depot_box_entry(inventory, box_number)
The closed depot-box item (I..XX) sitting in the locker, or nil if not listed. This is the UseObject target; depot_box_container is the already-open window.
depot_box_container
function · depot_box_container(inventory, box_number)
Already-open depot box window matching box I..XX by UI name. Common: after UseObject on depot_box_entry, poll this until the container appears.
next_container_index
function · next_container_index(inventory, minimum)
First unused client container index in minimum..15 (default min 2). Index 0/1 are often the backpack/quiver; opening a box on a live id replaces it.
supply_stash_entry
function · supply_stash_entry(inventory)
Supply-stash row in the open locker (id 28750 or a "supply stash" label). Distinct from depot boxes; stash withdraws use a different packet path.
operations
function · operations(inventory, policy, depot_box, opts)
Returns one safe, ordered operation per packet. Depot deposits precede withdrawals so carried capacity is released before restocking.