init.round: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
m (Conversion script moved page Init.round to init.round: Converting page titles to lowercase)
No edit summary
Line 3: Line 3:
==Example==
==Example==
'''Simple Count'''
'''Simple Count'''
<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
[if(init.current != -1), code: {
[if(init.current != -1), code: {
[h: json = getInitiativeList()]
[h: json = getInitiativeList()]
Line 13: Line 13:
No token with initiative.
No token with initiative.
}]
}]
</source>
</syntaxhighlight>


==Related Pages==
==Related Pages==

Revision as of 16:24, 15 March 2023

The special variable init.round holds the current Initiative round beginning at 1. init.round is set to -1 if there are no tokens in the Initiative window.

Example

Simple Count

[if(init.current != -1), code: {
	[h: json = getInitiativeList()]
	[h: tarray = json.get(json,"tokens")]
	[h: tok = json.get(tarray,init.current)]
	Token with Initiative: [r: getName(json.get(tok,"tokenId"))]<br>
	Initiative Round: [r: init.round]
};{
	No token with initiative.
}]

Related Pages

Initiative Functions