herolab.refresh: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
(One intermediate revision by the same user not shown) | |||
Line 9: | Line 9: | ||
<syntaxhighlight lang="mtmacro" line> | <syntaxhighlight lang="mtmacro" line> | ||
herolab.refresh() | herolab.refresh() | ||
herolab.refresh( | herolab.refresh(tokenRef) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
This function will also refresh the token's images (just like when the token is created). The token's base Image from the first image in Hero Lab, the token's Portrait from the second image in Hero Lab, and the tokens' Handout image from the 3rd image in Hero Lab. | This function will also refresh the token's images (just like when the token is created). The token's base Image from the first image in Hero Lab, the token's Portrait from the second image in Hero Lab, and the tokens' Handout image from the 3rd image in Hero Lab. | ||
'''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.}} | |||
It will return a 1 if successful, otherwise it will return a 0. | It will return a 1 if successful, otherwise it will return a 0. |
Latest revision as of 23:59, 17 May 2024
herolab.refresh() Function
Note: This function can only be used in a Trusted Macro
• Introduced in version 1.5
Refresh the Hero Lab data associated with this token. This will update the statblock and stored images.
Usage
herolab.refresh()
herolab.refresh(tokenRef)
This function will also refresh the token's images (just like when the token is created). The token's base Image from the first image in Hero Lab, the token's Portrait from the second image in Hero Lab, and the tokens' Handout image from the 3rd image in Hero Lab.
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.
It will return a 1 if successful, otherwise it will return a 0.
Example
Get the boolean value of the refresh flag in the Hero Lab data.
[r: success = herolab.refresh()]
Returns:
0 or 1
See Also
Version Changes
- 1.5 - Added to main MapTool build.