herolab.refresh: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
m (Conversion script moved page herolab.refresh to Herolab.refresh without leaving a redirect: Converting page title to first-letter uppercase)
No edit summary
 
(One intermediate revision by one other user not shown)
Line 7: Line 7:


|usage=
|usage=
<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
herolab.refresh()
herolab.refresh()
herolab.refresh(id)
herolab.refresh(id)
</source>
</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.


Line 20: Line 20:
|example=
|example=
Get the boolean value of the refresh flag in the Hero Lab data.
Get the boolean value of the refresh flag in the Hero Lab data.
<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
[r: success = herolab.refresh()]
[r: success = herolab.refresh()]
</source>
</syntaxhighlight>
Returns:
Returns:
<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
0 or 1
0 or 1
</source>
</syntaxhighlight>


|also=
|also=

Latest revision as of 16:14, 15 March 2023

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(id)

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

  • id - The id of the token. Defaults to the Current Token.

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.