findToken: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 3: Line 3:
{{TrustedOnlyFunction}}
{{TrustedOnlyFunction}}


Finds a [[token]] on the current map by the [[token]] name or GM name and returns its id. If the [[token]] is not found then an empty string "" is returned.
Finds a [[Token:token|token]] on the current [[Map:map|map]] by the [[Token:token|token]] name or GM name and returns its id. If the [[Token:token|token]] is not found then an empty string "" is returned.





Revision as of 14:06, 1 December 2008

Function findToken

 Note: This refers to a proposed change that has not been implemented in the main code base yet.

This function can only be called from a trusted macro

Finds a token on the current map by the token name or GM name and returns its id. If the token is not found then an empty string "" is returned.


Usage

[h: id = findToken(name)]

Examples

[h: id = findToken("Hero")]
[if (id == "", "Token not found!", "Token found")]