DirkScripts
Docs
Client
#lib.inventory.getItems
Get all items in the player's inventory.
lualocal items = lib.inventory.getItems()
#lib.inventory.hasItem
Check if the player has a specific item.
lualocal has = lib.inventory.hasItem(itemName, count, metadata, slot)
| Parameter | Type | Required | Description |
|---|---|---|---|
| itemName | string | yes | Item name |
| count | number | no | Minimum required count (default 1) |
| metadata | table | no | Required metadata match |
| slot | number | no | Specific slot to check |
#lib.inventory.getItemLabel
Get the display label for an item.
lualocal label = lib.inventory.getItemLabel(item)
| Parameter | Type | Required | Description |
|---|---|---|---|
| item | string | yes | Item name |
#lib.inventory.items
Get all registered item definitions.
lualocal allItems = lib.inventory.items()
#lib.inventory.displayMetadata
Register custom metadata labels to display in the inventory UI.
lualib.inventory.displayMetadata('serial', 'Serial Number') -- or lib.inventory.displayMetadata({ serial = 'Serial Number', quality = 'Quality' })
| Parameter | Type | Required | Description |
|---|---|---|---|
| labels | string | table | yes | Metadata key or key-value table |
| value | string | no | Label (when first param is a string) |
#lib.inventory.openStash
Open a stash inventory.
lualib.inventory.openStash(id, data)
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | string | yes | Stash identifier |
| data | table | no | Stash options |
