GM said:
I wrote a script that looks for all tokens with the same name, and adds a status marker to all of those tokens. Format is !setStatus —<tokenname> —status.
For the standard set it works fine, but it will not work for the many custom status markers I use.
How does one set a custom status via the api?
They work off ids I think?
Custom markers get a number appended to them, and need to be referenced that way. For example, I have custom markers in my test game. Here is the info for one of them:
"id":50296
"name":"grim-reaper38285"
"tag":"grim-reaper38285::50296"
"url":"URL HERE
The list of markers can be retrieved from the campaign object and is called token_markers. Here is a quick and dirty ScriptCard to list them all along with their image:
!script {{
--~|array;fromstring;markers;},{;[*C:token_markers]
--%loop|foreach;markers
--/+Loop|[&loop]
--~|array;fromstring;thismarker;,;[&loop]
--&CleanURL|[@thismarker(3)]
--&CleanURL|[&CleanURL(replace,"url":",)]
--&CleanURL|[&CleanURL(replaceall,",)]
--+Marker [@thismarker(0)]| [img width=20][&CleanURL][/img] [@thismarker(2)]
--%|
}}
Where you would use "skull", or "strong" for standard markers you would use the item in the tag field for custom ones (ex: radioactive38951::50310). Otherwise they work the same and can be included in the statusmarkers field on tokens like the normal ones.