init.current: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 8: | Line 8: | ||
[h: tarray = json.get(json,"tokens")] | [h: tarray = json.get(json,"tokens")] | ||
[h: tok = json.get(tarray,init.current)] | [h: tok = json.get(tarray,init.current)] | ||
Token with Initiative: [r: getName(json.get(tok,"tokenId"))] | Token with Initiative: [r: getName(json.get(tok,"tokenId"))]<br> | ||
Initiative Round: [r: init.round] | |||
};{ | };{ | ||
No token with initiative. | No token with initiative. |
Revision as of 21:47, 13 December 2019
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"))]<br>
Initiative Round: [r: init.round]
};{
No token with initiative.
}]