I just wanted to give something back to this wonderful community, as I dived deep in and found the answer to my group's current desire -- A die roller for TORG Classic. It has a weird scheme where you roll a D20 and if you're skilled in the area 10s and 20s explode. If you're unskilled, then only the 10s explode, and keep exploding as necessary. And then once you get done with that, you take your final die roll and compare it to a little chart at the bottom of your character sheet for an effect number which is added to your skill + your stat. Don't worry about it if you don't play TORG, I don't think anyone else uses that system :-) But if you do play TORG, and you have a PRO level account, I give you the TORG Classic Die Roller! There are two ways to call it: !torg [modifier] !torg-noskill [modifier] The modifier can be ignored if you don't need one. The code follows the sample outputs. Note that this is in very verbose mode because that's how I like to see die rolls. on("chat:message", function(msg) { // Exit if not an api command if (msg.type != "api") return; // Get the API Chat Command // Strip out args[0] and args[1] if no arg[1] then modifier is 0. var args = msg.content.split(' ') var command = args[0]; if (args[1] == null) { var modifier = 0; } else { var modifier = parseInt(args[1]); } // Determine how the script was called. if (command == "!torg") { var skilled = 1; } else if (command == "!torg-noskill") { var skilled = 0; } // Define some useful variables. var count = 0; var roll = 0; var total = 0; var explode = 1; var output = ""; var effect = 0; while (explode > 0) { roll = randomInteger(20); output = output + " " + roll; total = total + roll; if (roll === 10) { explode = 1; count = 1; } else if ((roll === 20) && (skilled == 1)) { explode = 1; count = 1; } else { explode = 0; } } total = total + modifier; // calculate the effect number if (total <= 1) { effect = -12; } else if (total == 2) { effect = -10; } else if (total <= 4) { effect = -8; } else if (total <= 6) { effect = -5; } else if (total <= 8) { effect = -2; } else if (total <= 10) { effect = -1; } else if (total <= 12) { effect = 0; } else if (total <= 14) { effect = 1; } else if (total <= 20) { effect = total - 13; } else { effect = Math.ceil(((total + 15)/5)); // effect = (total + 15) / 5; // effect = parseInt() + 15; } output = "&{template:default} {{name=TORG Dice Roller}} {{modifier= " + modifier + "}} {{dice rolled= " + output + "}} {{Total= " + total + "}} {{Skill Effect= " + effect + "}}"; sendChat(msg.who, output); });