getInitiativeList: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
(First version of the documentation)
 
mNo edit summary
Line 33: Line 33:
{{change|1.3b61|Added macro function (could have been b60)}}
{{change|1.3b61|Added macro function (could have been b60)}}
}}
}}
[[Category:Find Function]]
[[Category:Initiative Function]]
[[Category:Initiative Function]]

Revision as of 23:06, 20 November 2009

 This article is a stub, you can help the RPTools Wiki project by contributing content to expand this article.
 This article needs: more examples.

getInitiativeList() Function

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

Introduced in version 1.3.b61 (?)
Retrieves a list of all tokens currently in the Initiative Panel. The return value is a JSON object with various information about initiative, including global information (round number, which map is current, which token is current) and token-specific information (token id, initiative value, whether the token is holding or not). (Is this really trusted only?)

Usage

[ json = getInitiativeList() ]

Parameters None.

Example

The following code will simply return a JSON object and print each property name one at a time on separate lines. Refer to JSON_Object for more information about JSON object themselves and json.get for information on retrieving properties and their values.
[h: json = getInitiativeList() ]
[ foreach(item, json, "<br>"): item ]

This example prints a nicely formatted output showing what the contents of the JSON object look like.

[h: json = getInitiativeList() ]
<pre>[r: json.indent(json) ]</pre>


Version Changes

  • 1.3b61 - Added macro function (could have been b60)