getInfo: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
(Moved "coming in 1.7" content into the example output. Added "coming in 1.8" changes to client and server info)
m (Updating to reflect that 1.8 has been released.)
Line 69: Line 69:
   "portrait size": 175,
   "portrait size": 175,
   "show portrait": true,
   "show portrait": true,
  "show avatar in chat": true,
  "suppress tooltips for macroLinks": false,
  "use tooltips for inline rolls": true,
   "user defined functions": {
   "user defined functions": {
     "a5e.rollDice": "rollDice@Lib:Addon5e",
     "a5e.rollDice": "rollDice@Lib:Addon5e",
Line 87: Line 90:
'''Note:'''
'''Note:'''
The {{code|getInfo("client")}} function returns the names of all 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 value.
The {{code|getInfo("client")}} function returns the names of all 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 value.
====Changes coming in 1.8====
This output will include the following additional client preferences:
<pre>
  "show avatar in chat": true,
  "suppress tooltips for macroLinks": false,
  "use tooltips for inline rolls": true,
</pre>


===Retrieve {{code|server}} Information===
===Retrieve {{code|server}} Information===
Line 114: Line 110:
   "movement metric": "ONE_TWO_ONE",
   "movement metric": "ONE_TWO_ONE",
   "hosting server": 1,
   "hosting server": 1,
  "personal server": 1,
   "players can reveal": 1,
   "players can reveal": 1,
   "players receive campaign macros": 1,
   "players receive campaign macros": 1,
Line 125: Line 122:
   "individual fow": 0
   "individual fow": 0
}
}
</pre>
====Changes coming in 1.8====
This output will include a "personal server" indicator.  If {{code|"personal server"}} is {{code|1}}, then the user is neither running nor connected to an actual server.
<pre>
  "personal server": 1
</pre>
</pre>



Revision as of 05:48, 16 February 2021

getInfo() Function

Introduced in version 1.3b69
Returns a JSON Object 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", "server", or "campaign".

Examples

===Retrieve map Information===
<!-- print the JSON Object about the current map to the chat window -->
<pre>
[r: json.indent(getInfo("map"), 2)]
</pre>

Sample output:

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
}

Retrieve client Information

<!-- print the JSON Object about client information to the chat window -->
<pre>
[r: json.indent(getInfo("client"), 2)]
</pre>

Sample output:

client
{
  "library tokens": {
    "Lib:cifMacroIO": "unknown"
  },
  "portrait size": 175,
  "show portrait": true,
  "show avatar in chat": true,
  "suppress tooltips for macroLinks": false,
  "use tooltips for inline rolls": true,
  "user defined functions": {
    "a5e.rollDice": "rollDice@Lib:Addon5e",
    "a5e.jget": "jget@Lib:Addon5e"
  },
  "timeDate": "2010-10-13 19:03:38",
  "timeInMs": 1286989418105,
  "isoTimeDate": "2019-11-10T10:35:45.8438226-07:00",
  "show stat sheet": true,
  "file sync directory": "C:\\Gaming\\Audio",
  "version": "DEVELOPMENT",
  "client id": "ee30250f-3a6f-4ae0-a888-8400abd339cf",
  "face vertex": 1,
  "face edge": 1
}

Note: The getInfo("client") function returns the names of all Lib: tokens. As a bonus if the Lib: token has a property called libversion, the value of this property will be reported as the value.

Retrieve server Information

<!-- print the JSON Object about server information to the chat window -->
<pre>
[r: json.indent(getInfo("server"), 2)]
</pre>

Sample output:

server
{
  "GM reveals vision for unowned tokens": 0,
  "restricted impersonation": 0,
  "tooltips for default roll format": 1,
  "movement locked": 0,
  "gm": ["GM"],
  "movement metric": "ONE_TWO_ONE",
  "hosting server": 1,
  "personal server": 1,
  "players can reveal": 1,
  "players receive campaign macros": 1,
  "auto reveal on movement": 1,
  "strict token management": 1,
  "using ai": 1,
  "vbl blocks movement": 1,
  "timeDate": "2019-09-22 18:09:02",
  "timeInMs": 1569197342110,
  "individual views": 1,
  "individual fow": 0
}

Retrieve campaign Information

<!-- print the JSON Object about the campaign to the chat window -->
<pre>
[r: json.indent(getInfo("campaign"), 2)]
</pre>


Sample output:

campaign
{
    "tables": [],
    "initiative owner permissions": 1,
    "id": "C0A8001E7F7E199B0B0000008008001E",
    "sight": {
	"Darkvision": {
	    "distance": 0,
	    "arc": 0,
	    "shape": "CIRCLE",
	    "type": 0,
	    "multiplier": 1 },
	"Normal Vision - Short Range": {
	    "distance": 0,
	    "arc": 0,
	    "shape": "CIRCLE",
	    "type": 0,
	    "multiplier": 1 },
	"Normal": {
	    "distance": 0,
	    "arc": 0,
	    "shape": "CIRCLE",
	    "type": 0,
	    "multiplier": 1 },
	"Square Vision": {
	    "distance": 0,
	    "arc": 0,
	    "shape": "SQUARE",
	    "type": 0,
	    "multiplier": 1 },
	"Lowlight": {
	    "distance": 0,
	    "arc": 0,
	    "shape": "CIRCLE",
	    "type": 0,
	    "multiplier": 2 },
	"Conic Vision": {
	    "distance": 120,
	    "arc": 120,
	    "shape": "CONE",
	    "type": 0,
	    "multiplier": 1 }
    },
    "initiative movement locked": 1,
    "light sources": {
	"D20": [
	    {
		"name": "Lantern, Hooded - 30",
		"light segments": [
		    {
			"GM": false,
			"arcAngle": 360,
			"facingOffset": 0,
			"ownerOnly": false,
			"paint": null,
			"radius": 30,
			"shape": null },
		    {
			"GM": false,
			"arcAngle": 360,
			"facingOffset": 0,
			"ownerOnly": false,
			"paint": {"color":1677721600},
			"radius": 60,
			"shape": null } ],
		"type": "NORMAL",
		"max range": 60 },
	    {
		"name": "Candle - 5",
		"light segments": [
		    {
			"GM": false,
			"arcAngle": 360,
			"facingOffset": 0,
			"ownerOnly": false,
			"paint": null,
			"radius": 5,
			"shape": null },
		    {
			"GM": false,
			"arcAngle": 360,
			"facingOffset": 0,
			"ownerOnly": false,
			"paint": {"color":1677721600},
			"radius": 10,
			"shape": null } ],
		"type": "NORMAL",
		"max range": 10 },
	    {
		"name": "Lamp - 15",
		"light segments": [
		    {
			"GM": false,
			"arcAngle": 360,
			"facingOffset": 0,
			"ownerOnly": false,
			"paint": null,
			"radius": 15,
			"shape": null },
		    {
			"GM": false,
			"arcAngle": 360,
			"facingOffset": 0,
			"ownerOnly": false,
			"paint": {"color":1677721600},
			"radius": 30,
			"shape": null } ],
		"type": "NORMAL",
		"max range": 30 },
	    {
		"name": "Torch - 20",
		"light segments": [
		    {
			"GM": false,
			"arcAngle": 360,
			"facingOffset": 0,
			"ownerOnly": false,
			"paint": null,
			"radius": 20,
			"shape": null },
		    {
			"GM": false,
			"arcAngle": 360,
			"facingOffset": 0,
			"ownerOnly": false,
			"paint": {"color":1677721600},
			"radius": 40,
			"shape": null } ],
		"type": "NORMAL",
		"max range": 40 },
	    {
		"name": "Sunrod - 30",
		"light segments": [
		    {
			"GM": false,
			"arcAngle": 360,
			"facingOffset": 0,
			"ownerOnly": false,
			"paint": null,
			"radius": 30,
			"shape": null },
		    {
			"GM": false,
			"arcAngle": 360,
			"facingOffset": 0,
			"ownerOnly": false,
			"paint": {"color":1677721600},
			"radius": 60,
			"shape": null } ],
		"type": "NORMAL",
		"max range": 60 },
	    {
		"name": "Everburning - 20",
		"light segments": [
		    {
			"GM": false,
			"arcAngle": 360,
			"facingOffset": 0,
			"ownerOnly": false,
			"paint": null,
			"radius": 20,
			"shape": null },
		    {
			"GM": false,
			"arcAngle": 360,
			"facingOffset": 0,
			"ownerOnly": false,
			"paint": {"color":1677721600},
			"radius": 40,
			"shape": null } ],
		"type": "NORMAL",
		"max range": 40 } ],
	"Generic": [
	    {
		"name": "5",
		"light segments": [
		    {
			"GM": false,
			"arcAngle": 360,
			"facingOffset": 0,
			"ownerOnly": false,
			"paint": null,
			"radius": 5,
			"shape": null } ],
		"type": "NORMAL",
		"max range": 5 },
	    {
		"name": "40",
		"light segments": [
		    {
			"GM": false,
			"arcAngle": 360,
			"facingOffset": 0,
			"ownerOnly": false,
			"paint": null,
			"radius": 40,
			"shape": null } ],
		"type": "NORMAL",
		"max range": 40 },
	    {
		"name": "20",
		"light segments": [
		    {
			"GM": false,
			"arcAngle": 360,
			"facingOffset": 0,
			"ownerOnly": false,
			"paint": null,
			"radius": 20,
			"shape": null } ],
		"type": "NORMAL",
		"max range": 20 },
	    {
		"name": "60",
		"light segments": [
		    {
			"GM": false,
			"arcAngle": 360,
			"facingOffset": 0,
			"ownerOnly": false,
			"paint": null,
			"radius": 60,
			"shape": null } ],
		"type": "NORMAL",
		"max range": 60 },
	    {
		"name": "15",
		"light segments": [
		    {
			"GM": false,
			"arcAngle": 360,
			"facingOffset": 0,
			"ownerOnly": false,
			"paint": null,
			"radius": 15,
			"shape": null } ],
		"type": "NORMAL",
		"max range": 15 },
	    {
		"name": "30",
		"light segments": [
		    {
			"GM": false,
			"arcAngle": 360,
			"facingOffset": 0,
			"ownerOnly": false,
			"paint": null,
			"radius": 30,
			"shape": null } ],
		"type": "NORMAL",
		"max range": 30 } ] },
    "bars": {
	"no group": [
	    {
		"increment": 0,
		"side": "TOP",
		"name": "Health" } ] },
    "states": {
	"no group": [
	    "Incapacitated",
	    "Disabled",
	    "Other2",
	    "Other",
	    "Other3",
	    "Prone",
	    "Hidden",
	    "Dead",
	    "Other4" ] },
    "remote repository": [],
    "zones": {
	"Grasslands": "C0A8001E7E7F199B0C0000008008001E" }
}

Version Changes

  • 1.3b70 - Added "campaign" option for topic
  • 1.3b76 - Added values "timeInMS" and "timeDate" to both client and server return values
  • 1.3b90 - Added value "gm" to server return value that holds an array of logged in game masters
  • 1.5.4 - Added values "auto reveal on movement" and "individual fow" to server return values
  • 1.5.5 - Added values "GM reveals vision for unowned tokens" and "hosting server" to server return values
  • 1.5.7 - Added prefs setting "file sync directory" and "isoTimeDate" to client return values
  • 1.5.9 - Removed "initiative owner permissions " from server return values. Still in campaign info.
  • 1.6.0 - Added "using ai" and "vbl blocks movment" to server return values.
  • 1.7.0 - Added macro location information to "user defined functions" portion of client info
  • 1.8.0 - Added additional client preferences to client info, and "personal server" indicator to server info