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 to get info from sheet and apply a status

I created some small numbered shield icons for AC so players don't constantly ask if they hit or not with an attack.  I am wondering if it is possible to create a macro that can get an npcs AC from their sheet and apply a status marker to the token to help speed up set up. If not possible with a macro would it be possible with an api script?
1705816350
The Aaron
Roll20 Production Team
API Scripter
It isn't possible with a macro, but would be possible with a Mod API Script.  
Macros are 'read-only' unless you have access to Mod scripts, which require a Roll20 Pro subscription. So a macro that does not include a Mod script command cannot apply a status marker. What character sheet are you using?  Assuming D&D 5E by Roll20, if the game creator has a Roll20 Pro subscription, you can use TokenMod to apply status markers to each token that use the 'npc_ac' value if that is part of the Status Marker name.  For example, if your status markers are named AC1, AC2, AC3, etc., then you can do something like this (untested) with a single token that is linked to a character sheet: !token-mod --set statusmarkers|AC@{selected|npc_ac} If you want to run this command on all tokens in the game, then you'll need to install the Metascript toolbox for SelectManager, Fetch, and ZeroFrame, and then use this command: !forselected(^) token-mod --set statusmarkers|AC@{selected|npc_ac}
That works. Glad i named those status markers that when i created them. Thanks for the help