Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

[Script Request] Select all Tokens in Turn Order tracker

I was thinking of some ideas for my roll20 game, and one thing I wish I could do is automatically select all of the units in the Turn Order tracker. Anyone have a script to do this? It could be useful for moving all of the tokens to another section of the map, moving them to an entirely different map, cleaning up a battlemap where you don't plan to reuse the tokens, or re-rolling initiative every turn for those of us w/ custom Initiative scripts.
1429296387
The Aaron
Pro
API Scripter
The API does not have access to affect the selection of users. However, most of your use cases could be handled with the API without that functionality. The Turn Order is a discrete set of tokens that is accessible to the API. So: Moving all of the tokens to another section of the map: This is completely doable, not limitations. The basic pseudocode is For each Turn Order Token, adjust the Left and Top to position them in a new location. Moving all of the tokens to another map: There are a few limitations here. 1) A token's pageid is read only, so a token can't be moved to a new page, a copy would need to be created. 2) The API (currently) cannot create images that do not reside in a user's Library, i.e. it cannot create images from the Market Place. (This is a much requested feature though, so it might show up soon). You would need to adjust the Turn Order to point to the newly created token. Clearing up the battlemap: Since the Update of Holding introduced .remove(), this is now possible Re-rolling Initiative: This can definitely be done by the API.