-
Working on new command shell in javascript
From
nolageek@VERT/CAPSHRIL to
All on Sun Mar 20 01:51:34 2016
Hey there!ããI'm working on converting my command shell from Baja to JavaScript and I'mãrunning into a few bugs that I can't figure out. I'm running the command shellãto test it, so if I make any changes I have to switch to another command shellãand then back to the one I'm testing .. no problem, I've done that when I'veãdone my last few shells. HOWEVER, the problem I'm seeing is that when I switchãfrom my new shell to one of the others it the one I switch to appears in myãdefaults and if I use 'console.putmsg(user.command_shell) it says my currentãshell is the one I switched to but the BBS is still using my new one. Theãcommands are all the new shell.ããIn fact, my new shell uses user.command_shell in the paths to the menus andãit'll say c:\sbbs\text\menu\*oldshell*\main.asc is not found for some items... ããI figure it has to be something about the way I'm calling the defaults menu...ãHonestly I know just enought JavaScript to be dangerous. :) Here is myã'systemMenu' function.... any suggestions?ãããfunction systemMenu() {ã while (bbs.online) {ã bbs.node_action = 'NODE_DFLT';ã console.clear();ã bbs.menu(user.command_shell + '/system');ã console.putmsg(' \1h\1m ' + user.alias + '\1k@\1bSystem Menu\1w:\1n\1wã');ãã var key = console.getkey(K_NOECHO).toUpperCase();ã bbs.log_key(key);ã switch (key) {ã //options and commands to performã case 'S':ã console.clear();ã bbs.sys_info();ã break;ã case 'U':ã console.clear();ã bbs.list_users();ã console.line_counter = 1;ã break;ã case 'W':ã bbs.menu(user.command_shell + '/nodeltop');ã break;ã case 'L':ã showLastCallers(10);ã break;ã case 'D':ã bbs.user_config();ã break;ã // for /Dã case '/':ã console.putmsg('/');ã slashMenu(console.getkey().toUpperCase());ã break;ã case ':':ã console.putmsg(':');ã colonMenu(console.getstr('', 4).toUpperCase());ã break;ã case 'Y':ã console.clear();ã bbs.user_info();ã break;ã case 'I':ã console.clear();ã bbs.ver();ã break;ã case 'M':ã console.clear();ã bbs.sub_info();ã break;ã case 'Q':ã mainMenu();ã return;ã default:ã return;ã } // end switchã } // while onlineã //hangUp();ã} // end systemããããAny help would be much appreciated!ãã|01-|03nolageekãã---ã þ Synchronet þ Capitol Shrill BBS - Washington, DC - capitolshrill.comã
-
From
Digital Man@VERT to
nolageek on Sun Mar 20 16:45:47 2016
Re: Working on new command shell in javascriptã By: nolageek to All on Sun Mar 20 2016 01:51 amãã > Hey there!ã >ã > I'm working on converting my command shell from Baja to JavaScript and I'mã > running into a few bugs that I can't figure out. I'm running the commandã > shell to test it, so if I make any changes I have to switch to anotherã > command shell and then back to the one I'm testing .. no problem,ããOr you could log-off and back on. That'd probably be easier.ãã > I've doneã > that when I've done my last few shells. HOWEVER, the problem I'm seeing isã > that when I switch from my new shell to one of the others it the one Iã > switch to appears in my defaults and if I useã > 'console.putmsg(user.command_shell) it says my current shell is the one Iã > switched to but the BBS is still using my new one. The commands are all theã > new shell.ããLook at lbshell.js or classic_shell.js for working example of a JS shell thatãallows switching the current shell back to a Baja shell (and back again). Thatãmight help ya.ãã digital manããSynchronet "Real Fact" #56:ãSynchronet introduced Telnet, FTP, SMTP and POP3 support w/v3.00a-Win32 in 2000.ãNorco, CA WX: 74.1øF, 47.0% humidity, 9 mph SSE wind, 0.00 inches rain/24hrsã---ã þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.netã
-
From
nolageek@VERT/CAPSHRIL to
Digital Man on Mon Mar 21 01:29:54 2016
Re: Working on new command shell in javascriptã By: Digital Man to nolageek on Sun Mar 20 2016 04:45 pmãã DM> Look at lbshell.js or classic_shell.js for working example of a JS shellã DM> that allows switching the current shell back to a Baja shell (and backããDeuce pointed me in the right direction on IRC - I wasn't exiting the shell inãthe case of the shell changing.ããI added this to the top of the file:ããvar thisShell = user.command_shell;ãããThen in both main.Menu() and systemMenu() I added:ããif (thisShell.toUpperCase() != user.command_shell) {ãreturn;ã}ããThose are the only two menus that contain an option for 'defaults' so if theãuser changes their shell it will exit the new one when they go back to whereãthey came from. This mimics the behaviour I see in other shells.ãã|01-|03nolageekãã---ã þ Synchronet þ Capitol Shrill BBS - Washington, DC - capitolshrill.comã
-
From
tracker1@VERT/TRNTEST to
nolageek on Sat Mar 26 14:02:05 2016
case 'S':ã > console.clear();ã > bbs.sys_info();ã > break;ããCheck your shell before and after, if it's changed, exit the entire script,ãand the new shell will take hold...ãã-- ãMichael J. Ryan ãtracker1(at)gmail.com ã+o Roughneck BBSãã---ã þ Synchronet þ RoughneckBBS - http://www.roughneckbbs.com/ã