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

Macro which handles selected/no selected token differently?

Is there a way of making a macro behave one way if a token is selected, and a different way if not? For example, an attack macro that displays the selected token's defense score for comparison, but only if there's a selected token . If not, it just skips that step.
1585469249
GiGs
Pro
Sheet Author
API Scripter
No, unfortunately. This is because of the roll20's order of operations. It attempts to read the value of all attribute calls (including anything using the selected| construction), and when it cant find a value, it reports an error. Since you're a Pro user, You could handle this in an API script, but you'd need to write script or have one written for you. And scripts arent very flexible, usually. They serve a specific purpose.