
My game uses an injury system where injuries can be gained by taking certain amounts of damage. Each character has an Injuries attribute with a max of 10, and I've implemented this script so that injuries can be added with just the click of a button. It's just a quick rehash of a Blue Status Marker code with some inline roll help from one of The Aaron's scripts, so forgive the sloppiness, as I'm a noob. (I run it alongside this script to keep the attribute consistent with the Status Marker, but that probably won't be relevant to this problem.) on('chat:message', function(msg_orig) { if(msg_orig.type != 'api') return; // TheAaron's Inline Roll Expansion Code var msg = _.clone(msg_orig); if(_.has(msg,'inlinerolls')){ msg.content = _.chain(msg.inlinerolls) .reduce(function(m,v,k){ m['$[['+k+']]']=v.results.total || 0; return m; },{}) .reduce(function(m,v,k){ return m.replace(k,v); },msg.content) .value(); } var parts = msg.content.toLowerCase().split(' '); var command = parts.shift().substring(1); var selected = msg.selected; if(command != 'injury' || !selected) return; // use the !blue command, and have one or more things selected var count = +parts[0]; if(!count) count = 0; // if no height is returned, treat as 0 _.each(selected, function(obj) { if(obj._type != 'graphic') return; // only blue graphics var tok = getObj('graphic', obj._id); if(tok.get('subtype') != 'token') return; // don't try to blue cards tok.set('status_half-heart', false); var addblue = ''; while(count > 0) { // get current digit, starting from ones var digit = count / 10; digit -= Math.floor(digit); digit = Math.round(digit * 10); // shift height count = Math.floor(count / 10); addblue += 'half-heart@'+digit+','; } if(addblue.length > 0) addblue = addblue.substring(0, addblue.length - 1); // trim trailing comma var markers = tok.get('statusmarkers'); if(markers != '') markers += ','; markers += addblue; tok.set('statusmarkers', markers); }); }); I call this script with a macro bar button that performs the following: !injury [[@{selected|Injuries} +?{Injuries Gained|1}]] The Good News: This works perfectly on all standard tokens. I'm very satisfied with the way it works. The Bad News: "Summoning" is the most central feature of my game. All summoned creatures are handled with cards for ease of use with players. Summoned creatures can gain injuries just like everything else. Except that this script doesn't work on cards that are linked to characters for some reason. Halp?