• bbs.menu vs bbs.menu_exis

    From nolageek@VERT/CAPSHRIL to Digital Man on Mon Jan 13 09:50:00 2020
    Is there a reason why bbs.menu_exist() does not allow using a directory before the file name like bbs.menu()?

    bbs.menu("dir\file_base") works for when I want to specify an ansi outside of the menu directory (I use it with user.command_shell a lot) but bbs.menu_exists("dir\file_base") always comes back negative.

    |01-|03nolageek

    ---
    þ Synchronet þ Capitol Shrill BBS - Washington, DC - capitolshrill.com
  • From Digital Man@VERT to nolageek on Mon Jan 13 09:26:00 2020
    Re: bbs.menu vs bbs.menu_exists
    By: nolageek to Digital Man on Mon Jan 13 2020 02:50 pm

    Is there a reason why bbs.menu_exist() does not allow using a directory before the file name like bbs.menu()?

    bbs.menu("dir\file_base") works for when I want to specify an ansi outside of the menu directory (I use it with user.command_shell a lot) but bbs.menu_exists("dir\file_base") always comes back negative.

    bbs.menu_exists() with a sub-directory specified should work fine. See xtrn_sec.js as an example which check for the existence (and displays) text/menu/xtrn/*.*.

    The correct path-separator to use in JS strings is a forward slash (/) not a backslash (\), so perhaps that's the issue?

    digital man

    Synchronet/BBS Terminology Definition #60:
    SCFG = Synchronet Configuration Utility
    Norco, CA WX: 60.7øF, 57.0% humidity, 2 mph NNW wind, 0.00 inches rain/24hrs

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From nolageek@VERT/CAPSHRIL to Digital Man on Tue Jan 14 04:44:00 2020
    Re: bbs.menu vs bbs.menu_exists
    By: Digital Man to nolageek on Mon Jan 13 2020 02:26 pm

    bbs.menu_exists() with a sub-directory specified should work fine. See xtrn_sec.js as an example which check for the existence (and displays) text/menu/xtrn/*.*.

    I can't figure out why this code doesn't work then:

    function mystMenu(file) {
    // check for 'file' in current command shell menu dir and if not found use
    // 'mystique' menu directory

    if (bbs.menu_exists(user.command_shell + '/' + file)) {
    bbs.menu(user.command_shell + '/' + file);
    } else {
    bbs.menu('mystique/' + file);
    }
    }

    If I then use mystMenu('mainmenu'); in my shell, it always shows the menu from the mystique directoy - even though they exist in both.

    I've tried combinations of testing for !bbs.menu_exists, etc.. it always comes back showing the mystique one. If I take the bbs.menu_exists test out, it works.

    I've been using this for the last couple of years, which works but I want to clean it up a bit cause it's a bit messy:

    function mystMenu(file) {
    var ansiDir = system.text_dir + 'menu/' + user.command_shell + '/';
    if (!file_exists(ansiDir + file + '.ans') && !file_exists(ansiDir + file + '.asc'))
    var ansiDir = system.text_dir + 'menu/mystique/';
    bbs.menu(ansiDir + file);
    }


    Thanks for your assistance, as always!

    ---
    þ Synchronet þ Capitol Shrill BBS - Washington, DC - capitolshrill.com
  • From Digital Man@VERT to nolageek on Tue Jan 14 04:55:00 2020
    Re: bbs.menu vs bbs.menu_exists
    By: nolageek to Digital Man on Tue Jan 14 2020 09:44 am

    Re: bbs.menu vs bbs.menu_exists
    By: Digital Man to nolageek on Mon Jan 13 2020 02:26 pm

    bbs.menu_exists() with a sub-directory specified should work fine. See xtrn_sec.js as an example which check for the existence (and displays) text/menu/xtrn/*.*.

    I can't figure out why this code doesn't work then:

    function mystMenu(file) {
    // check for 'file' in current command shell menu dir and if not found use // 'mystique' menu directory

    if (bbs.menu_exists(user.command_shell + '/' + file)) {
    bbs.menu(user.command_shell + '/' + file);
    } else {
    bbs.menu('mystique/' + file);
    }
    }

    If I then use mystMenu('mainmenu'); in my shell, it always shows the menu from the mystique directoy - even though they exist in both.

    Does the file text/menu/<shell>/mainmenu.asc exist? The .msg or .asc version of a menu file must exist for bbs.menu_exists() to return true.



    digital man

    Synchronet/BBS Terminology Definition #18:
    DM = Digital Man (Rob Swindell) or Dungeon Master
    Norco, CA WX: 54.4øF, 82.0% humidity, 0 mph W wind, 0.01 inches rain/24hrs

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From nolageek@VERT/CAPSHRIL to Digital Man on Tue Jan 14 09:09:00 2020
    Re: bbs.menu vs bbs.menu_exists
    By: Digital Man to nolageek on Tue Jan 14 2020 09:55 am

    Does the file text/menu/<shell>/mainmenu.asc exist? The .msg or .asc version of a menu file must exist for bbs.menu_exists() to return true.

    mainmenu.ans exists - does bbs.menu_exists() test for .msg or .asc but not .ans? That would explain it, but why would it not check for the same file types that bbs.menu() displays?

    |01-|03nolageek

    ---
    þ Synchronet þ Capitol Shrill BBS - Washington, DC - capitolshrill.com
  • From nolageek@VERT/CAPSHRIL to Digital Man on Tue Jan 14 09:15:00 2020
    Re: bbs.menu vs bbs.menu_exists
    By: Digital Man to nolageek on Tue Jan 14 2020 09:55 am

    Does the file text/menu/<shell>/mainmenu.asc exist? The .msg or .asc version of a menu file must exist for bbs.menu_exists() to return true.

    mainmenu.ans exists - does bbs.menu_exists() test for .msg or .asc but not .ans? That would explain it, but does it not check for the same file types
    that bbs.menu() displays?

    |01-|03nolageek

    ---
    þ Synchronet þ Capitol Shrill BBS - Washington, DC - capitolshrill.com
  • From Digital Man@VERT to nolageek on Tue Jan 14 10:00:00 2020
    Re: bbs.menu vs bbs.menu_exists
    By: nolageek to Digital Man on Tue Jan 14 2020 02:09 pm

    Re: bbs.menu vs bbs.menu_exists
    By: Digital Man to nolageek on Tue Jan 14 2020 09:55 am

    Does the file text/menu/<shell>/mainmenu.asc exist? The .msg or .asc version of a menu file must exist for bbs.menu_exists() to return true.

    mainmenu.ans exists - does bbs.menu_exists() test for .msg or .asc but not .ans? That would explain it, but why would it not check for the same file types that bbs.menu() displays?

    At minimum, a .asc or .msg menu display file is required. bbs.menu() first looks for the *most* applicable file format, not all file formats.

    digital man

    Synchronet/BBS Terminology Definition #84:
    XSDK = Synchronet External Program Software Development Kit for C/C++
    Norco, CA WX: 60.3øF, 63.0% humidity, 2 mph ESE wind, 0.01 inches rain/24hrs

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From nolageek@VERT/CAPSHRIL to Digital Man on Tue Jan 14 18:12:00 2020
    Re: bbs.menu vs bbs.menu_exists
    By: Digital Man to nolageek on Tue Jan 14 2020 03:00 pm

    At minimum, a .asc or .msg menu display file is required. bbs.menu() first looks for the *most* applicable file format, not all file formats.

    But it will find .ans - I guess I expected bbs.menu() and bbs.menu_exists() to work with the same formats so they could work together.I could convert I gues (but then I'd have to always convert back and forth to edit them.) Are .msg and .asc faster or are they "more native" to synchronet? Just curious.

    nolageek

    ---
    þ Synchronet þ Capitol Shrill BBS - Washington, DC - capitolshrill.com
  • From Rampage@VERT/SESTAR to nolageek on Wed Jan 15 03:36:00 2020
    Re: bbs.menu vs bbs.menu_exists
    By: nolageek to Digital Man on Tue Jan 14 2020 23:12:57


    Are .msg and .asc faster or are they "more native" to synchronet? Just curious.

    AFAIK, .msg format can be used for all... use ^A codes for the colors... if a user is mono-only (asc), they will get mono only... if they are color capable, they will get color in the format their terminal can handle...

    AIUI, sbbs handles the colors as needed by sending color codes for color capable terminals or not sending them for mono terminals... i'm pretty sure that user's setting are also taken into account so that a user may be using a color capable terminal but have their settings for ascii only... so they may see color on their initial connect but once logged in, everything will be in mono after that if they have set ascii only...

    i'm slowly moving to all .msg files for all my external display "templates" specifically so i don't have to manage 3 or 4 copies of the same file in different formats...


    )\/(ark

    ---
    þ Synchronet þ The SouthEast Star Mail HUB - SESTAR
  • From Digital Man@VERT to nolageek on Wed Jan 15 04:31:00 2020
    Re: bbs.menu vs bbs.menu_exists
    By: nolageek to Digital Man on Tue Jan 14 2020 11:12 pm

    Re: bbs.menu vs bbs.menu_exists
    By: Digital Man to nolageek on Tue Jan 14 2020 03:00 pm

    At minimum, a .asc or .msg menu display file is required. bbs.menu() first looks for the *most* applicable file format, not all file formats.

    But it will find .ans - I guess I expected bbs.menu() and bbs.menu_exists() to work with the same formats so they could work together.

    They do. That's why menu_exists() is failing, because you're doing it wrong. You *have* to have one of the lowest-common-denominator menu files (*.msg or *.asc).

    I could convert I
    gues (but then I'd have to always convert back and forth to edit them.)

    That or use an editor that supports Ctrl-A format files (e.g. PabloDraw).

    Are
    .msg and .asc faster or are they "more native" to synchronet? Just curious.

    Not faster, but better.

    digital man

    Synchronet "Real Fact" #93:
    Synchronet v3.16c was released in August of 2015 (5 years after v3.15b).
    Norco, CA WX: 44.4øF, 97.0% humidity, 0 mph WSW wind, 0.00 inches rain/24hrs

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net