• .js command shells

    From Glucose Grin@VERT to All on Mon Aug 9 06:31:22 2004
    Hey kids.

    I'm trying to write a login matrix command shell in java, but I'm running into some stupid problems (ie. I'm stupid :) )
    javascript is new to me (I program in pascal) so I've fudged a loop to keep the command input going (while (1) {}).
    However, I need to be able to test for the user disconnecting so I don't pooch my bbs.

    What is going on is this - I display my base ansi, then have an input loop where the cursor keys change the current menu command. Since the commands don't do anything yet, I have to disconnect my client when I'm done testing. Problem is, when my client disconnects, cpu usage spikes and I
    can't shutdown the node or sbbsctrl.

    I'm guessing my crappy script is just looping in the background, unaware that there is no longer a client attached. How do I fix that?

    THanks!

    Glucose Grin


    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Digital Man@VERT to Glucose Grin on Mon Aug 9 07:28:16 2004
    Re: .js command shells
    By: Glucose Grin to All on Sun Aug 08 2004 11:31 pm

    I'm trying to write a login matrix command shell in java, but I'm running into some stupid problems (ie. I'm stupid :) )
    javascript is new to me (I program in pascal) so I've fudged a loop t keep the command input going (while (1) {}).
    However, I need to be able to test for the user disconnecting so I don't pooch my bbs.

    What is going on is this - I display my base ansi, then have an input loop where the cursor keys change the current menu command. Since the commands don't do anything yet, I have to disconnect my client when I'm done testing. Problem is, when my client disconnects, cpu usage spikes and I can't shutdown the node or sbbsctrl.

    I'm guessing my crappy script is just looping in the background, unaware that there is no longer a client attached. How do I fix that?

    Change your loop to:

    while(bbs.online) {
    }

    digital man

    Snapple "Real Fact" #110:
    Frogs never drink.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Glucose Grin@VERT to Digital Man on Mon Aug 9 07:38:47 2004

    while(bbs.online) { }

    I figgured it out now :) thank you. I did try that earlier, but I had while(bbs.online = 2), which I guess is assignment and not boolean, so I screw'd up. Or maybe I just did it wrong.

    It seems to be working now... and I have to say, THis javascript is much easier and more powerful than baja (altho as a BBS scripting language, baja is pretty good)

    Ahhweeeellll.. Thanks again.

    Glucose Grin


    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Digital Man@VERT to Glucose Grin on Mon Aug 9 07:54:24 2004
    Re: .js command shells
    By: Glucose Grin to Digital Man on Mon Aug 09 2004 12:38 am

    while(bbs.online) { }

    I figgured it out now :) thank you. I did try that earlier, but I had while(bbs.online = 2), which I guess is assignment and not boolean, so I screw'd up. Or maybe I just did it wrong.

    Yes, a single equals is assignment, not testing.

    It seems to be working now... and I have to say, THis javascript is much easier and more powerful than baja (altho as a BBS scripting language, baja is pretty good)

    Ahhweeeellll.. Thanks again.

    No problem.

    digital man

    Snapple "Real Fact" #138:
    Hawaii is the only U.S. state that grows coffee.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Tracker1@VERT/TRN to Glucose Grin on Tue Aug 10 08:52:00 2004
    Glucose Grin wrote:
    I'm trying to write a login matrix command shell in java, but I'm running into some stupid problems (ie. I'm stupid :) )
    javascript is new to me (I program in pascal) so I've fudged a loop to
    keep the command input going (while (1) {}).
    However, I need to be able to test for the user disconnecting so I don't pooch my bbs.

    var done = false;
    while (bbs.online && !done) {
    ...
    }

    What is going on is this - I display my base ansi, then have an input
    loop where the cursor keys change the current menu command. Since the commands don't do anything yet, I have to disconnect my client when I'm
    done testing. Problem is, when my client disconnects, cpu usage spikes
    and I can't shutdown the node or sbbsctrl.

    See above, and check out the assault base pack from http://www.vanguardmoddingcrew.com/

    --
    Michael J. Ryan - tracker1(at)theroughnecks(dot)net - www.theroughnecks.net icq: 4935386 - AIM/AOL: azTracker1 - Y!: azTracker1 - MSN/Win: (email)

    ---
    þ Synchronet þ theroughnecks.net - you know you want it