diff options
-rw-r--r-- | examples/jarvis.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/examples/jarvis.js b/examples/jarvis.js index 0b4a9d2..cb74da2 100644 --- a/examples/jarvis.js +++ b/examples/jarvis.js @@ -69,13 +69,14 @@ const notifsrc = '\ & Called: JARVISx ~SIGNATURE \n\ & If you have any good bullet art (<100 chars),\n\ & please send it to me at hr@hrhr.dev.'.replace('COMMAND', command).replace('SIGNATURE', sig); +const notifloc = [0, 20]; var minsUp = 0; var callct = 0; var notifClaim; function genNotif(){ let newnotif = new Space(); - newnotif.loc = [-6, 20]; + newnotif.loc = notifloc; text = notifsrc; text = text.replace('UPTIME', Math.floor(minsUp/60) + 'h' + minsUp%60 + 'm'); text = text.replace('JARVIS', callct); @@ -83,10 +84,12 @@ function genNotif(){ return newnotif } +var notif = new Space(); +notif.loc = notifloc; function notifRefresh(){ let newnotif = genNotif(); let diff = newnotif.copy(); - if (typeof notif !== 'undefined') diff.comb(notif, comb.sub); + diff.comb(notif, comb.sub); notif = newnotif; if (notifClaim) main.unclaim(notifClaim); notifClaim = main.claim(newnotif, protectArea); |