currentToken: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
m (Text replacement - "<source" to "<syntaxhighlight")
 
(10 intermediate revisions by 6 users not shown)
Line 1: Line 1:
{{MacroFunction
{{MacroFunction
|name=currentToken
|name=currentToken
|trusted=true
|version=1.3b48
|description=Returns the id of the [[Token:Current Token|Current Token]]. In most cases this will return the same as [[Macros:Functions:getImpersonated | getImpersonated()]] function. The difference is when it is called in a [[Macros:Rolls:token | [token(): ] ]] or after a call to the  [[Macros:Functions:switchToken | switchToken()]] function, in both these cases it will return the id of the [[token]] being operated on, while [[Macros:Functions:getImpersonated | getImpersonated()]] will return the id of the [[impersonated token]].
|description=Returns the id of the [[Current Token]]. In most cases this will return the same as [[Macros:Functions:getImpersonated | getImpersonated()]] function. The difference is when it is called in a {{roll|token}} or after a call to the  [[Macros:Functions:switchToken | switchToken()]] function, in both these cases it will return the id of the [[token]] being operated on, while [[Macros:Functions:getImpersonated | getImpersonated()]] will return the id of the [[impersonated token]].


|usage=
|usage=
<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
[h: tokenId = currentToken()]
currentToken()
</source>
</syntaxhighlight>
'''Parameters''' 
 
None.
 
|examples=
Get the Token ID of the [[Current Token]].
<syntaxhighlight lang="mtmacro" line>
[r:id = currentToken()]
</syntaxhighlight>
 
|also=
[[getImpersonated|getImpersonated()]],
 
|changes=
{{change|1.3b51|No longer a trusted function.}}
 
}}
}}
[[Category:Token Function]]
[[Category:Token Function]]

Latest revision as of 21:00, 14 March 2023

currentToken() Function

Introduced in version 1.3b48
Returns the id of the Current Token. In most cases this will return the same as getImpersonated() function. The difference is when it is called in a [token():] or after a call to the switchToken() function, in both these cases it will return the id of the token being operated on, while getImpersonated() will return the id of the impersonated token.

Usage

currentToken()

Parameters

None.

Examples

Get the Token ID of the Current Token.
[r:id = currentToken()]

See Also

Version Changes

  • 1.3b51 - No longer a trusted function.