init.current

From RPTools Wiki
Revision as of 21:38, 13 December 2019 by Phergus (talk | contribs) (Created page with "The special variable ''init.current'' holds the index of the token in the Initiative window that currently has initiative. Is set to {{code|-1}} if there are no tokens in the...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

The special variable init.current holds the index of the token in the Initiative window that currently has initiative. 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"))]
};{
	No token with initiative.
}]

Related Pages