findToken: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
mNo edit summary
m (Added version.)
Line 2: Line 2:
|name=findToken
|name=findToken
|trusted=true
|trusted=true
|version=1.3b48
|description=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.
|description=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.


|usage=
|usage=
<source lang="mtmacro" line>
<source lang="mtmacro" line>
[h: id = findToken(name)]
findToken(name)
</source>
</source>



Revision as of 13:05, 10 March 2009

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 or GM name and returns its id. If the token is not found then an empty string "" is returned.

Usage

findToken(name)

Example

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