function pluginInit(hash) { //This method is called when the room starts //Pug in initial commands if needed timeFormat = hash.get("timeFormat"); } function pluginRequest(hash) { var caller = hash.get("ExecutingUserName"); var method = hash.get("Method"); if (method == "Calculate") { num = Number(hash.get("iterations")); var result = calculate(num); returnToUser(result, caller); } } function returnToUser(value, caller) { var variables = new Object(); variables.result = value; var action = "CalculationResult"; server.sendMessage("private", [caller], action, variables); } function calculate(num) { var start = (new Date()).getTime(); var counter = 0; var l; for (var i = 0; i