This sendChat line causes an error log(character);/*prints the character */
log(character.get('name'));/*prints the name */
sendChat(character.get('name'),"!shadowrun BLUB"); Which is: TypeError: Cannot call method 'get' of undefined
at handleInput (evalmachine.<anonymous>:7662:43) This line does not sendChat(character.get('name'),"!shadowrun BLUB",function(i) {}); and neither does this sendChat(character.get('name'),"BLUB"); handleInput is the callback for chat events and looks like this: var handleInput = function(msg) { var args; if (msg.type !== "api") { return; } log("CONTENT"); log(msg.content); args = msg.content.split(/\s+/); log("ARGS"); log(args); log(args[0]); log(msg); if(args[0] == "!shadowrun"){ log("Inside !shadowrun");
var character,character_id,action; if(args.indexOf("--character") !== -1){/*not entered*/} if(args.indexOf("--action") !== -1){/*not entered*/}
if(character){/*not entered*/}else{log("no character");} }else{
}
}; Anyone has ANY ideas how to debug what is undefined here? I already thought I have logged each and every object and none of those is undefined. I do not get the undefined get error when i send "!shadowrun BLUB" manually, which also enters this handleInput function.