herolab.getMasterName: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
m (Conversion script moved page Herolab.getMasterName to herolab.getMasterName: Converting page titles to lowercase)
No edit summary
Line 7: Line 7:


|usage=
|usage=
<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
herolab.getMasterName()
herolab.getMasterName()
herolab.getMasterName(id)
herolab.getMasterName(id)
</source>
</syntaxhighlight>


'''Parameters'''
'''Parameters'''
Line 17: Line 17:
|example=
|example=
Get the Hero Lab Master character name associated with the character represented by the current token.
Get the Hero Lab Master character name associated with the character represented by the current token.
<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
[h: myMaster = herolab.getMasterName()]
[h: myMaster = herolab.getMasterName()]
[r: out = "My master's name is: " + myMaster]
[r: out = "My master's name is: " + myMaster]
</source>
</syntaxhighlight>
Returns:
Returns:
<source lang="text" line>
<syntaxhighlight lang="text" line>
My master's name is: Fred
My master's name is: Fred
</source>
</syntaxhighlight>


|also=
|also=

Revision as of 16:11, 15 March 2023

herolab.getMasterName() 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.getMasterName()
herolab.getMasterName(id)

Parameters

  • id - The token id of the token to name, defaults to the Current Token.

Example

Get the Hero Lab Master character name associated with the character represented by the current token.
[h: myMaster = herolab.getMasterName()]
[r: out = "My master's name is: " + myMaster]

Returns:

My master's name is: Fred

See Also

Version Changes

  • 1.5 - Added to main MapTool build.