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

Returning uses left on limited use powers

Good afternoon all, I am trying to find/write a macro or API script that returns the remaining number of uses for a limited use ability. For example, a character has 3 uses of a power.  After each use, I would like it return the number of uses left.  I tried and failed with the script below.   ----------------------------------------------------------------------------------------------------- !roll20AM --play,|Rolling Smoke| /as "Blackguard on Nightmare" **"Bathe in the darkness I bring"** /ooc each ally of the Blackguard on Nightmare has conceal 6 until end of round @{selected|character_name} has [[@{selected|Champion Power}-1]] Champion Power uses left. -------------------------------------------------------------------------------------------------------------- It always returns the value of 2 (the blackguard has 3 uses of this power) I would like it to return a value of 1 after the second use and 0 after the third. Any help appreciated! -GTH
I also tried putting the number of uses on the bar: @{selected|character_name} has [[@{selected|bar1}-1]] Champion Power uses left.
1517008295
Pat S.
Forum Champion
Sheet Author
Macros can not affect attributes, that takes the API. Check out the Ammo script and see if that will work for you. You might have to tweak it a bit.
So to write  to attributes requires the API. For this I would recommend ChatSetAttr by Jakob. Then when you need to use the power you would add this to your macro !setattr --sel --mod --Champion Power|-1
OMG Yes!!! this, 1000X this.  Thank you.  that was quick and easy.   I really appreciate the quick responses. -GTH