Hey, I've encountered with the API output console getting stuck on the restarting sandbox message. This is what the console looks like after letting it run for a while. I've tried commenting out code that wasn't in a working version of the script, but even going back still gives me the same problem. I'm not really sure if adding my code will help but I'll do it anyway. on("chat:message", function(msg) {
log(msg.content);
log(msg.type);
if(msg.type !== "api"){
return;
}
if(msg.content.indexOf("!charGen" === 0) && msg.content.length > 6){
var charName = msg.content.substring(9, msg.content.length);
log(charName);
var characterSheet = findObjs({ type:'character', name: charName})[0];
log(characterSheet);
if(characterSheet){
var charRace = randomInteger(races.length);
log(races[charRace][6]);
stats = [];
stat_mods = []
for(a = 0; a<6;a++){
stats[a] = statroll();
stats[a] += races[charRace-1][a];
stat_mods[a] = Math.floor((stats[a] - 10)/2);
}
log(stats);
log(stat_mods);
/createObj("attribute",{name: "strength", current: stats[0], characterid: characterSheet.id});
createObj("attribute",{name: "strength_base", current: stats[0], characterid: characterSheet.id});
createObj("attribute",{name: "strength_mod", current: stat_mods[0], characterid: characterSheet.id});
createObj("attribute",{name: "dexterity", current: stats[1], characterid: characterSheet.id});
createObj("attribute",{name: "dexterity_base", current: stats[1], characterid: characterSheet.id});
createObj("attribute",{name: "dexterity_mod", current: stat_mods[1], characterid: characterSheet.id});
createObj("attribute",{name: "constitution", current: stats[2], characterid: characterSheet.id});
createObj("attribute",{name: "constitution_base", current: stats[2], characterid: characterSheet.id});
createObj("attribute",{name: "constitution_mod", current: stat_mods[2], characterid: characterSheet.id});
createObj("attribute",{name: "intelligence", current: stats[3], characterid: characterSheet.id});
createObj("attribute",{name: "intelligence_base", current: stats[3], characterid: characterSheet.id});
createObj("attribute",{name: "intelligence_mod", current: stat_mods[3], characterid: characterSheet.id});
createObj("attribute",{name: "wisdom", current: stats[4], characterid: characterSheet.id});
createObj("attribute",{name: "wisdom_base", current: stats[4], characterid: characterSheet.id});
createObj("attribute",{name: "wisdom_mod", current: stat_mods[4], characterid: characterSheet.id});
createObj("attribute",{name: "charisma", current: stats[5], characterid: characterSheet.id});
createObj("attribute",{name: "charisma_base", current: stats[5], characterid: characterSheet.id});
createObj("attribute",{name: "charisma_mod", current: stat_mods[5], characterid: characterSheet.id});
createObj("attribute",{name: "race", current: races[charRace][6], characterid: characterSheet.id});
}
}
});
var races = [
[0,0,2,0,1,0,"Hill Dwarf"],
[2,0,2,0,0,0,"Mountain Dwarf"],
[0,2,0,1,0,0,"High Elf"],
[0,2,0,0,1,0,"Wood Elf"],
[0,2,0,0,0,1,"Drow"],
[0,2,0,0,0,1,"Lightfoot Halfling"],
[0,2,1,0,0,0,"Stout Halfling"],
[1,1,1,1,1,1,"Human"],
[2,0,0,0,0,1,"Dragonborn"],
[0,1,0,2,0,0,"Forest Gnome"],
[0,0,1,2,0,0,"Rock Gnome"],
[0,0,0,0,0,2,"Half-Elf"],
[2,0,1,0,0,0,"Half-Orc"],
[0,0,0,1,0,2,"Tiefling"],
];
var statroll = function(){
var rolls = [];
var rollSum = 0;
for(i = 0; i < 4; i++){
rolls[i] = randomInteger(6);
}
for(j = 0; j < 3; j++){
var maxroll = 0;
var tracker;
for(k = 0; k < 4; k++){
if(rolls[k] > maxroll){
maxroll = rolls[k];
tracker = k;
}
}
rollSum += maxroll;
rolls[tracker] = 0;
}
return rollSum;
}; Any help is greatly appreciated. Thanks