printf("\r\n\1nEnter Name, Number, '\1hNew\1n', or
'\1hGuest\1n'\r\nNN...: ");
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 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.
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?
Yeah, you're missing the () :-)
Not related to your problem, but I think that this line:
will break login scripts that look for "NN:" and not "NN...:"
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.
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?
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..
Sysop: | Ree |
---|---|
Location: | Toronto, ON |
Users: | 2 |
Nodes: | 10 (0 / 10) |
Uptime: | 115:57:10 |
Calls: | 375 |
Calls today: | 2 |
Files: | 2 |
Messages: | 38,886 |