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

API Newb Question about obj.get('status_"name"marker')

How do I use the obj.get command for a status marker that has a dash '-' in the name. For example, I'm trying to use the command: obj.get('status_death-zonemarker') When I code it with the dash, I get an compile error. What am I missing? Thanks in advance.
1592775208
The Aaron
Roll20 Production Team
API Scripter
You need to use the tag name, not the display name.  The tag name has the ::##### on the end, like "diamond::10296": obj.get('status_death-zonemarker::12345')  You can get the tag names out of the Campaign() object in the "token_markers" property, or using libTokenMarkers (in the one click), or by looking at TokenMod.  I suggest libTokenMarkers simply because then you don't need to actually hard code the number, but if the script is only for you and you don't plan on changing sets, then hard coding works.
Thanks!