jay wrote:I've just added a bunch of macro functions and variable support. The following macro variables are available:The list of functions is below. Arguments that are in italics are optional. For token arguments to be optional the macro must be a token macro. The token argument is the GUID of the token. The following functions are available:
- token.init Get the initiative value of the first instance of a token in the initiative list and set the initiative value for all instances of a token in the initiative list.
- token.initHold Get the initiative hold value of the first instance of a token in the initiative list and set the initiative value for all instances of a token in the initiative list. The value is 0 to clear the hold flag and 1 to set it.
- init.roundGet and set the initiative round. Only the GM can set the initiative round.
- init.currentGet and set the current initiative index. Only the GM can get and set the current initiative index.
- getInitiative(token) Get the initiative value of the first instance of a token in the initiative list.
- setInitiative(token, value) Set the initiative value for all instances of a token in the initiative list.
- getInitiativeHold(token) Get the initiative hold value of the first instance of a token in the initiative list. The value is a 0 if false and 1 if true.
- setInitiative(token, value) Set the initiative hold value for all instances of a token in the initiative list. The value can be a number (0 == false, all others true) or a string (true == true, all others false ignoring case).
- addToInitiative(token, allow-duplicates, initiative) Add a token to the initiative list. If the allow-duplicates flag is false (default is false) then the macro will not add the token if it is already in the initiative list. If the initiative value argument is passed then the value of the initiative will be set for the token whether it was actually added or not. To set the initiative argument you must set the allow-duplicates argument.
- removeFromInitiative(token) Removes all instances of a token from the initiative list. This method can only be executed by the GM.
- addAllToInitaitive(allow-duplicates) Add all tokens to the initiative panel. If the allow-duplicates flag is false (default is false) then the macro will not add a token if it is already in the initiative list.
- addAllPCsToInitaitive(allow-duplicates) Add all PC tokens to the initiative panel. If the allow-duplicates flag is false (default is false) then the macro will not add a token if it is already in the initiative list.
- addAllNPCsToInitaitive(allow-duplicates) Add all NPC tokens to the initiative panel. If the allow-duplicates flag is false (default is false) then the macro will not add a token if it is already in the initiative list.
- nextInitiative() Move to the next item in the initiative list. This function can only be executed by the GM.
- sortInitiative() Sort the items in the initiative list by their initiative value. May only be executed by the GM.
- initiativeSize() Get the number of items in the initiative list.
- removeAllFromInitaitive() Remove all tokens from the initiative panel, reset the round counter and clear the current token.
- removeAllPCsFromInitaitive() Remove all PC tokens from the initiative panel, reset the round counter and clear the current token.
- removAllNPCsFromInitaitive() Remove all NPC tokens from the initiative panel, reset the round counter and clear the current token.
- getInitiativeRound() Get the initiative round.
- setInitiativeRound(value) Set the initiative round. Only the GM can call this function.
- getCurrentInitiative() Get the index of the item that currently has initiative. This function can only be called by the GM.
- setCurrentInitiative(value) Set the index of the item that currently has initiative. Only the GM can call this function.
I am unclear where I get the token GUID from for these functions.