herolab.getInfo

From RPTools Wiki
Jump to navigationJump to search

herolab.getInfo() Function

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

Introduced in version 1.5
Get basic information about the Hero Lab data associated with this token. Returns a JSON object containing various metadata about the character.

Usage

herolab.getInfo(id)
herolab.getInfo(id,field)

Parameters

  • id - The token id of the token to name, defaults to the Current Token.
  • field - A particular field from the metadata.

Example

Get the Hero Lab data associated with the current token.
[herolab.getInfo()]

Returns:

 1 {
 2 	"summary": "Young red dragon - CE Large dragon",
 3 	"masterIndex": null,
 4 	"isAlly": false,
 5 	"images": ["asset://8799bd3b26bc614cf0a0f33675f5e77d", "asset://80b3ea5b47f5f1c7aec06a28219cde47"],
 6 	"portfolioPath": "C:\\Users\\John\\Documents\\Pathfinder\\Giantslayer\\Episode 5 tokens\\",
 7 	"playerName": "Joe",
 8 	"isMinion": false,
 9 	"portfolioFile": "C:\\Users\\John\\Documents\\Pathfinder\\Giantslayer\\Episode 5 tokens\\Part 3 GS 5.por",
10 	"gameSystem": "Pathfinder Roleplaying Game",
11 	"heroLabIndex": "11",
12 	"isDirty": true,
13 	"name": "Young Red Dragon #3",
14 	"lastModified": "Fri Nov 02 16:28:33 CDT 2018",
15 	"masterName": ""
16 }

Get the status of the isMinion field from the Hero Lab data for the token named Orc 23.

[r: isMinion = herolab.getInfo("Orc 23","isMinion")]

Returns:

1

See Also

Version Changes

  • 1.5 - Added to main MapTool build.