currentToken: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
==Function currentToken==
{{MacroFunction
{{TrustedOnlyFunction}}
|name=currentToken
|trusted=true
|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]].


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]].
|usage=
===Usage===
<source lang="mtmacro" line>
<source lang="mtmacro" line>
[h: tokenId = currentToken()]
[h: tokenId = currentToken()]
</source>
</source>
}}
[[Category:Token Function]]

Revision as of 01:25, 7 March 2009

currentToken() Function

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

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

[h: tokenId = currentToken()]