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 .
×

Token Mod Status Marker Query

Hi, Does anyone know if it's possible to have a token mod command to replace a marker with another. For example i have marker numbers 1, 2 and 3 and can use a macro to easily remove marker 1 and replace it with marker 2 etc What I'm looking for is a single token mod command to say if token marker 1, 2 or 3 aren't present add marker 1, if marker 1 is present then remove it and add marker 2 and if marker 2 is present remove it and add marker 3. If this can be done without affecting any other markers that may be on the token that would be amazing
1782085173

Edited 1782164127
timmaugh
Pro
API Scripter
Yes, that is possible with TokenMod and the Metascript Toolbox. I'll build it around the selected token, but this could obviously be built to target a token in a number of different ways. I'll also build it around the markers blue, red, and green !token-mod --set statusmarkers|{&if @(selected.is.blue) = yes}-blue|+red|-green{&elseif @(selected.is.red) = yes}-blue|-red|+green{&else}+blue|-red|-green{&end} Note that this will also work to *start* the process, since the last "else" case is a catch all for "any other condition". So if the token has none of the markers, it should get the blue marker applied to it the first time you run the command. After that, it will continue to cycle. Also notice that while all you *really* need is the "+NewMarker|-OldMarker" verbiage, I included a "-UninvolvedMarker" in each case just in case you ever got out of sync and somehow had 2 (or 3) of the markers applied to the same token simultaneously. Give it a try and post back if you can't get it to work.
1782095363
Andrew R.
Pro
Sheet Author
This is why you should always have MetaScriptToolbox installed in all your games, like me! ;)
Timmaugh, Thanks so much for looking at this. Tried this out. 1st use adds blue marker, 2nd use changes to red marker, 3rd use changes back to blue rather than geen. Feels like this is really close
1782164060

Edited 1782164155
timmaugh
Pro
API Scripter
My apologies. I air-coded that last night, and I missed closing the miodle "elseif" syntax. I'll fix it above (if anyone should find this thread, later), but also include the updated/fixed command, here: !token-mod --set statusmarkers|{&if @(selected.is.blue) = yes}-blue|+red|-green{&elseif @(selected.is.red) = yes}-blue|-red|+green{&else}+blue|-red|-green{&end}
Timmaugh. All good now. Thanks for solution