getInfo: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
(New page: {{MacroFunction |name=getInfo |version=1.3b69 |description= Returns a json with lots of information about a specified topic. |usage= <source lang="mtmacro" line> getInfo(topic) </source> ...)
 
(removed category)
Line 79: Line 79:
</source>
</source>
}}
}}
[[Category:Token Function]]

Revision as of 19:09, 13 June 2010

getInfo() Function

Introduced in version 1.3b69
Returns a json with lots of information about a specified topic.

Usage

getInfo(topic)

Parameter

  • topic - A string specifying the topic of the retrieved information. Can be "map", "client" or "server".

Examples

<!-- print the info json about the current map to the chat -->
<pre>
[r:json.indent(getInfo("map"), 4)]
</pre>

Sample output for the given topics:

map
{
"id": "0A00010782897D2C3700000008000102",
"image y scale": 1,
"height": 0,
"largest Z order": 2,
"width": 0,
"name": "Grasslands",
"creation time": 1276351711618,
"grid":     {
"cell offset height": 0,
"cell width": 50,
"color": "ff000000",
"cell offset width": 0,
"units per cell": 5,
"cell height": 50,
"second dimension": 0,
"type": "Square",
"x offset": 0,
"y offset": 0,
"size": 50
},
"vision type": "off",
"image x scale": 1,
"player visible": 1
}

client
{
"movement metric": "ONE_TWO_ONE",
"library tokens":     {
"Lib:test1": "1.2",
"Lib:Test": "unknown"
},
"portrait size": 175,
"user defined functions": ["testFunc"],
"show stat sheet": true,
"face vertex": 0,
"version": "DEVELOPMENT",
"face edge": 1
}



server
{
"initiative owner permissions": 0,
"players can reveal": 0,
"movement locked": 0,
"tooltips for default roll format": 1,
"individual views": 0,
"players receive campaign macros": 0,
"strict token management": 0,
"restricted impersonation": 0
}