Gonna tear my hair out! Why is my script showing the roll variable as a boolean? It should just be a number from 1 to 10. This was produced with the command !continuum Quick|5|0 I can sendChat("test", roll.toString()) and it appears in the chat as a number. Why doesn't it appear that way in the roll template? Note also that when the check variable appears in the roll template, it appears as a number, not a boolean. Here's the script: //Continuum rolling
on("ready", function() {
log("Continuum rolling script loading.");
});
on("chat:message", function(msg) {
if(msg.type == "api" && msg.content.indexOf("!continuum ") !== -1) {
var parameters = msg.content.replace("!continuum ", "");
var skill = parameters.split("|")[0];
var rating = Number(parameters.split("|")[1]);
var modifier = Number(parameters.split("|")[2]);
var gm = msg.content.split("|")[3];
var roll = randomInteger(10);
var check = randomInteger(10);
var result = rating - roll + modifier;
var status;
var output = "";
if(result >= 0) {
status = "Success";
} else {
status = "Failure";
}
if(roll == 1) {
status = "Automatic Success";
}
if(roll == 1 && check == 1) {
status = "Victory!";
}
if(roll == 10 && check == 10) {
status = "Blunder!";
}
if(roll = rating && check == rating) {
status = "Grace!";
}
if(gm == "gm") {
output += "/w gm ";
}
output += "&{template:default} {{name=Roll vs. " + skill + "}} {{Rating=" + rating.toString() + "}} ";
if(modifier != 0) {
output += "{{Modifier=" + modifier.toString() + "}} ";
}
output += "{{Roll=" + roll.toString() + "}} "
if(status == "Victory!" || status == "Blunder!" || status == "Grace!") {
output += "{{Check=" + check.toString() + "}} ";
}
output += "{{Result=" + result.toString() + "}} {{Outcome=" + status + "}}";
sendChat(msg.who, output);
}
});