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

How to prevent using a Resource if 0 available?

Is there any way to use token-mod or chatsetattr to check the resource value and stop the script or macro if the resource is 0?  This could be a class ability (class_resource or other_resource) or even any of the repeating resources for ammo, potions, etc?  I see there is a way to prevent healing beyond hp_max so wondering if there is something similar to setting a hard floor of 0 for resources.
To achieve this, I've gone to using the ScriptCards API, that lets you test for a zero value and then conditionally skip.  For example, if a barbarian is out of rages.
Thanks!  Will check it out.  I have it because of the Conjure Animals script that David posted, but haven't messed too much with ScriptCards yet.
1623635889
timmaugh
Pro
API Scripter
Or APILogic can do it right inline with the TM or CSA call.