Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:GetBankData

From RoR Wiki
Revision as of 19:43, 16 October 2026 by Maintenance script (talk | contribs) (UI Lua API import (WAR 1.4.8))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

UI Lua API · Item functions
Version: WAR 1.4.8

Returns the items in the player's bank, one table per bank slot.

items = GetBankData()

Arguments

None.

Returns

items
table – Array of item data tables, indexed by bank slot from 1.

Details

  • There is one entry for every bank slot the player has, including empty slots. An empty slot has an item table with default values (id 0, empty name).
  • If the Lua state is not available, the function returns nothing. Unlike the other item getters, it does not check for a player object before reading the bank size, so only call it while the player is in the world.
  • A new table is built on every call. The stock UI caches it in DataUtils.GetBankData() (easystem_utils/source/datautils.lua) and rebuilds it only when GameData.Player.bankItemsDirty is set. To refresh a single slot, the stock bank window uses GetSingleItem.

Errors

None.

Example

From default/easystem_utils/source/datautils.lua:

function DataUtils.GetBankData ()
    if (GameData.Player.bankItemsDirty)
    then
        GameData.Player.bankItemsDirty = false
        DataUtilsData.bankItems= GetBankData()
    end

    return DataUtilsData.bankItems
end

See also