getTableEntry

From RPTools Wiki
Revision as of 23:59, 25 October 2024 by Full Bleed (talk | contribs) (Added "picked" return element in the example.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

getTableEntry() Function

 Note: This function can only be used in a Trusted Macro

Introduced in version 1.5.4
Retrieves the raw table data for the specified entry as a JSON object. Returns an empty string if the entry doesn't exist. If no image is associated with the entry the assetid will be an empty string.

Usage

getTableEntry(table, roll)

Parameters

  • table - Name of table as a string.
  • roll - The entry to retrieve as if a roll of that value had been made.

Example

Get the entry from table "Critters" matching a roll of 4.
[r: getTableEntry("Critters", 4)]

Returns:

{"min":3, "max":5, "value": "duck", "picked":false, "assetid":""}

See Also