interval(function(){ msg.payload = 'event,allsprinkleroff'; msg.Smsg = 'Leg ' + msg.nextleg + ' switched off, ready for waiting for borehole.'; msg.nextleg = msg.nextleg; updateNodeStatus('green', 'Ready'); node.send(msg); }, (legtime * 1000 * 60), 1);
function interval(func, wait, times){ var interv = function(w, t){ return function(){ if(typeof t === "undefined" || t-- > 0){ setTimeout(interv, w); try{ func.call(null); } catch(e){ t = 0; throw e.toString(); } } }; }(wait, times); setTimeout(interv, wait);}
IDid not see that ! Thanks, will try quickly.