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

Delete another GM Macro as the creator of the Game

It's all in the title, I've created a game with several GM and many players, but one of the GM, long time in the past, create a macro who is obsolete now. This GM dont' play anymore but this macro show as a button for token. How can i delete the macro or at least not showing for token anymore ?
1639335689

Edited 1639335740
vÍnce
Pro
Sheet Author
Hi Zaka, Are you sure the token ability macro isn't being ceeated by the character sheet?  Ie initiative Some sheets have ability macros built-in and cannot be removed short of changing the sheet's code.  Some API scripts (pro required, so probably not relevant in this case... )can also create ability macros as well.
Where is the macro located? If it’s a collection macro, you should be able to delete it from the collections tab. If it’s a token action on a character sheet you should be able to delete it there.  
1639365661
The Aaron
Roll20 Production Team
API Scripter
Macros are tied to accounts, and show up for use by other players, but not editing/deleting. The only way to get rid of them is an api script. 
1639368104
The Aaron
Roll20 Production Team
API Scripter
Here's a script for cleaning up macros.  Just run: !macro-cleanup and click the X next to the ones you want to get rid of. Script: on('ready',() => { // ❌ const s = { button: `font-size: .6em; border: 1px solid #999;background-color: #ccc; border-radius: 1em; padding: .1em .3em;min-width:1.5em;text-align:center;`, tokenAction: `background: green; font-weight: bold; border: 1px solid #333; color: white;` }; const playerName = (()=>{ let players = findObjs({type:'player'}) .reduce((m,p)=>({...m, [p.id]: p.get('displayname')}),{}); return (pid) => players[pid] || '[Unknown]'; })(); const f = { li: (c) => `<li>${c}</li>`, ul: (c) => `<ul>${c}</ul>`, ol: (c) => `<ol>${c}</ol>`, b: (c) => `<b>${c}</b>`, subhead: (c) => `<h4>${c}</h4>`, ta: () => `<span style="${s.tokenAction}">TA</span>`, button: (label,command) => `<a style="${s.button}" href="${command}">${label}</a>`, mac: (m) => `${f.b(m.get('name'))} ${m.get('istokenaction') ? f.ta() : ''} ${f.button(`❌`,`!macro-cleanup ${m.id}`)}`, pla: (p,ms) => `${f.subhead(playerName(p))}${f.ul(ms.map(f.mac).map(f.li).join(''))}`, tree: (tree) => Object.keys(tree).map(pid=>f.pla(pid,tree[pid])).join('') }; on('chat:message', (msg) => { if('api' === msg.type && /^!macro-cleanup(\b\s|$)/i.test(msg.content) && playerIsGM(msg.playerid) ){ let who = (getObj('player',msg.playerid)||{get:()=>'API'}).get('_displayname'); let args = msg.content.split(/\s+/).slice(1); if(args.length){ _.chain(args) .map((id)=>getObj('macro',id)) .reject(_.isUndefined) .tap((ms)=>sendChat('',`/w "${who}" ${ms.length} removed.`)) .each((m)=>m.remove()); } else { let macroTree = findObjs({type:'macro'}) .reduce((m,mac)=>({ ...m, [mac.get('playerid')]:[ ...(m[mac.get('playerid')]||[]), mac ] }),{}); sendChat('',`/w "${who}" ${f.tree(macroTree)}`); } } }); });
1639420081

Edited 1639453372
Oh, thanks a lot for this Aaron, i'll test this asap Since you are here, can i ask you two more questions if you're ok ? 1) I have your script call GroupInitiative but the macro do not work for me. It does roll init for every token i have selected but do not add their bonus to initiative. It just roll a flat D20 and nothing else, do you have any idea why ? 2) I have your Torch script as well and i think, since the updated lightning, it do not work anymore. Do you have any recommandation to setup a macro who can change the new light of a token like a torch, light spell, etc ... ? Cause i have found this with TokenMod, but it do not work for me: ?{ Light/Vision options: |Normal vision, !token-mod --on has_bright_light_vision emits_bright_light emits_low_light --set bright_light_distance#0 low_light_distance#0 |Candle (br5/dim10),  !token-mod --set bright_light_distance#5 low_light_distance#5  |Lamp (br15/dim45),  !token-mod --set bright_light_distance#15 low_light_distance#30  |Torch/Light Cantrip (br20/dim40),  !token-mod --set bright_light_distance#20 low_light_distance#20  |Hooded Lantern (br30/dim60),  !token-mod --set bright_light_distance#30 low_light_distance#30 |Darkvision on (br0/dim60),  !token-mod --set night_vision_distance#60  |Darkvision off (br0/dim60),  !token-mod --set night_vision_distance#0 } (I've forget to check " Players can use --ids:" option for Token Mod, my bad on this one, so it's ok for light now) P.S: I'm not native english, sorry if there are grammatical errors
1639464553
The Aaron
Roll20 Production Team
API Scripter
For 1) what character sheet are you using and what bonus stat groups do you have configured?
The Aaron said: For 1) what character sheet are you using and what bonus stat groups do you have configured? Thanks for the response, i'm just dumb sorry. I forgot to add a stat bonus to the roll, so now it work perfectly, thanks for all the API you create :)