Gold said: Brian, What if? What if I want to !removeall (remove abilities or just uncheck the token actions) on ALL the Characters in the entire game, not just on selected tokens? What if I want to do that on ALL the Characters except for 6 characters? (Uncheck token actions from all the monsters in the entire game, except for the 6 Player's Characters). What if I want to uncheck all the token actions except for 1 token action with a known name ("Loot")? I'm currently employing the quick-n-dirty script snippit Brian provided in this thread, and it works nicely on a "selected" basis. Thanks man! I'd like to scrub an entire game, like so. A game that has dozens of monster-characters with token actions that aren't needed for running in an alternate game system. // Uncheck all tokenaction abilities in the entire campaign on('chat:message', function(msg) {
var allAbilities = findObjs({ type: 'ability' });
if (msg.content !== '!removeallabilities') return;
_.each(allAbilities, function(abil) {
abil.set('istokenaction', false);
});
}); // Uncheck all tokenaction abilities except for tokenactions on characters linked to the selected tokens on('chat:message', function(msg) {
var allCharacters = findObjs({ type: 'character' }), selectedIds, allExceptSelected;
if (msg.content !== '!removeallexceptselected' || !msg.selected) return; selectedIds = _.chain(msg.selected)
.map((sel) => getObj(sel._type, sel._id).get('represents'))
.reject((rep) => rep === '')
.value(); allExceptSelected = _.reject(allCharacters, (char) => _.contains(selectedIds, char.id));
_.each(allExceptSelected, function(char) {
var abilities = findObjs({ type: 'ability', characterid: char.id });
_.each(abilities, function(abil) {
abil.set('istokenaction', false);
});
});
}); // Uncheck all tokenaction abilities in the entire campaign except the named abilities
on('chat:message', function(msg) {
var allAbilities = findObjs({ type: 'ability' }), args = msg.content.toLowerCase().split(' '), command = args.shift().substring(1);
if (command !== 'removeallexcept' || !msg.selected) return;
_.each(allAbilities, function(abil) { if (_.contains(args, abil.get('name').toLowerCase())) return;
abil.set('istokenaction', false);
});
}); Use the command "!removeallabilities" to make all abilities in the entire campaign not tokenactions. (Change abil.set to abil.remove if you want to actually delete them.) Use the command "!removeallexceptselected" to make all abilities in the campaign not tokenactions except for abilities on characters linked to the selected token(s). Use the command "!removeallexcept [ ability1-name [ ability2-name [ ability3-name... ]]]" to make all abilities in the campaign not tokenactions except abilities with names matching the supplied argument(s). Don't include the square brackets ~_^. If you don't supply any ability names, it should function just like !removeallabilities in #1, above. These three scripts are just as quick-and-dirty as the first one!