getInitiativeHold: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(13 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{stub}}
{{MacroFunction
{{MacroFunction
|name=getInitiativeHold
|name=getInitiativeHold
|description=Returns if the [[Token:token{{!}}token]] is on [[Initiative:hold{{!}}hold]] in the [[Initiative:initiative panel{{!}}initiative panel]] or not. This function will return 1 if the [[Token:token{{!}}token]] is on [[Initiative:hold{{!}}hold]] or 0 if it is not.
|version=1.3b41
|description=Returns if the [[Token|token]] is on [[Introduction to Initiative#Hold|hold]] in the [[Introduction to Initiative{{!}}initiative panel]] or not. This function will return 1 if the [[Token:token{{!}}token]] is on [[Introduction to Initiative#Hold|hold]] or 0 if it is not.


|usage=
|usage=
<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
[h: onHold = getInitiativeHold()]
getInitiativeHold()
</source>
getInitiativeHold(tokenRef)
getInitiativeHold(tokenRef, mapRef)
</syntaxhighlight>
 
'''Parameter'''
{{param|tokenRef|Either the token [[getSelected|{{code|id}}]] or [[getTokenName|Token Name]] of the token to get the initiative hold value from. Defaults to the [[Current Token]]. {{TrustedParameter}} }}
{{param|mapRef|The Name or ID of the map to find the token.  Defaults to the current map.}}
{{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.}}


|examples=
|examples=
<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
[r: if(getInitiativeHold(), "You are on hold", "You are not on hold")]
[r: if(getInitiativeHold(), "You are on hold", "You are not on hold")]
</source>
</syntaxhighlight>
}}
}}
[[Category:Initiative Function]]
[[Category:Initiative Function]]
[[Category:Token Function]]

Latest revision as of 23:59, 13 May 2024

 This article is a stub, you can help the RPTools Wiki project by contributing content to expand this article.

getInitiativeHold() Function

Introduced in version 1.3b41
Returns if the token is on hold in the initiative panel or not. This function will return 1 if the token is on hold or 0 if it is not.

Usage

getInitiativeHold()
getInitiativeHold(tokenRef)
getInitiativeHold(tokenRef, mapRef)

Parameter

  • tokenRef - Either the token id or Token Name of the token to get the initiative hold value from. Defaults to the Current Token.

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

  • mapRef - The Name or ID of the map to find the token. Defaults to the current map.
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.

Examples

[r: if(getInitiativeHold(), "You are on hold", "You are not on hold")]