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

Token-Mod: setting max limits for multiple token

Hi, I need to use token-Mod rather than chatSetAttr to "modb" a bar2 value for 5 character tokens, and I'd like to do it without targeting or selecting them. But I'm not sure how to get it done. I can add the +10 to the value for all 5 no problem. But I don't know the syntax for stopping the value exceeding the max without selecting or targeting them. Or if it's even possible. I've been using "--ids @{Dude|character_id}" for setting one token that always-updates and instructing token-mod to: --set bar2_value|[[{0d20+10+@{Dude|bar2|current},@{Dude|bar2|current|max}}KL1]] But I'd like to be able to do that to 5 character tokens at once - without having to select or target them every time. Is there a way? Cheers, Byron
1593122279
The Aaron
Roll20 Production Team
API Scripter
No, but I think I could add something to limit to between max and zero pretty easily. As often as it comes up, there really should be something. I'll look into it. 
Okay, thanks Aaron. Usually, I'd use chatSetAttr for something like that but I'm already using that in the same script. I'll throw a button into the output I'm generating instead and run the +10 as a separate step. Thanks for getting back so quickly. Love a resolution that lets you move on. 
1593140560
The Aaron
Roll20 Production Team
API Scripter
Done:&nbsp; <a href="https://app.roll20.net/forum/permalink/8874262/" rel="nofollow">https://app.roll20.net/forum/permalink/8874262/</a> You can grab the current version from:&nbsp; <a href="https://github.com/shdwjk/Roll20API/blob/master/TokenMod/TokenMod.js" rel="nofollow">https://github.com/shdwjk/Roll20API/blob/master/TokenMod/TokenMod.js</a> Or it should be in the 1-click next week.
No! Stop it. That's fantastic, Aaron. Brilliant. I'll put it use immediately.