RPTools

Personal tools
From MapToolDoc

getInfo

Contents

getInfo() Function

Introduced in version 1.3b69

Returns a JSON Object with lots of information about a specified topic.

Usage

  1. getInfo(topic)

Parameter

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

Examples

Retrieve map Information

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

Sample output:

  1. map
  2. {
  3.   "id": "0A00010782897D2C3700000008000102",
  4.   "image y scale": 1,
  5.   "height": 0,
  6.   "largest Z order": 2,
  7.   "width": 0,
  8.   "name": "Grasslands",
  9.   "creation time": 1276351711618,
  10.   "grid":     {
  11.     "cell offset height": 0,
  12.     "cell width": 50,
  13.     "color": "ff000000",
  14.     "cell offset width": 0,
  15.     "units per cell": 5,
  16.     "cell height": 50,
  17.     "second dimension": 0,
  18.     "type": "Square",
  19.     "x offset": 0,
  20.     "y offset": 0,
  21.     "size": 50
  22.   },
  23.   "vision type": "off",
  24.   "image x scale": 1,
  25.   "player visible": 1
  26. }

Retrieve client Information

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

Sample output:

  1. client
  2. {
  3.   "movement metric": "ONE_TWO_ONE",
  4.   "library tokens": {
  5.     "Lib:cifMacroIO": "unknown"
  6.   },
  7.   "portrait size": 175,
  8.   "user defined functions": [
  9.     "getMacroGroups",
  10.      "redefined_1_getMacroGroups",
  11.      "l.decode",
  12.      "redefined_0_l.decode"
  13.   ],
  14.   "timeDate": "2010-10-13 19:03:38",
  15.   "timeInMs": 1286989418105,
  16.   "show stat sheet": true,
  17.   "face vertex": 1,
  18.   "version": "DEVELOPMENT",
  19.   "face edge": 1
  20. }

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

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

Sample output:

  1. server
  2. {
  3.   "initiative owner permissions": 0,
  4.   "players can reveal": 0,
  5.   "movement locked": 0,
  6.   "tooltips for default roll format": 1,
  7.   "individual views": 0,
  8.   "players receive campaign macros": 0,
  9.   "strict token management": 0,
  10.   "restricted impersonation": 0
  11. }

Retrieve campaign Information

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

This sample output is nicely formatted in the wiki source. I guess you'll have to look at it there (or look at the HTML) to see it:

  1. campaign
  2. {
  3.     "tables": [],
  4.     "initiative owner permissions": 1,
  5.     "id": "C0A8001E7F7E199B0B0000008008001E",
  6.     "sight": {
  7. 	"Darkvision": {
  8. 	    "distance": 0,
  9. 	    "arc": 0,
  10. 	    "shape": "CIRCLE",
  11. 	    "type": 0,
  12. 	    "multiplier": 1 },
  13. 	"Normal Vision - Short Range": {
  14. 	    "distance": 0,
  15. 	    "arc": 0,
  16. 	    "shape": "CIRCLE",
  17. 	    "type": 0,
  18. 	    "multiplier": 1 },
  19. 	"Normal": {
  20. 	    "distance": 0,
  21. 	    "arc": 0,
  22. 	    "shape": "CIRCLE",
  23. 	    "type": 0,
  24. 	    "multiplier": 1 },
  25. 	"Square Vision": {
  26. 	    "distance": 0,
  27. 	    "arc": 0,
  28. 	    "shape": "SQUARE",
  29. 	    "type": 0,
  30. 	    "multiplier": 1 },
  31. 	"Lowlight": {
  32. 	    "distance": 0,
  33. 	    "arc": 0,
  34. 	    "shape": "CIRCLE",
  35. 	    "type": 0,
  36. 	    "multiplier": 2 },
  37. 	"Conic Vision": {
  38. 	    "distance": 120,
  39. 	    "arc": 120,
  40. 	    "shape": "CONE",
  41. 	    "type": 0,
  42. 	    "multiplier": 1 }
  43.     },
  44.     "initiative movement locked": 1,
  45.     "light sources": {
  46. 	"D20": [
  47. 	    {
  48. 		"name": "Lantern, Hooded - 30",
  49. 		"light segments": [
  50. 		    {
  51. 			"GM": false,
  52. 			"arcAngle": 360,
  53. 			"facingOffset": 0,
  54. 			"ownerOnly": false,
  55. 			"paint": null,
  56. 			"radius": 30,
  57. 			"shape": null },
  58. 		    {
  59. 			"GM": false,
  60. 			"arcAngle": 360,
  61. 			"facingOffset": 0,
  62. 			"ownerOnly": false,
  63. 			"paint": {"color":1677721600},
  64. 			"radius": 60,
  65. 			"shape": null } ],
  66. 		"type": "NORMAL",
  67. 		"max range": 60 },
  68. 	    {
  69. 		"name": "Candle - 5",
  70. 		"light segments": [
  71. 		    {
  72. 			"GM": false,
  73. 			"arcAngle": 360,
  74. 			"facingOffset": 0,
  75. 			"ownerOnly": false,
  76. 			"paint": null,
  77. 			"radius": 5,
  78. 			"shape": null },
  79. 		    {
  80. 			"GM": false,
  81. 			"arcAngle": 360,
  82. 			"facingOffset": 0,
  83. 			"ownerOnly": false,
  84. 			"paint": {"color":1677721600},
  85. 			"radius": 10,
  86. 			"shape": null } ],
  87. 		"type": "NORMAL",
  88. 		"max range": 10 },
  89. 	    {
  90. 		"name": "Lamp - 15",
  91. 		"light segments": [
  92. 		    {
  93. 			"GM": false,
  94. 			"arcAngle": 360,
  95. 			"facingOffset": 0,
  96. 			"ownerOnly": false,
  97. 			"paint": null,
  98. 			"radius": 15,
  99. 			"shape": null },
  100. 		    {
  101. 			"GM": false,
  102. 			"arcAngle": 360,
  103. 			"facingOffset": 0,
  104. 			"ownerOnly": false,
  105. 			"paint": {"color":1677721600},
  106. 			"radius": 30,
  107. 			"shape": null } ],
  108. 		"type": "NORMAL",
  109. 		"max range": 30 },
  110. 	    {
  111. 		"name": "Torch - 20",
  112. 		"light segments": [
  113. 		    {
  114. 			"GM": false,
  115. 			"arcAngle": 360,
  116. 			"facingOffset": 0,
  117. 			"ownerOnly": false,
  118. 			"paint": null,
  119. 			"radius": 20,
  120. 			"shape": null },
  121. 		    {
  122. 			"GM": false,
  123. 			"arcAngle": 360,
  124. 			"facingOffset": 0,
  125. 			"ownerOnly": false,
  126. 			"paint": {"color":1677721600},
  127. 			"radius": 40,
  128. 			"shape": null } ],
  129. 		"type": "NORMAL",
  130. 		"max range": 40 },
  131. 	    {
  132. 		"name": "Sunrod - 30",
  133. 		"light segments": [
  134. 		    {
  135. 			"GM": false,
  136. 			"arcAngle": 360,
  137. 			"facingOffset": 0,
  138. 			"ownerOnly": false,
  139. 			"paint": null,
  140. 			"radius": 30,
  141. 			"shape": null },
  142. 		    {
  143. 			"GM": false,
  144. 			"arcAngle": 360,
  145. 			"facingOffset": 0,
  146. 			"ownerOnly": false,
  147. 			"paint": {"color":1677721600},
  148. 			"radius": 60,
  149. 			"shape": null } ],
  150. 		"type": "NORMAL",
  151. 		"max range": 60 },
  152. 	    {
  153. 		"name": "Everburning - 20",
  154. 		"light segments": [
  155. 		    {
  156. 			"GM": false,
  157. 			"arcAngle": 360,
  158. 			"facingOffset": 0,
  159. 			"ownerOnly": false,
  160. 			"paint": null,
  161. 			"radius": 20,
  162. 			"shape": null },
  163. 		    {
  164. 			"GM": false,
  165. 			"arcAngle": 360,
  166. 			"facingOffset": 0,
  167. 			"ownerOnly": false,
  168. 			"paint": {"color":1677721600},
  169. 			"radius": 40,
  170. 			"shape": null } ],
  171. 		"type": "NORMAL",
  172. 		"max range": 40 } ],
  173. 	"Generic": [
  174. 	    {
  175. 		"name": "5",
  176. 		"light segments": [
  177. 		    {
  178. 			"GM": false,
  179. 			"arcAngle": 360,
  180. 			"facingOffset": 0,
  181. 			"ownerOnly": false,
  182. 			"paint": null,
  183. 			"radius": 5,
  184. 			"shape": null } ],
  185. 		"type": "NORMAL",
  186. 		"max range": 5 },
  187. 	    {
  188. 		"name": "40",
  189. 		"light segments": [
  190. 		    {
  191. 			"GM": false,
  192. 			"arcAngle": 360,
  193. 			"facingOffset": 0,
  194. 			"ownerOnly": false,
  195. 			"paint": null,
  196. 			"radius": 40,
  197. 			"shape": null } ],
  198. 		"type": "NORMAL",
  199. 		"max range": 40 },
  200. 	    {
  201. 		"name": "20",
  202. 		"light segments": [
  203. 		    {
  204. 			"GM": false,
  205. 			"arcAngle": 360,
  206. 			"facingOffset": 0,
  207. 			"ownerOnly": false,
  208. 			"paint": null,
  209. 			"radius": 20,
  210. 			"shape": null } ],
  211. 		"type": "NORMAL",
  212. 		"max range": 20 },
  213. 	    {
  214. 		"name": "60",
  215. 		"light segments": [
  216. 		    {
  217. 			"GM": false,
  218. 			"arcAngle": 360,
  219. 			"facingOffset": 0,
  220. 			"ownerOnly": false,
  221. 			"paint": null,
  222. 			"radius": 60,
  223. 			"shape": null } ],
  224. 		"type": "NORMAL",
  225. 		"max range": 60 },
  226. 	    {
  227. 		"name": "15",
  228. 		"light segments": [
  229. 		    {
  230. 			"GM": false,
  231. 			"arcAngle": 360,
  232. 			"facingOffset": 0,
  233. 			"ownerOnly": false,
  234. 			"paint": null,
  235. 			"radius": 15,
  236. 			"shape": null } ],
  237. 		"type": "NORMAL",
  238. 		"max range": 15 },
  239. 	    {
  240. 		"name": "30",
  241. 		"light segments": [
  242. 		    {
  243. 			"GM": false,
  244. 			"arcAngle": 360,
  245. 			"facingOffset": 0,
  246. 			"ownerOnly": false,
  247. 			"paint": null,
  248. 			"radius": 30,
  249. 			"shape": null } ],
  250. 		"type": "NORMAL",
  251. 		"max range": 30 } ] },
  252.     "bars": {
  253. 	"no group": [
  254. 	    {
  255. 		"increment": 0,
  256. 		"side": "TOP",
  257. 		"name": "Health" } ] },
  258.     "states": {
  259. 	"no group": [
  260. 	    "Incapacitated",
  261. 	    "Disabled",
  262. 	    "Other2",
  263. 	    "Other",
  264. 	    "Other3",
  265. 	    "Prone",
  266. 	    "Hidden",
  267. 	    "Dead",
  268. 	    "Other4" ] },
  269.     "remote repository": [],
  270.     "zones": {
  271. 	"Grasslands": "C0A8001E7E7F199B0C0000008008001E" }
  272. }

Version Changes

  • 1.3b70 - Added campaign option for topic
  • 1.3b76 - Added values 'timeInMS' and 'timeDate' to both client and server return values