4,
    indentWithTabs: true,
    matchBrackets: true,
});
editor.setSize("100%", 600);

function luaPrint(s) {
    $("#output").append("["+new Date().Format("HH:mm:ss.S")+"] ");
    if(typeof(s) != "string")
        s = "";
    var textarea = $("#output").append(s.replace("<","&lt;") + "\r\n");
    textarea.scrollTop(textarea[0].scrollHeight - textarea.height());
}

function runCode() {
    var code = editor.getValue();
    newLuaState();
    $("#runButton").prop("disabled", true);
    $("#stopButton").prop