getInitiativeList question

Discuss macro implementations, ask for macro help (to share your creations, see User Creations, probably either Campaign Frameworks or Drop-in Resources).

Moderators: dorpond, trevor, Azhrei, giliath, jay, Mr.Ice

Post Reply
xavram
Dragon
Posts: 891
Joined: Tue Apr 20, 2010 8:22 pm

getInitiativeList question

Post by xavram »

The list of tokens that comes back in this call, is it in the order of he initiative? Or can that not be trusted?

User avatar
aliasmask
RPTools Team
Posts: 9031
Joined: Tue Nov 10, 2009 6:11 pm
Location: California

Re: getInitiativeList question

Post by aliasmask »

It's a json object that has an array called tokens which holds an object with the token info in the order or the initiative panel.

For example:

Code: Select all

{
    "round": -1,
    "map": "Catacombs",
    "current": -1,
    "tokens":     [
                {
            "holding": false,
            "initiative": "20.05",
            "tokenId": "00000000942370A89223000000000000"
        },
                {
            "holding": false,
            "initiative": "15.01",
            "tokenId": "00000000812370A8EE22000000000000"
        }
    ]
}
Fyi, I use this bit of code to show me the json structure:

Code: Select all

[dialog("D"):{<pre>[R: json.indent(replace(getInitiativeList(),"<","<"))]</pre>}]

Post Reply

Return to “Macros”