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 .
×

reading value of turnorder event.

Hello writing a script that uses icons to track reactions and I have a question about the turnorder. Per the Wiki: change:campaign:initiativepage Fired whenever the turn order is hidden or shown for a page. This may not be the same as the ID of the currently active page. If this is set to false (including if an API script sets it to false), it will close the turn order for all GMs/players. Setting it to a valid page ID will open it for all GMs/players. I do not however understand how to check if this is false. I'd like to check this because I'd like to clear the reaction icons from tokens when the turn order tracker is closed.
1576693983
The Aaron
Roll20 Production Team
API Scripter
Here's an example script that shows how: on('ready',()=>{ on('change:campaign:initiativepage',(obj)=>{ if(false === obj.get('initiativepage')){ sendChat('Initiative Page Change', '/w gm TurnOrder is now Hidden.'); } else { let page = getObj('page',obj.get('initiativepage')); if(page){ sendChat('Initiative Page Change', `/w gm TurnOrder is now show for page: ${page.get('name')}.`); } else { sendChat('Initiative Page Change', `/w gm TurnOrder is now show (page id invalid).`); } } }); });