herolab.hasChanged: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
(Created page with "{{MacroFunction |name=herolab.hasChanged |trusted=true |version=1.5 |description= Returns a boolean value of true if the portfolio file has been modified compared to the curre...")
 
No edit summary
 
(4 intermediate revisions by 2 users not shown)
Line 7: Line 7:


|usage=
|usage=
<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
herolab.hasChanged()
herolab.hasChanged()
herolab.hasChanged(id)
herolab.hasChanged(id)
</source>
</syntaxhighlight>
See {{func|herolab.refresh}} to update the token's portfolio information.
See {{func|herolab.refresh}} to update the token's portfolio information.


Line 18: Line 18:
|example=
|example=
Determine if the associated Hero Lab portfolio has changed.
Determine if the associated Hero Lab portfolio has changed.
<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
[r: herolab.hasChanged()]
[r: isDirty = herolab.hasChanged()]
</source>
</syntaxhighlight>
Returns:
Returns:
<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
0 or 1
0 or 1
</source>
</syntaxhighlight>


|also=
|also=
Line 33: Line 33:
}}
}}


[[:Category:Hero Lab Function]]
[[Category:Hero Lab Function]]

Latest revision as of 16:13, 15 March 2023

herolab.hasChanged() Function

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

Introduced in version 1.5
Returns a boolean value of true if the portfolio file has been modified compared to the current stored data on the token, otherwise returns false.

Usage

herolab.hasChanged()
herolab.hasChanged(id)

See herolab.refresh() to update the token's portfolio information.

Parameters

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

Example

Determine if the associated Hero Lab portfolio has changed.
[r: isDirty = herolab.hasChanged()]

Returns:

0 or 1

See Also

Version Changes

  • 1.5 - Added to main MapTool build.