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 .
×
May your rolls be chill this holiday season!
Create a free account

Macro assist for Shadowrun 5th Edition

I have found the macro for reducing a tokens initiative on the tracker by 10, however, I would ideally like a macro that reduced all tokens initiative on the tracker by 10.  Anyone able to help? /me @{selected|token_name} ends their turn. [[10 &{tracker:-}]]  
1606544076

Edited 1606544435
Oosh
Sheet Author
API Scripter
Assuming this is your Pro game, so you can use the API: const init10 = (() => { on('ready', () => { on('chat:message', (msg) => { if (msg.type !== 'api' || msg.content.search(/^!init10/i) === -1) return; let tracker = JSON.parse(Campaign().get('turnorder')); tracker.forEach(obj => { obj.pr = Math.max(obj.pr - 10, 0); }) Campaign().set('turnorder', JSON.stringify(tracker)); }) }) return })(); Just type !init10 into chat. I've assumed you don't want negative values, if you do just change the line in the middle to obj.pr = obj.pr - 10 Could also be tweaked to ignore custom markers if you use a round counter or anything else you don't want decremented: const init10 = (() => { on('ready', () => { on('chat:message', (msg) => { if (msg.type !== 'api' || msg.content.search(/^!init10/i) === -1) return; let tracker = JSON.parse(Campaign().get('turnorder')); tracker.forEach(obj => { if (obj.id != -1) { obj.pr = Math.max(obj.pr - 10, 0); } }) Campaign().set('turnorder', JSON.stringify(tracker)); }) }) return })();
Thanks Oosh :)