• Show message or screen on logon on particular date

    From Hawkeye@1:103/705 to All on Sat Apr 7 00:04:03 2018
    Hi fellow sysops,

    Can anyone send me in the right direction to show a message, screen or so when an user logon on a particular date?

    For eg on 1 february for valentine's day, 1 april for april foolsday, etc...

    Thanks for thinking with me.

    HAWKEYE

    ---
    * Synchronet * MASH4077.DDNS.NET - MASH BBS - The Netherlands
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Digital Man@1:103/705 to Hawkeye on Fri Apr 6 23:47:01 2018
    Re: Show message or screen on logon on particular date
    By: Hawkeye to All on Sat Apr 07 2018 12:04 am

    Hi fellow sysops,

    Can anyone send me in the right direction to show a message, screen or so when an user logon on a particular date?

    For eg on 1 february for valentine's day, 1 april for april foolsday, etc...

    Thanks for thinking with me.

    You could do this via batch files/shell script by using the automatic environment variables set by sbbs (http://wiki.synchro.net/config:env#automatic) in an event (logon event, timed event. etc.) to check for a file and display it (or copy it to text/menu/logon.asc).

    Or just a few lines of JavaScript added to your logon.js:

    var datefile = system.text_dir + format("%02u%02u.asc"
    , new Date().getMonth(), new Date().getDate());
    if(file_exists(datefile))
    console.printfile(datefile);

    For more details, start here: http://synchro.net/docs/js.html

    digital man

    Synchronet/BBS Terminology Definition #16:
    DOVE = Domain/Vertrauen
    Norco, CA WX: 57.9oF, 81.0% humidity, 0 mph S wind, 0.00 inches rain/24hrs
    --- SBBSecho 3.04-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Hawkeye@1:103/705 to Digital Man on Thu Apr 12 22:06:02 2018
    Re: Show message or screen on logon on particular date
    By: Digital Man to Hawkeye on Fri Apr 06 2018 23:47:01

    Or just a few lines of JavaScript added to your logon.js:
    var datefile = system.text_dir + format("%02u%02u.asc"
    , new Date().getMonth(), new Date().getDate());
    if(file_exists(datefile))
    console.printfile(datefile);

    Thanks! I first didn't see/find this post, which was weird as I logged in every day to check out new posts.

    I add this in my logon.js, at the end and also tried in the beginning. Placed an ascii file named 0412.asc in c:\sbbs\text but it doesn't show up.

    Also logged in with other user than myself, a test user. Rebooted, restarted, etc...

    Thanks for any help.

    HAWKEYE

    - MASH BBS - mash4077.ddns.net - The Netherlands -

    ---
    * Synchronet * MASH4077.DDNS.NET - MASH BBS - The Netherlands
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Digital Man@1:103/705 to Hawkeye on Thu Apr 12 20:52:42 2018
    Re: Show message or screen on logon on particular date
    By: Hawkeye to Digital Man on Thu Apr 12 2018 10:06 pm

    Re: Show message or screen on logon on particular date
    By: Digital Man to Hawkeye on Fri Apr 06 2018 23:47:01

    Or just a few lines of JavaScript added to your logon.js:
    var datefile = system.text_dir + format("%02u%02u.asc"
    , new Date().getMonth(), new Date().getDate());
    if(file_exists(datefile))
    console.printfile(datefile);

    Thanks! I first didn't see/find this post, which was weird as I logged in every day to check out new posts.

    I add this in my logon.js, at the end and also tried in the beginning. Placed an ascii file named 0412.asc in c:\sbbs\text but it doesn't show up.

    Just print the file name (datefile) to the terminal user (e.g. using alert() or print()) or log it (using log()) to find out why.

    Also logged in with other user than myself, a test user. Rebooted, restarted, etc...

    You don't need to do any of those things.

    digital man

    Synchronet "Real Fact" #35:
    The irc.synchro.net network has more servers than users.
    Norco, CA WX: 60.1oF, 30.0% humidity, 2 mph E wind, 0.00 inches rain/24hrs
    --- SBBSecho 3.04-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From KK4QBN@1:103/705 to Digital Man on Fri Apr 13 09:20:20 2018
    Re: Show message or screen on logon on particular date
    By: Digital Man to Hawkeye on Thu Apr 12 2018 20:52:42

    Synchronet "Real Fact" #35:
    The irc.synchro.net network has more servers than users.

    wow haha.

    --

    Tim Smith (KK4QBN)
    KK4QBN BBS

    ---
    * Synchronet * KK4QBN BBS - kk4qbn.com - 706.422.9538 - EM74OR - NW GA USA
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Bill McGarrity@1:103/705 to Digital Man on Fri Apr 13 09:47:00 2018
    Hiya Rob...

    Digital Man wrote to Hawkeye on 04-12-18 20:52 <=-

    Re: Show message or screen on logon on particular date
    By: Hawkeye to Digital Man on Thu Apr 12 2018 10:06 pm

    Re: Show message or screen on logon on particular date
    By: Digital Man to Hawkeye on Fri Apr 06 2018 23:47:01

    Or just a few lines of JavaScript added to your logon.js:
    var datefile = system.text_dir + format("%02u%02u.asc"
    , new Date().getMonth(), new Date().getDate());
    if(file_exists(datefile))
    console.printfile(datefile);

    Thanks! I first didn't see/find this post, which was weird as I logged in every day to check out new posts.

    I add this in my logon.js, at the end and also tried in the beginning. Placed an ascii file named 0412.asc in c:\sbbs\text but it doesn't show up.

    Just print the file name (datefile) to the terminal user (e.g. using alert() or print()) or log it (using log()) to find out why.

    Also logged in with other user than myself, a test user. Rebooted, restarted, etc...

    You don't need to do any of those things.

    I've been following this thread and have been updating my logon.js as well. I was getting the same results as Hawkeye so I added the alert() as you suggested. Interesting results. Here is the message I received: c:\sbbs\text\0313.asc

    It seems it's looking for the wrong file. Now I'm no expert but could there be an issue with the 'format' statement? My computer clock is reading April 13, 2018.

    Your thoughts?


    --

    Bill

    Telnet: tequilamockingbirdonline.net
    Web: bbs.tequilamockingbirdonline.net
    FTP: ftp.tequilamockingbirdonline.net:2121
    IRC: irc.tequilamockingbirdonline.net Ports: 6661-6670 SSL: +6697
    Radio: radio.tequilamockingbirdonline.net:8010/live


    ... Look Twice... Save a Life!!! Motorcycles are Everywhere!!!
    --- MultiMail/Win32 v0.50
    * Synchronet * TequilaMockingbird Online - Toms River, NJ
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Android8675@1:103/705 to Hawkeye on Fri Apr 13 08:07:01 2018
    Re: Show message or screen on logon on particular date
    By: Hawkeye to Digital Man on Thu Apr 12 2018 10:06 pm

    var datefile = system.text_dir + format("%02u%02u.asc"
    , new Date().getMonth(), new Date().getDate());
    if(file_exists(datefile))
    console.printfile(datefile);

    I add this in my logon.js, at the end and also tried in the beginning. Placed an ascii file named 0412.asc in c:\sbbs\text but it doesn't show up.

    Troubleshooting...

    var datefile = system.text_dir + format("%02u%02u.asc",
    new Date().getMonth(), new Date().getDate());
    console.writeln("Displaying file: " + datefile);
    console.pause();
    if(file_exists(datefile))
    console.printfile(datefile);

    Add the 2 lines in the middle, it'll display the filename it's attempting to print out, it's possible the filename may not have leading zeroes like 412.asc instead of 0412.asc
    --
    Android8675@ShodansCore



    ... Nostalgia is OK, but it's not what it used to be.

    ---
    * Synchronet * Shodan's Core @ ShodansCore.com
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Digital Man@1:103/705 to KK4QBN on Fri Apr 13 11:04:47 2018
    Re: Show message or screen on logon on particular date
    By: KK4QBN to Digital Man on Fri Apr 13 2018 09:20 am

    Re: Show message or screen on logon on particular date
    By: Digital Man to Hawkeye on Thu Apr 12 2018 20:52:42

    Synchronet "Real Fact" #35:
    The irc.synchro.net network has more servers than users.

    wow haha.

    That actually may not be a "fact" any longer. It's a close call.

    digital man

    Synchronet "Real Fact" #45:
    Synchronet External "Plain Old Telephone System" support was introduced in 2007.
    Norco, CA WX: 68.9oF, 14.0% humidity, 13 mph ENE wind, 0.00 inches rain/24hrs --- SBBSecho 3.04-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Digital Man@1:103/705 to Bill McGarrity on Fri Apr 13 11:06:39 2018
    Re: Show message or screen on logon on particular date
    By: Bill McGarrity to Digital Man on Fri Apr 13 2018 09:47 am

    Hiya Rob...

    Digital Man wrote to Hawkeye on 04-12-18 20:52 <=-

    Re: Show message or screen on logon on particular date
    By: Hawkeye to Digital Man on Thu Apr 12 2018 10:06 pm

    Re: Show message or screen on logon on particular date
    By: Digital Man to Hawkeye on Fri Apr 06 2018 23:47:01

    Or just a few lines of JavaScript added to your logon.js:
    var datefile = system.text_dir + format("%02u%02u.asc"
    , new Date().getMonth(), new Date().getDate());
    if(file_exists(datefile))
    console.printfile(datefile);

    Thanks! I first didn't see/find this post, which was weird as I logged in every day to check out new posts.

    I add this in my logon.js, at the end and also tried in the beginning. Placed an ascii file named 0412.asc in c:\sbbs\text but it doesn't show up.

    Just print the file name (datefile) to the terminal user (e.g. using alert() or print()) or log it (using log()) to find out why.

    Also logged in with other user than myself, a test user. Rebooted, restarted, etc...

    You don't need to do any of those things.

    I've been following this thread and have been updating my logon.js as well. I was getting the same results as Hawkeye so I added the alert() as you suggested. Interesting results. Here is the message I received: c:\sbbs\text\0313.asc

    It seems it's looking for the wrong file. Now I'm no expert but could there be an issue with the 'format' statement? My computer clock is reading April 13, 2018.

    Your thoughts?

    Ah, good catch. The month is zero-based: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Object s/Date/getMonth

    Just add "+1" after the call to getMonth().

    digital man

    Synchronet/BBS Terminology Definition #30:
    IP = Internet Protocol
    Norco, CA WX: 68.9oF, 14.0% humidity, 13 mph ENE wind, 0.00 inches rain/24hrs --- SBBSecho 3.04-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Android8675@1:103/705 to Bill McGarrity on Fri Apr 13 09:25:13 2018
    Re: Show message or screen on logon on particular date
    By: Bill McGarrity to Digital Man on Fri Apr 13 2018 09:47 am

    var datefile = system.text_dir + format("%02u%02u.asc"
    , new Date().getMonth(), new Date().getDate());

    It seems it's looking for the wrong file. Now I'm no expert but could there be an issue with the 'format' statement? My computer clock is reading April 13, 2018.

    Change the "new Date().getMonth()" part and add a +1 (January might = 0)

    var datefile = system.text_dir + format("%02u%02u.asc", new Date().getMonth()+1, new Date().getDate());
    --
    Android8675@ShodansCore

    ---
    * Synchronet * Shodan's Core @ ShodansCore.com
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Bill McGarrity@1:266/404 to Android8675 on Fri Apr 13 17:13:00 2018
    Android8675 wrote to Bill McGarrity on 04-13-18 09:25 <=-

    Re: Show message or screen on logon on particular date
    By: Bill McGarrity to Digital Man on Fri Apr 13 2018 09:47 am

    var datefile = system.text_dir + format("%02u%02u.asc"
    , new Date().getMonth(), new Date().getDate());

    It seems it's looking for the wrong file. Now I'm no expert but could there be an issue with the 'format' statement? My computer clock is reading April 13, 2018.

    Change the "new Date().getMonth()" part and add a +1 (January might =
    0)

    var datefile = system.text_dir + format("%02u%02u.asc", new Date().getMonth()+1, new Date().getDate());

    That it was. Added the +1 and poof... worked like a charm.

    Thank you..


    --

    Bill

    Telnet: tequilamockingbirdonline.net
    Web: bbs.tequilamockingbirdonline.net
    FTP: ftp.tequilamockingbirdonline.net:2121
    IRC: irc.tequilamockingbirdonline.net Ports: 6661-6670 SSL: +6697
    Radio: radio.tequilamockingbirdonline.net:8010/live


    ... Look Twice... Save a Life!!! Motorcycles are Everywhere!!!
    --- MultiMail/Win32 v0.50
    * Origin: TequilaMockingbird Online - Toms River, NJ (1:266/404)
  • From Bill McGarrity@1:266/404 to Digital Man on Fri Apr 13 17:32:00 2018
    Digital Man wrote to Bill McGarrity on 04-13-18 11:06 <=-

    I've been following this thread and have been updating my logon.js as well. I was getting the same results as Hawkeye so I added the alert() as you suggested. Interesting results. Here is the message I received: c:\sbbs\text\0313.asc

    It seems it's looking for the wrong file. Now I'm no expert but could there be an issue with the 'format' statement? My computer clock is reading April 13, 2018.

    Your thoughts?

    Ah, good catch. The month is zero-based: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global _Object
    s/Date/getMonth

    Just add "+1" after the call to getMonth().

    As usual, worked like a charm. You da Man!!

    Thanks..


    --

    Bill

    Telnet: tequilamockingbirdonline.net
    Web: bbs.tequilamockingbirdonline.net
    FTP: ftp.tequilamockingbirdonline.net:2121
    IRC: irc.tequilamockingbirdonline.net Ports: 6661-6670 SSL: +6697
    Radio: radio.tequilamockingbirdonline.net:8010/live


    ... Look Twice... Save a Life!!! Motorcycles are Everywhere!!!
    --- MultiMail/Win32 v0.50
    * Origin: TequilaMockingbird Online - Toms River, NJ (1:266/404)
  • From Hawkeye@1:103/705 to Digital Man on Fri Apr 13 22:30:55 2018
    Re: Show message or screen on logon on particular date
    By: Digital Man to Hawkeye on Thu Apr 12 2018 20:52:42

    I add this in my logon.js, at the end and also tried in the beginning. Placed an ascii file named 0412.asc in c:\sbbs\text but it doesn't show up.

    I think the confusing was caused by the month variable. When you showed me how to show the filename it shows 0313 and not 0413, month+1 and it was working!

    You don't need to do any of those things.

    digital man

    Thanks a lot for you patience and help. As (extra) appreciation I sent a small donation to your paypal. Good software deserves support, always.

    Hawkeye
    HAWKEYE

    - MASH BBS - mash4077.ddns.net - The Netherlands -

    ---
    * Synchronet * MASH4077.DDNS.NET - MASH BBS - The Netherlands
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Hawkeye@1:103/705 to Android8675 on Fri Apr 13 22:32:13 2018
    Re: Show message or screen on logon on particular date
    By: Android8675 to Hawkeye on Fri Apr 13 2018 08:07:01

    Add the 2 lines in the middle, it'll display the filename it's attempting to print out, it's possible the filename may not have leading zeroes like 412.asc instead of 0412.asc
    Android8675@ShodansCore

    For a strange reason it showed 0313.asc today instead of 0413.asc, Digital Man send me the instruction to add +1 after the getMonth and that did the trick!


    HAWKEYE

    - MASH BBS - mash4077.ddns.net - The Netherlands -

    ---
    * Synchronet * MASH4077.DDNS.NET - MASH BBS - The Netherlands
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Digital Man@1:103/705 to Hawkeye on Fri Apr 13 22:36:31 2018
    Re: Show message or screen on logon on particular date
    By: Hawkeye to Digital Man on Fri Apr 13 2018 10:30 pm

    Thanks a lot for you patience and help. As (extra) appreciation I sent a small donation to your paypal. Good software deserves support, always.

    Got it! Thanks,

    digital man

    Synchronet/BBS Terminology Definition #3:
    ASCII = American Standard Code for Information Interchange
    Norco, CA WX: 70.3oF, 12.0% humidity, 4 mph SSW wind, 0.00 inches rain/24hrs --- SBBSecho 3.04-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)