This aught to work: on('ready', function(){
'use strict';
on ("change:campaign:turnorder", function(obj) {
var turn_order = JSON.parse(Campaign().get('turnorder')) || [],
current = {},
currentMsg;
current.turn=turn_order[0];
current.token = getObj( "graphic", current.turn.id);
current.character = getObj('character', current.token.get("_represents"));
current.markers = {
marked : current.token.get("status_skull"),
afflicted : current.token.get("status_bluemarker"),
affliction : findObjs({_type:'attribute',_characterid:current.character.get('_id'),name:'affliction'})[0],
ongoing : current.token.get("status_greenmarker"),
ongoingDmg : findObjs({_type:'attribute',_characterid:current.character.get('_id'),name:'ongoing'})[0],
bloodied : (current.token.get("bar3_value") < (Math.ceil(current.token.get("bar3_max") / 2))),
slowed : current.token.get("status_snail"),
dazed : current.token.get("status_screaming"),
immobilized : current.token.get("status_cobweb"),
weakened : current.token.get("status_back-pain"),
blinded : current.token.get("status_bleeding-eye"),
dominated : current.token.get("status_chained-heart"),
restrained : current.token.get("status_aura"),
prone : current.token.get("status_pinkmarker"),
stunned : current.token.get("status_lightning-helix")
};
current.name = current.token.get("name");
current.type = (current.character.get("controlledby") === "") ? 'Monster' : 'Player';
current.flagged = function(){
return (this.markers.marked || this.markers.afflicted || this.markers.ongoing || this.markers.bloodied ||this.markers.slowed || this.markers.dazed || this.markers.immobilized || this.markers.weakened || this.markers.blinded || this.markers.dominated || this.markers.restrained ||this.markers.prone || this.markers.stunned);
};
// End current turn
sendChat('system','/e changes turn.');
//Begin Turn
currentMsg = "Is up to bat.";
if (current.flagged()){
currentMsg += "<ul>";
if(current.markers.marked){
currentMsg += "<li>" + current.type + " is <strong>Marked</strong>!</li>";
}
if(current.markers.afflicted){
if(current.markers.affliction !== undefined){
currentMsg += "<li>" + current.type + " is <strong>afflicted with " + current.markers.affliction.get('current') + "</li>";
}
else {
currentMsg += "<li>" + current.type + " is <strong>afflicted</strong>!</li>";
}
}
if(current.markers.ongoing){
if(current.markers.ongoingDmg !== undefined){
currentMsg += "<li>" + current.type + " is takeing <strong>ongoing damage by " + current.markers.ongoingDmg.get('current') + "</strong>! Take Damage?</li>";
}
else {
currentMsg += "<li>" + current.type + " is taking <strong>ongoing damage</strong>! Take Damage?</li>";
}
}
if(current.markers.bloodied){
currentMsg += "<li>" + current.type + " is <strong>bloodied</strong>!</li>";
}
if(current.markers.slowed){
currentMsg += "<li>" + current.type + " is <strong>slowed</strong>!</li>";
}
if(current.markers.dazed){
currentMsg += "<li>" + current.type + " is <strong>dazed</strong>!</li>";
}
if(current.markers.immobilized){
currentMsg += "<li>" + current.type + " is <strong>immobilized</strong>!</li>";
}
if(current.markers.weakened){
currentMsg += "<li>" + current.type + " is <strong>weakened</strong>!</li>";
}
if(current.markers.blinded){
currentMsg += "<li>" + current.type + " is <strong>blinded</strong>!</li>";
}
if(current.markers.dominated){
currentMsg += "<li>" + current.type + " is <strong>dominated</strong>!</li>";
}
if(current.markers.restrained){
currentMsg += "<li>" + current.type + " is <strong>restrained</strong>!</li>";
}
if(current.markers.prone){
currentMsg += "<li>" + current.type + " is <strong>restrained</strong>!</li>";
}
if(current.markers.stunned){
currentMsg += "<li>" + current.type + " is <strong>stunned</strong>!</li>";
}
currentMsg += "</ul>";
}
sendChat(current.name, currentMsg);
});
});
There was a comma missing, but I cleaned up some other things too... =D