• Help (again

    From Glucose Grin@VERT to All on Mon Nov 1 13:44:46 2004
    Hi there.

    I've forgotten how to write a login script in js :( I know I had one that worked (at least I think I did), but it didn't look like this....

    load("sbbsdefs.js");
    var uname, LoggedIn;
    bbs.logout();
    node_action = NODE_LOGON;
    while (bbs.online && (!LoggedIn)) {
    printf("\r\n\1nEnter Name, Number, '\1hNew\1n', or '\1hGuest\1n'\r\nNN...: ");
    uname=console.getstr("",25,K_LOWPRIO+K_E71DETECT+K_TAB+K_UPRLWR);
    truncsp(uname);
    if (uname=="")
    {
    printf("Blank");
    bbs.hangup;
    }
    if (uname=="New")
    {
    printf("New");
    bbs.newuser;
    bbs.logon;
    }
    if (bbs.login(uname,"PW: "))
    {
    printf (user.name+" login complete?!?");
    if (bbs.logon)
    {
    printf (user.name+" logon executed");
    if (user.name == "") {LoggedIn=false};
    if (!LoggedIn){printf("\r\nLog on procedure Failed for unknown reasons.\r\n")};
    }
    }
    }

    What happens is that it runs thru, the user.name remains blank after
    bbs.logon is executed, even tho bbs.login and bbs.logon are both successful.

    if I don't loop with the LoggedIn variable, sbbs drops to an error (user not logged in) to the console, and 11/1 02:45:20p Node 1 !ERROR 13 (WinError 158) in answer.cpp line 281 checking "User not logged on" access=0
    in the log.

    Any ideas as to what I'm doing wrong?

    Also, the newer DOVE-Net areas (like this one) arn't on my system. a little off-topic, but is there an easy way to add these?

    Thanks.

    Glucose Grin


    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Angus Mcleod@VERT/ANJO to Glucose Grin on Mon Nov 1 20:12:00 2004
    Re: Help (again
    By: Glucose Grin to All on Mon Nov 01 2004 13:44:00

    Not related to your problem, but I think that this line:

    printf("\r\n\1nEnter Name, Number, '\1hNew\1n', or
    '\1hGuest\1n'\r\nNN...: ");

    will break login scripts that look for "NN:" and not "NN...:"



    ---
    þ Synchronet þ Making sure Jason works OK at The ANJO BBS
  • From Digital Man@VERT to Glucose Grin on Mon Nov 1 16:49:08 2004
    Re: Help (again
    By: Glucose Grin to All on Mon Nov 01 2004 01:44 pm

    Hi there.

    I've forgotten how to write a login script in js :( I know I had one that worked (at least I think I did), but it didn't look like this....

    load("sbbsdefs.js");
    var uname, LoggedIn;
    bbs.logout();
    node_action = NODE_LOGON;
    while (bbs.online && (!LoggedIn)) {
    printf("\r\n\1nEnter Name, Number, '\1hNew\1n', or '\1hGuest\1n'\r\nNN...: ");
    uname=console.getstr("",25,K_LOWPRIO+K_E71DETECT+K_TAB+K_UPRLWR);
    truncsp(uname);
    if (uname=="")
    {
    printf("Blank");
    bbs.hangup;

    The correct way to call a JavaScript function is with () after the function name. Example: bbs.hangup();

    if (uname=="New")
    {
    printf("New");
    bbs.newuser;
    bbs.logon;

    Same problem here.

    }
    if (bbs.login(uname,"PW: "))
    {
    printf (user.name+" login complete?!?");
    if (bbs.logon)

    And here.

    {
    printf (user.name+" logon executed");
    if (user.name == "") {LoggedIn=false};
    if (!LoggedIn){printf("\r\nLog on procedure Failed fo unknown reasons.\r\n")};
    }
    }
    }

    What happens is that it runs thru, the user.name remains blank after bbs.logon is executed, even tho bbs.login and bbs.logon are both successful.

    You're not actually *calling* these functions, so I would expect all kinds of things to go wrong.

    Any ideas as to what I'm doing wrong?

    Yeah, you're missing the () :-)

    Also, the newer DOVE-Net areas (like this one) arn't on my system. a little off-topic, but is there an easy way to add these?

    http://synchro.net/docs/dove-net.txt

    digital man

    Snapple "Real Fact" #104:
    There are more then 30,000 diets on public record.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Glucose Grin@VERT to Digital Man on Mon Nov 1 17:06:38 2004

    Yeah, you're missing the () :-)

    Hahah... Okay. Yea. I remember now. I don't do much programming :)

    Thanks tho. I guess I should go read a book, eh?

    Glucose Grin


    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Glucose Grin@VERT to Angus Mcleod on Mon Nov 1 17:08:53 2004

    Not related to your problem, but I think that this line:
    will break login scripts that look for "NN:" and not "NN...:"

    You're right, I was just adding dots when I was first writing, to differentiate between the stock script and my own when I first connect. By the time I'm done (if I'm ever done) things should be okay :)

    Glucose Grin


    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Tracker1@VERT/TRN to Glucose Grin on Mon Nov 1 19:26:00 2004
    Glucose Grin wrote:
    I've forgotten how to write a login script in js :( I know I had one that worked (at least I think I did), but it didn't look like this....
    --snip-- <
    if (bbs.login(uname,"PW: "))
    {
    printf (user.name+" login complete?!?");
    if (bbs.logon)
    --snip-- <
    What happens is that it runs thru, the user.name remains blank after bbs.logon is executed, even tho bbs.login and bbs.logon are both successful.

    bbs.logon()
    is a function, not a parameter...

    After bbs.logon() you should exit out of the script, technically, anything after it will run between the LOGON event, and the COMMAND SHELL running.

    --
    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
  • From Tracker1@VERT/TRN to Glucose Grin on Mon Nov 1 19:29:00 2004
    Glucose Grin wrote:
    Yeah, you're missing the () :-)

    Hahah... Okay. Yea. I remember now. I don't do much programming :)

    Thanks tho. I guess I should go read a book, eh?

    For heavy handholding, "JavaScript for Dummies" isn't bad, I would suggest "JavaScript Bible" by Danny Goodman 3rd or 4th edition (NOT GOLD), as the
    intro sections are very thorough, and should get you going..

    The concepts are the same for the bbs and the web for the most part,
    even though the event model is quite a bit different.

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

    Rules of Acquisition #211:
    Employees are the rungs on the ladder of success... don't hesitate to step
    on them.

    ---
    þ Synchronet þ theroughnecks.net - you know you want it
  • From Angus Mcleod@VERT/ANJO to Glucose Grin on Mon Nov 1 22:57:00 2004
    Re: Help (again
    By: Glucose Grin to Digital Man on Mon Nov 01 2004 17:06:00

    Yeah, you're missing the () :-)

    Hahah... Okay. Yea. I remember now. I don't do much programming :)

    Thanks tho. I guess I should go read a book, eh?

    For heaven sake, don't do THAT! Manuals are for WHIMPS!

    :)


    ---
    þ Synchronet þ Making sure Jason works OK at The ANJO BBS
  • From Glucose Grin@VERT to Tracker1 on Mon Nov 1 20:54:08 2004

    For heavy handholding, "JavaScript for Dummies" isn't bad, I would suggest "JavaScript Bible" by Danny Goodman 3rd or 4th edition (NOT GOLD), as the intro sections are very thorough, and should get you going..

    I should check one of those out. All the programming I've done has been apple][ basic, then turbo pascal 7 for dos. And I spent way too much time learning hardware tricks that are now useless, instead of actual sound programming :)

    But Javascript is good to get started again, and text mode is
    familiar, so I guess I'll fake my way thru some more.

    Thanks again for the help :)

    Glucose Grin


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