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

[Script] Super Simple Status Script

A very simple and easy to use status icon script that can be used with macro's like the following: !icon sentry-gun !icon archery-target @{target||token_id} !icon drink-me @{selected|token_id} The first macro will toggle the sentry-gun icon on all selected tokens. The second macro will toggle the archery-target icon on just the targeted token. The final macro will toggle the drink-me icon on only the first selected token, even if you select more than one token. This macro pops up a query with a list of all the status icons and toggles that icon on all the selected tokens. !icon ?{Status Icon|red|blue|green|brown|purple|pink|yellow|dead|skull|sleepy|half-heart|half-haze|interdiction|snail|lightning-helix|spanner|chained-heart|chemical-bolt|death-zone|drink-me|edge-crack|ninja-mask|stopwatch|fishing-net|overdrive|strong|fist|padlock|three-leaves|fluffy-wing|pummeled|tread|arrowed|aura|back-pain|black-flag|bleeding-eye|bolt-shield|broken-heart|cobweb|broken-shield|flying-flag|radioactive|trophy|broken-skull|frozen-orb|rolling-bomb|white-tower|grab|screaming|grenade|sentry-gun|all-for-one|angel-outfit|archery-target} // API COMMAND HANDLER on("chat:message", function(msg) {     if (msg.type !== "api") return;     if (msg.content.split(" ")[0] === "!icon") {         var Icon = msg.content.split(" ")[1];         var TokenID = msg.content.split(" ")[2];         var Token;         if (TokenID !== undefined) {             Token = getObj("graphic", TokenID);             if (Token.get("status_" + Icon) === false) Token.set("status_" + Icon, true);             else Token.set("status_" + Icon, false);         } else if (msg.selected !== undefined) {             _.each(msg.selected, function(a) {                 Token = getObj("graphic", a["_id"]);                 if (Token.get("status_" + Icon) === false) Token.set("status_" + Icon, true);                 else Token.set("status_" + Icon, false);             });         } else {             log ("No tokens selected or targeted.");         }     } });
1464237406
vÍnce
Pro
Sheet Author
This seems very useful.   Thanks HB(I mean SC13) ;-P
1464237691
vÍnce
Pro
Sheet Author
I like how selecting the same status again, removes the status.  Thanks again.
1464243953
Lithl
Pro
Sheet Author
API Scripter
Have you considered including some means to set the number of a statusmarker (set to an integer value 1-9 instead of boolean true)? How about manipulating the statusmarkers string directly (rather than the status_X shim properties) in order to accommodate setting duplicates of a marker on a token?
That would go beyond the scope of super simple... so no. Bad feature creep! The reason I wrote this, is because of my face to face D&D game. I was wasting too much time trying to find the status icon I wanted to use to track things like readied actions and hunter's mark. This was made doubly annoying because of the quality of the chromebook screen I'm using. So... super simple script. Speeds things up for me to where using the status icons to track some stuff is negligible.
1464254970
Ziechael
Forum Champion
Sheet Author
API Scripter
Super simple is my middle name... well, it was my nick name at school... well, i say school, it was more what my parents used to call me while pointing and laughing... but i digress. I'll be using this little beauty for all of those area of affect de-buff spells my players are so damn keen on using. Since I can never remember the look of the icon by it's actual name i'll likely enhance the query with my own interpretations/use cases: !icon ?{Status Icon|...|Slow,snail...|Entangled,cobweb|...|Inspire Courage,flying-flag|... etc etc}
1464255151

Edited 1464255191
Sounds awesome. Since I'm using this face to face, I just make campaign macros for the different effects and name them what I need to... like Hunter's Mark. :D !icon archery-target @{target|token_id}
1464264119
The Aaron
Pro
API Scripter
Brian said: Have you considered including some means to set the number of a statusmarker (set to an integer value 1-9 instead of boolean true)? How about manipulating the statusmarkers string directly (rather than the status_X shim properties) in order to accommodate setting duplicates of a marker on a token? You can do all of those things in the less simple TokenMod. :)
Yup! TokenMod has way more power than I needed for a face to face game. Hence this script. It's also easier to use (imo) and would be good for someone just getting in to using api scripts.
1464270083
The Aaron
Pro
API Scripter
Totally agree.  =D  There's definitely a place for small fit-to-purpose scripts. =D
1464270693
Natha
KS Backer
Sheet Author
API Scripter
Thanks. Exactly what I was looking for.
Natha said: Thanks. Exactly what I was looking for. Awesome! :)