findToken

From RPTools Wiki
Revision as of 02:46, 10 July 2019 by Phergus (talk | contribs) (Function also accepts token ID as parameter.)
Jump to navigation Jump to search

findToken() Function

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

Introduced in version 1.3b48
Finds a token on the current map by the token name, GM name, or ID and returns its id. If the token is not found then an empty string "" is returned.

Usage

findToken(name/ID)

Parameters

  • name/ID - Either the name of the token or the ID.

Example

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