Using them is pretty straight-forward - go to "API Scripts" in your game settings, and paste the below script into a new script tab. This is quickly thrown together, and has no real error checking or command lines that do anything else. You basically add this script, click Save, then wait for the message "removeHandout bot is ready" to come up in the API Console window (just below where you pasted the script). Then go into the game in another tab, and type !handoutRemove into chat. This will remove ALL content from the "inplayerjournals" property of ALL handouts - just double checking that's what you want to do. Or it might end the universe. If you wanted to get fancy with filters and keywords, that's possible, but is significantly more complicated. Might need someone with proper skills if that's the case. I'd probably disable or delete this once you're done with it - it's unlikely that someone will type !removeHandouts in to chat, but you never know.... there's no GM check or anything on this. Edit - code below fixed by Aaron on('ready', () => {
log(`removeHandout bot is ready...`);
on('chat:message', (msg) => {
if (msg.type === 'api' && /^!handoutRemove/i.test(msg.content) ) {
let counter=0;
let handoutArray = findObjs({type: 'handout'});
log(`${handoutArray.length} handouts found...`);
const burndown = () => {
let h = handoutArray.shift();
if(h){
h.set('inplayerjournals','');
log(`${h.get('name')} removed from players' Journals...`);
counter++;
setTimeout(burndown,0);
} else {
sendChat('handoutBot',`${counter} handouts processed.`);
}
};
burndown();
}
});
});