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

TokenMod Conditions Script

I am using the following script and it works great: !token-mod ?{Status|Concentrating, --set statusmarkers#!blue|Readying, --set statusmarkers#!stopwatch|-, |Blinded, --set statusmarkers#!bleeding-eye --flip light_hassight|Charmed, --set statusmarkers#!broken-heart|Deafened, --set statusmarkers#!edge-crack|Frightened, --set statusmarkers#!screaming|Grappled, --set statusmarkers#!grab|Invisibility, --set statusmarkers#!ninja-mask|Incapacitated, --set statusmarkers#!interdiction|Paralyzed, --set statusmarkers#!pummeled|Petrified, --set statusmarkers#!frozen-orb|Poisoned, --set statusmarkers#!chemical-bolt|Prone, --set statusmarkers#!back-pain|Restrained, --set statusmarkers#!fishing-net|Stunned, --set statusmarkers#!fist|Unconscious, --set statusmarkers#!sleepy|-, |Blessed, --set statusmarkers#!angel-outfit|Raging, --set statusmarkers#!overdrive|Marked, --set statusmarkers#!archery-target|-, |Dead, --set statusmarkers#=dead|-, |Clear Conditions, --set statusmarkers#-bleeding-eye#-broken-heart#-edge-crack#-screaming#-grab#-pummeled#-aura#-chemical-bolt#-back-pain#-fishing-net#-fist#-frozen-orb#-interdiction#-sleepy#-ninja-mask#-dead#-purple|Clear All, --set statusmarkers#-bleeding-eye#-broken-heart#-edge-crack#-screaming#-grab#-pummeled#-aura#-chemical-bolt#-back-pain#-fishing-net#-fist#-frozen-orb#-interdiction#-sleepy#-ninja-mask#-angel-outfit#-overdrive#-blue#-stopwatch#-archery-target#-dead#-purple} What I am looking for help with is to improve this scrip by making the Clear Condition option when you click it from the current drop down create a new drop down and give you alist of each and every condition that can be cleared so that a DM or PC can clear just one individual condition at a time. Instead of it clearing all conditions that are applied as it currently fuctions. Thanks for any help in advance.
Just an addition here I know I could probably create an seperate entry for each condition in the current drop down but I wanted to see if there was a way to click on Clear Conditions and then pop open a new drop down with just the conditions that can be cleared. Thanks
Hey Joel, You're doing a bit more work than necessary with this macro. You don't need to have the --set statusmarkers in front of every option. You can rewrite the macro to be something like this: !token-mod --set statusmarkers#?{Choose a Token Status |     Readying,stopwatch |     Blinded,bleeding-eye --flip light_hassight |     Charmed,broken-heart |     <etc.....>     Clear All,=blue#-blue } Give this a try.
I would suggest something like this: !token-mod --set  statusmarkers#?{Add or remove?|Add,+|Remove,-} ?{Status?| Concentrating,blue| Readying, stopwatch| ... } Then you are simply choosing to add or a remove a single status each time.  Or if you're happy with a simple toggle (if that status is currently on it'll turn off and vice-versa) then it's even easier: !token-mod --set  statusmarkers#! ?{Status?| Concentrating,blue| Readying, stopwatch| ... }
1669747557

Edited 1669747712
timmaugh
Forum Champion
API Scripter
EDIT : Editing to make clear that the need I'm addressing in this post is the idea that a roll query list could be dynamically sized to ONLY show the statuses applied to a token. If Joel wanted to have roll query options limited to JUST the statuses that were already on the token, then this post talks about why that won't work straight out of the Roll20 box, and how to go about the "shortest" workaround. Joel... what you're looking for isn't *easily* accessible because of the order of operations. When you send a message (for instance, the GM looking to clear a condition, clicks a button to dispatch a message), Roll20 parses certain elements in it before the Moderator (what we used to call the API) gets a hold of the message. Part of what Roll20 does is to present the player with any roll queries. That means that the roll queries execute before a mod script would even get the chance to modify the contents of the roll query (there is no roll20-built-in-method for doing something like, "get me the list of statusmarkers as a query"). What you're left having to do, when you are ready to remove a status, is run a "pre" message that builds a list/roll query for you, overwriting your previous version of the macro/ability. Typically scripters cap this process off by presenting a button to the user (since by the time the mod script has gotten the message the opportunity for roll queries has passed, a new message is required... which the user can initiate by hitting the button). Typically the workflow for this usage would be: select the token run the pre-command --build the current list for the selected token --chat button is output click the chat button, make a selection from the roll query You might be able to do this with a combo of InsertArg (for the pre-amp portion) and Fetch (for the list of statuses). But you can also handle this niche need with a small, tailored scriptlet (that would be bound by the above limitations of workflow).
1669755231
Andrew R.
Pro
Sheet Author
I do this in 13th Age with a row of buttons along the bottom of my screen, one button per condition, plus AFK. Each button is a very simple TokenMod command that just toggles the Token Marker on & off. 
After looking at what you guys posted for me and then taking a little time to tweak the script here is what I ended up with and it does everything I wanted it to do. It add individual conditions marks based on the selection and you can remove individual conditions or everything all at once. Thanks for all the help! !token-mod --set statusmarkers#?{Choose a Token Status |***Add Condition***,  |Readying,stopwatch  |Concentrating,blue |Blinded,bleeding-eye --flip light_hassight  |Charmed,broken-heart  |Deafened,edge-crack |Frightened,screaming |Grappled,grab |Invisibility,ninja-mask |Incapacitated,interdiction |Paralyzed,pummeled |Petrified, frozen-orb |Poisoned,chemical-bolt |Prone,back-pain |Restrained,fishing-net |Stunned,fist |Unconscious,sleepy |-,  |Blessed,angel-outfit |Raging,overdrive |Marked,archery-target |-,  |Dead,dead |-,  |***Remove Conditions***, --set statusmarkers#? |Remove Concentration,-blue# |Remove Blinded,-bleeding-eye# |Remove Charmed,-broken-heart# |Remove Deafened,-edge-crack# |Remove Frightened,-screaming# |Remove Grappled,-grab# |Remove Paralyzed,-pummeled# |Remove Poisoned,-chemical-bolt# |Remove Prone,-back-pain# |Remove Restrained,-fishing-net# |Remove Stunned,-fist# |Remove Incapacitated,-interdiction# |Remove Unconscious,-sleepy# |RemoveInvisibility,-ninja-mask# |Remove Dead,-dead |Remove Blessed,-angel-outfit# |Remove Raging,-overdrive# |Remove Marked,-archery-target# |Clear All, --set statusmarkers#-bleeding-eye#-broken-heart#-edge-crack#-screaming#-grab#-pummeled#-aura#-chemical-bolt#-back-pain#-fishing-net#-fist#-frozen-orb#-interdiction#-sleepy#-ninja-mask#-angel-outfit#-overdrive#-blue#-stopwatch#-archery-target#-dead}