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

Aura/Tint HealthColor - Remove All Auras

Hi everyone, This is a great script, however for various reasons I need to disable / remove it. As far as I can tell however... there is no easy way to remove the auras it has set (which appears to have been done to 1135 tokens across many maps - in only 48ms which is quite impressive). Whether I switch it off from the "Is On" setting or try and remove it by disabling the script all of the auras remain on all of the tokens. I can hack the problem by making the aura transparent, but it is still actually there on all the tokens. Is there any easy way to remove the aura settings on all tokens? Thanks in advance.
1616165264
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Token mod can do this for you. Select all tokens on a page and type: !token-mod --set aura1_radius| aura2_radius|
Thanks Keith, that is very helpful. It is certainly much easier than having to do them all individually! That said... I have many pages in this particular campaign (I haven't counted but it's likely 30 or so), do you happen to know if there is any easy way (i.e. that I can do within a macro) to loop across all the tokens in the campaign?
1616174596
The Aaron
Roll20 Production Team
API Scripter
That would take a script... ...here ya go! !clear-all-auras code: on('ready',()=>{ on('chat:message',msg=>{ if('api'===msg.type && /^!clear-all-auras(\b\s|$)/i.test(msg.content) && playerIsGM(msg.playerid)){ let who = (getObj('player',msg.playerid)||{get:()=>'API'}).get('_displayname'); let tokens = findObjs({ type:'graphic' }).filter(g=>g.get('represents')!==''); sendChat('Clear All Auras',`/w "${who}" <div>Clearing auras on <code>${tokens.length}</code> tokens.</div>`); let count = 0; const burndown = ()=>{ let t = tokens.shift(); if(t){ ++count; t.set({ aura1_radius: '', aura2_radius: '' }); if(count % 100 === 0){ sendChat('Clear All Auras',`/w "${who}" <div>...<code>${tokens.length}</code> tokens.</div>`); } setTimeout(burndown,0); } else { sendChat('Clear All Auras',`/w "${who}" <div>All auras reset!</div>`); } }; burndown(); } }); });
Wow! Awesome, thanks The Aaron!
Worked a treat! Thanks again.
1616180812
The Aaron
Roll20 Production Team
API Scripter
Sweet!  No problem. =D
1616180836
The Aaron
Roll20 Production Team
API Scripter
Just curious, how many tokens did it clear?
Assuming the correct number to take was the first one, it indicated 3340 tokens. Other related messages from other scripts might be "Fixing Tokens" that "fixed" 1139 tokens, while the original HealthColors message was 1135 tokens.  ... if I had to guess I'd suggest those two are working on "character sheet" linked tokens while you checked all tokens I have in the campaign whether they have an associated character sheet or not.
1616184775
The Aaron
Roll20 Production Team
API Scripter
I'm listing the total number of tokens that represent a character.  It's hard to guess what the others are doing.
Either way, you solved my problem... so, coolio!