At the bottom of this post is a (very) quick and dirty script to output a players roll for a group of skills. Call it with a macro like this: !groupskills @{selected|character_id} Knowledges [[1d20]] Arcana|Knowledge-Arcana Dungeoneering|Knowledge-Dungeoneering History|Knowledge-History !wgroupskills @{Frodo|character_id} Knowledge-Skills [[1d20]] Arcana|Knowledge-Arcana Dungeoneering|Knowledge-Dungeoneering History|Knowledge-History It is in the format !scriptname characterID HEADER roll [List of Skills] !groupskills or !wgroupskills: start with one of these. If wgroupskills , it will whisper to the person who triggered the macro. characterid: this can be gained with selected, target, or by name, and is the character whose skills you want to test. HEADER: a title for the output. It will automatically start with character name, and then this text. If you want to use more than one word, replace any spaces with dashes as in the second example above. On output, those dashes will be replaced with spaces. Roll: the roll you want to compare every skill to. Skill List: a list of skills each of which has two parts: the label you want to see in the output, and the attribute name on the character sheet that contains its value. Separate these with a pipe (|). You can include any number of skills. IMPORTANT: this script has no error checking, so make sure you enter everything in the order above, separated by spaces. on('ready', () => {
'use strict';
const getRoll = (rolls, n) => (rolls && n < rolls.length) ? rolls[n].results.total : 0;
on('chat:message', (msg) => {
if (msg.type == 'api' && (msg.content.startsWith('!groupskills') || msg.content.startsWith('!wgroupskills'))) {
const who=(getObj('player',msg.playerid)||{get:()=>'API'}).get('_displayname');
const whisper = msg.content.startsWith('!wgroupskills') ? `/w ${who} ` : '';
let args = msg.content.split(/\s+/);
args.shift();
const targetid = args.shift();
const header = args.shift().replace(/-/gi,' ');
const roll = +getRoll(msg.inlinerolls, 0) || 0;
args.shift();
let skills = [];
args.forEach(which => {
let skill = which.split('|');
skills.push(`{{${skill[0]}=${roll + getAttrByName(targetid,skill[1],'current')}}}`);
});
const output = `${whisper}&{template:default} {{name=${getAttrByName(targetid,'character_name','current')} ${header}}} {{Roll=${roll}}} ${skills.join(' ')}`;
sendChat('Skill Group', output);
} else {
return;
}
});
});