herolab.isMinion: Difference between revisions
Jump to navigation
Jump to search
m (Conversion script moved page herolab.isMinion to Herolab.isMinion without leaving a redirect: Converting page title to first-letter uppercase) |
No edit summary |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 7: | Line 7: | ||
|usage= | |usage= | ||
< | <syntaxhighlight lang="mtmacro" line> | ||
herolab.isMinion() | herolab.isMinion() | ||
herolab.isMinion( | herolab.isMinion(tokenRef) | ||
</ | </syntaxhighlight> | ||
'''Parameters''' | '''Parameters''' | ||
{{param|id| | {{param|tokenRef|Either the token [[getSelected|{{code|id}}]] or [[getTokenName|Token Name]] of the token. Defaults to the Current Token.}} | ||
{{Note|Token IDs are unique, but Token Names can be duplicated. Using Token Name when more than one token has the same name can produce unexpected results.}} | |||
|example= | |example= | ||
Get the boolean value of the isMinion flag in the Hero Lab data. | Get the boolean value of the isMinion flag in the Hero Lab data. | ||
< | <syntaxhighlight lang="mtmacro" line> | ||
[r: isMinion = herolab.isMinion()] | [r: isMinion = herolab.isMinion()] | ||
</ | </syntaxhighlight> | ||
Returns: | Returns: | ||
< | <syntaxhighlight lang="mtmacro" line> | ||
0 or 1 | 0 or 1 | ||
</ | </syntaxhighlight> | ||
This is the same as using the {{func|getInfo}} function and reading the {{code|isMinion}} field. | This is the same as using the {{func|getInfo}} function and reading the {{code|isMinion}} field. | ||
< | <syntaxhighlight lang="mtmacro" line> | ||
[h: info = herolab.getInfo()] | [h: info = herolab.getInfo()] | ||
[r: isMinion = json.get(info,"isMinion")] | [r: isMinion = json.get(info,"isMinion")] | ||
</ | </syntaxhighlight> | ||
Returns: | Returns: | ||
< | <syntaxhighlight lang="mtmacro" line> | ||
0 or 1 | 0 or 1 | ||
</ | </syntaxhighlight> | ||
|also= | |also= | ||
[[Hero Lab Integration|Hero Lab Integration]] | [[Hero Lab Integration|Hero Lab Integration]] |
Latest revision as of 23:59, 17 May 2024
herolab.isMinion() Function
Note: This function can only be used in a Trusted Macro
• Introduced in version 1.5
Returns true if token is a Hero Lab minion character, such as an Eidolon or Familiar. Otherwise it returns false.
Usage
herolab.isMinion()
herolab.isMinion(tokenRef)
Parameters
tokenRef
- Either the tokenid
or Token Name of the token. Defaults to the Current Token.
Token IDs are unique, but Token Names can be duplicated. Using Token Name when more than one token has the same name can produce unexpected results.
Example
Get the boolean value of the isMinion flag in the Hero Lab data.
[r: isMinion = herolab.isMinion()]
Returns:
0 or 1
This is the same as using the getInfo() function and reading the isMinion
field.
[h: info = herolab.getInfo()]
[r: isMinion = json.get(info,"isMinion")]
Returns:
0 or 1
See Also
Version Changes
- 1.5 - Added to main MapTool build.