So I'm trying to make a custom DH2 sheet for my game using this API for degree of success /** * This script rolls a d100 and computes and outputs the success results based * on Dark Heresy Second Edition RPG criteria. * * The following commands is used: * !roll40k [tokenName], [attributeValue], [ModifierValue] **/ //Rolls a d100 and calculates the success or fail results to the chat window. var rollResultForRoll40k = function (token, attribute, modifier) { var roll = randomInteger(100); var modTarget = parseInt(attribute) + parseInt(modifier); var output1 = token + ' has a modified target of <B>' + modTarget + '</B> and rolled a <B>' + roll + '</B>. '; var output2, degOfSuc; //Form output message based on result if (roll === 1) { output2 = '<span style="color:green">' + token + ' rolled a 1 and automatically succeeds by <B>1 degree</B>.</span>'; } else if (roll === 100) { output2 = '<span style="color:red">' + token + ' rolled a 100 and automatically fails by <B>1 degree</B>.</span>'; } else if (roll <= modTarget) { degOfSuc = (Math.floor(modTarget / 10) - Math.floor(roll / 10)) + 1; output2 = '<span style="color:green">' + token + ' succeeds by <B>' + degOfSuc + ' degree(s)</B>.</span>'; } else { degOfSuc = (Math.floor(roll / 10) - Math.floor(modTarget / 10)) + 1; output2 = '<span style="color:red">' + token + ' fails by <B>' + degOfSuc + ' degree(s)</B></span>.'; } //Return output return output1 + '<br><br>' + output2; }; /** Interpret the chat commands. **/ on('chat:message', function (msg) { 'use strict'; var cmdName = '!roll40k '; if (msg.type === 'api' && msg.content.indexOf(cmdName) !== -1) { var paramArray = msg.content.slice(cmdName.length).split(','); if (paramArray.length !== 3) { sendChat(msg.who, '/w ' + msg.who + ' You must specify three comma-separated ' + 'parameters for the !roll40k command.'); } else { var result = rollResultForRoll40k(paramArray[0].trim(), paramArray[1].trim(), paramArray[2].trim()); sendChat(msg.who, result); } } }); Normally it work just fine, but I also wanted to implement the new drop down list for combat circumstances that just got updated for the character sheet. So I tried a command like this: !roll40k @{character_name}, @{BallisticSkill}, (?{Aim | Half aim (+10),+10| No aim (+0),+0 | Full aim (+20),+20} + ?{Range | Point Blank (+30),+30 | Short Range (+10),+10 | Standard range (+0),+0 | Long Range (-10),-10 | Extreme Range (-30),-30} + ?{Rate of Fire/Attack Type|Standard (+10),+10 | Semi auto (+0),+0 | Full Auto (-10),-10 | Called Shot (-20),-20 | Suppressing Fire (-20),-20} + ?{Modifier|0}) Aaaand it doesn't work, only the first value ?{Aim | Half aim (+10),+10| No aim (+0),+0 | Full aim (+20),+20} got calculate by the API. I think it's because API command doesn't do calculation like macro? Anyone can help me out on this?