getState: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
m (Added MacroFunction template and Token Function category)
m (Added version, cleaned up formatting.)
Line 1: Line 1:
{{stub}}
{{MacroFunction
{{MacroFunction
|name=getState
|name=getState
|version=1.3b40
|description=
|description=
Returns 1 if the specified [[Token:state|Token State]] is set on the [[Token:Current Token|Current Token]] otherwise it returns 0.
Returns 1 if the specified [[Token:state|Token State]] is set on the [[Token:Current Token|Current Token]] otherwise it returns 0.
Line 6: Line 8:
|usage=
|usage=
<source lang="mtmacro" line>
<source lang="mtmacro" line>
[h: isSet = getState(name)]
getState(state)
</source>
</source>
'''Parameter'''
* {{code|state}}} - The name of the state to check for on the current token.


|examples=
|example=
<source lang="mtmacro" line>
<source lang="mtmacro" line>
[if(getState("Dead"), "You are dead!", "You are not dead (yet!)")]
[if(getState("Dead"), "You are dead!", "You are not dead (yet!)")]
</source>
</source>
}}
}}
[[Category:Token Function]]
[[Category:Token Function]]

Revision as of 09:48, 10 March 2009

 This article is a stub, you can help the RPTools Wiki project by contributing content to expand this article.

getState() Function

Introduced in version 1.3b40
Returns 1 if the specified Token State is set on the Current Token otherwise it returns 0.

Usage

getState(state)

Parameter

  • state} - The name of the state to check for on the current token.

Example

[if(getState("Dead"), "You are dead!", "You are not dead (yet!)")]