• .JS as a Command Shell

    From art@VERT/FATCATS to All on Wed Nov 18 13:43:09 2009
    Hi guys,

    I must have missed something because I don't seem to see it in the documentation or past messages: how would one go about setting a .JS file as a command shell?

    Does this involve making a BAJA "shell" just to call the .JS?

    Thanks & regards,
    Art at fatcats dot poorcoding dot com

    | fatcats bbs |
    | + telnet://fatcats.poorcoding.com |
    | + ssh://fatcats.poorcoding.com:2322 |

    ---
    þ Synchronet þ fatcats bbs - http://fatcats.poorcoding.com
  • From echicken@VERT/ECBBS to art on Wed Nov 18 10:58:11 2009
    Re: .JS as a Command Shell
    By: art to All on Wed Nov 18 2009 13:43:09

    documentation or past messages: how would one go about setting a .JS file as command shell?
    Does this involve making a BAJA "shell" just to call the .JS?

    Yes, that's how you do it.

    Add your command shell via SCFG, assign it a name and an internal code, then create a Baja stub that will call your JS. Name the Baja file after your shell's internal code (if you used the internal code "SHELL" then your Baja file should be "SHELL.SRC".) Your Baja stub need only contain one line to call the JS shell, so if your shell JS is shell.js, your Baja would be 'exec "?shell"'.

    ec

    ---
    þ Synchronet þ electronic chicken bbs - bbs.electronicchicken.com
  • From esc@VERT/MONTEREY to art on Wed Nov 18 20:45:51 2009
    Re: .JS as a Command Shell
    By: art to All on Wed Nov 18 2009 01:43 pm

    Hi guys,

    I must have missed something because I don't seem to see it in the documentation or past messages: how would one go about setting a .JS file as command shell?

    I have it on my board set up that way...however, my custom command shell is the only one to be used. .JS files handle everything from login to the menus to launching doors to logoff...there are no .bin files used. I just don't give the board the chance to use a .bin file, I handle everything from the get-go in .js. To take a look check out montereybbs.com.

    esc(montereybbs/demonic/mimic)

    ---
    þ Synchronet þ :: montereybbs.com ::
  • From Nightfox@VERT/DIGDIST to art on Wed Nov 18 20:24:45 2009
    Re: .JS as a Command Shell
    By: art to All on Wed Nov 18 2009 13:43:09

    I must have missed something because I don't seem to see it in the documentation or past messages: how would one go about setting a .JS file command shell?

    Does this involve making a BAJA "shell" just to call the .JS?

    Yep, that's the only way you can do it.. Create a Baja script that just calls your .js script and set up the Baja script as a command shell in SCFG.

    Nightfox

    ---
    þ Synchronet þ Digital Distortion BBS: digdist.bbsindex.com
  • From art@VERT/FATCATS to esc on Thu Nov 19 08:34:06 2009
    Re: .JS as a Command Shell
    By: esc to art on Wed Nov 18 2009 20:45:51

    I have it on my board set up that way...however, my custom command shell is only one to be used. .JS files handle everything from login to the menus to launching doors to logoff...there are no .bin files used. I just don't give the board the chance to use a .bin file, I handle everything from the get-go

    Thanks E. Chicken, that's sage advice and I was considering porting my entire login.src to .js to that effect... glad to know I was kind of on the right track...

    .js. To take a look check out montereybbs.com.

    I will take a look-see when I get a chance!

    Kind regs,
    Art at fatcats dot poorcoding dot com

    | fatcats bbs |
    | + telnet://fatcats.poorcoding.com |
    | + ssh://fatcats.poorcoding.com:2322 |

    ---
    þ Synchronet þ fatcats bbs - http://fatcats.poorcoding.com
  • From Tracker1@VERT/TRN to Nightfox on Thu Nov 19 13:39:46 2009
    On 11/17/2009 7:50 PM, Nightfox wrote:
    I must have missed something because I don't seem to see it in the documentation or past messages: how would one go about setting a .JS file
    command shell?

    Does this involve making a BAJA "shell" just to call the .JS?

    Yep, that's the only way you can do it.. Create a Baja script that just calls
    your .js script and set up the Baja script as a command shell in SCFG.

    In S3, I have the baja in a loop with a pause prompt after exit, because you need to exit out of the JS if you want to support changing shells.

    --
    Michael J. Ryan - http://tracker1.info/

    ... FRA #103: Sleep can interfere with profit. <i>(DS9 season 2, episode 7 - "Rules of Acquisition")</i>

    ---
    þ Synchronet þ Roughneck BBS - telnet://roughneckbbs.com - www.roughneckbbs.com
  • From Nightfox@VERT/DIGDIST to Tracker1 on Thu Nov 19 14:14:21 2009
    Re: Re: .JS as a Command Shell
    By: Tracker1 to Nightfox on Thu Nov 19 2009 13:39:46

    In S3, I have the baja in a loop with a pause prompt after exit, because need to exit out of the JS if you want to support changing shells.

    There's an alternate way to handle that, as recommended by Digital Man. In your .js shell, you can check for whether the user changed their shell and exit if so, as follows:

    user.cached = false;
    var oldShell = user.command_shell;
    bbs.user_config();
    user.cached = false;
    bbs.user_sync();
    if (user.command_shell != oldShell)
    exit(0);

    That's how I'm doing it in my .js shell, and the only thing I do in my Baja is simply run my .js script, and it is able to support changing shells.

    Nightfox

    ---
    þ Synchronet þ Digital Distortion BBS: digdist.bbsindex.com
  • From Tracker1@VERT/TRN to Nightfox on Sat Nov 21 11:19:14 2009
    On 11/19/2009 3:14 PM, Nightfox wrote:
    In S3, I have the baja in a loop with a pause prompt after exit, because
    need to exit out of the JS if you want to support changing shells.

    There's an alternate way to handle that, as recommended by Digital Man. In your .js shell, you can check for whether the user changed their shell and exit
    if so, as follows:

    user.cached = false;
    var oldShell = user.command_shell;
    bbs.user_config();
    user.cached = false;
    bbs.user_sync();
    if (user.command_shell != oldShell)
    exit(0);

    Cool, I have something similar to jump out, without a cold exit.

    That's how I'm doing it in my .js shell, and the only thing I do in my Baja is
    simply run my .js script, and it is able to support changing shells.

    well, mine has the added ability to CTRL-C out of the script, and make changes, hit enter and in the updated version. ;) This was really helpful when I was actively working on it.

    --
    Michael J. Ryan - http://tracker1.info/

    ---
    þ Synchronet þ Roughneck BBS - telnet://roughneckbbs.com - www.roughneckbbs.com