aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorHolden Rohrer <holden.rohrer@gmail.com>2019-12-29 20:04:23 -0500
committerHolden Rohrer <holden.rohrer@gmail.com>2019-12-29 20:04:23 -0500
commit554a50cfb5f7eaf093b6d4f73e53dac056909344 (patch)
tree60c0fdf909c988c5a423a426f35bdba0e66ee955 /examples
parent84f6f0109b3e3e4ab6ee667403400ba31402a840 (diff)
retooling of notifRefresh
Diffstat (limited to 'examples')
-rw-r--r--examples/jarvis.js9
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