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?
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 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?
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
.js. To take a look check out montereybbs.com.
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 need to exit out of the JS if you want to support changing shells.
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.
Sysop: | Ree |
---|---|
Location: | Toronto, ON |
Users: | 2 |
Nodes: | 10 (0 / 10) |
Uptime: | 116:06:40 |
Calls: | 375 |
Calls today: | 2 |
Files: | 2 |
Messages: | 38,888 |