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

Help mass-hiding every journal entry.

Hi, I've got a completed module-size campaign that I'd like to 'clear' and reset to run it for new players. However, almost every handout and NPC sheet is currently revealed. Doing this by hand would take hours of menial clicking, so I was hoping someone might be able to help with a script that can 'hide' all handouts, by which I mean remove any player (as well as 'all players') from the 'In Player's Journals' section of the handout or character sheet. The room has no players in it, so I can safely remove control from all of them as well, if this would make it easier.
1732917646
The Aaron
Roll20 Production Team
API Scripter
Here's a little script for that.  You can call it with any of the following: !hide-journal !hide-characters !hide-handouts That should be self explanatory. =D Here's the code: on('ready',()=>{ const hideJournal = async (type) => { if( ! ['handout','character'].includes(type)){ return; } const promises = findObjs({type}) .map( item => new Promise( resolve => setTimeout( () => { item.set({controlledby: '', inplayerjournals: ''}); resolve(); }, 0 ) ) ); await Promise.all(promises); }; on('chat:message',async msg => { if('api'===msg.type && /^!hide-(journal|characters|handouts)(\b\s|$)/i.test(msg.content) && playerIsGM(msg.playerid)){ const who = (getObj('player',msg.playerid)||{get:()=>'API'}).get('_displayname'); let args = msg.content.split(/\s+/); switch(args[0]){ case '!hide-journal': await hideJournal('handout'); await hideJournal('character'); sendChat('',`/w "${who}" <h3>Handouts and Characters are now hidden.</h3>`); break; case '!hide-handouts': await hideJournal('handout'); sendChat('',`/w "${who}" <h3>Handouts are now hidden.</h3>`); break; case '!hide-characters': await hideJournal('character'); sendChat('',`/w "${who}" <h3>Characters are now hidden.</h3>`); break; } } }); });
Thank you!