diff options
-rw-r--r-- | examples/jarvis.js | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/examples/jarvis.js b/examples/jarvis.js index 3572a3c..3c985bb 100644 --- a/examples/jarvis.js +++ b/examples/jarvis.js @@ -61,7 +61,6 @@ function tileHandler(send, source, tiles){ }); } -var notif = new Space(); notifsrc = '\ \n\ For a node.js YWOT api: \n\ @@ -69,17 +68,19 @@ notifsrc = '\ & Try `jarvis` today. Uptime: UPTIME \n\ ' var hrsUp = 0; +var ctrl; function notifRefresh(){ + let newnotif = new Space(); + newnotif.loc = [-6, 20]; newnotif.adhoc(notifsrc.replace('UPTIME', hrsUp + 'hrs')); let diff = newnotif.copy(); - diff.comb(notif, comb.sub); + if (typeof notif !== 'undefined') diff.comb(notif, comb.sub); notif = newnotif; writes.enqueue(...diff.towrite()); - var ctrl = ms(notif); + ctrl = ms(notif); setTimeout(notifRefresh, 3600*1000); hrsUp += 1; } -notif.loc = [-6, 20]; function protectArea(send, tiles, locs){ let tilesize = [8, 16]; // This may be exportable to an external util/tool |