getInfo: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
No edit summary
(added note)
Line 78: Line 78:
}
}
</source>
</source>
'''Note:'''
The {{code|getInfo("client")}} function returns the names of all the of lib: tokens. As a bonus if the
lib:token has a property called {{code|libversion}} the value of this property will be reported as the version.
|changes=
|changes=
* '''1.3b70''' - Added campaign option for {{code|topic}}}}
* '''1.3b70''' - Added campaign option for {{code|topic}}}}

Revision as of 21:27, 30 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". "campaign" is an option you can use since b70

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
}

Note: The getInfo("client") function returns the names of all the of lib: tokens. As a bonus if the

lib:token has a property called libversion the value of this property will be reported as the version.

Version Changes

  • 1.3b70 - Added campaign option for topic