Subj : Re: .JS as a Command Shell
To : Nightfox
From : Tracker1
Date : Sat Nov 21 2009 11:19 am
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