• More dumb questions

    From Mortifis@VERT/ALLEYCAT to All on Fri Jul 19 11:18:34 2019
    When scripting a commandline utility, console.clear() and other console.*ãfunctions are 'undefined' Is there a load(*.js) I need to call at the start ofãthe script to has access to those functions or are they hard coded in sbbs?ããããMy teachers always said "You can't make a living looking out a window!", theyãwere wrong, I drive truck :-Pãã---ã þ Synchronet þ AlleyCat! BBS - http://alleycat.synchro.net:81ã
  • From Mortifis@VERT/ALLEYCAT to All on Fri Jul 19 11:48:19 2019
    When scripting a commandline utility, console.clear() and other console.*ã > functions are 'undefined' Is there a load(*.js) I need to call at the startã > of the script to has access to those functions or are they hard coded inã > sbbs?ããnevermind, I see that there is a conio.clrscr() and should be used withãconio.suspend(); to return conio for output/input from local onsole, duh!ããããããMy teachers always said "You can't make a living looking out a window!", theyãwere wrong, I drive truck :-Pãã---ã þ Synchronet þ AlleyCat! BBS - http://alleycat.synchro.net:81ã
  • From echicken@VERT/ECBBS to Mortifis on Fri Jul 19 11:16:58 2019
    Re: More dumb questionsã By: Mortifis to All on Fri Jul 19 2019 11:18:34ãã Mo> When scripting a commandline utility, console.clear() and other console.*ã Mo> functions are 'undefined' Is there a load(*.js) I need to call at theã Mo> start of the script to has access to those functions or are they hardã Mo> coded in sbbs? ãã'console' only exists in scripts running in the 'bbs' context, ie. under a telnet/rlogin/ssh session. ãIts methods are strictly for interacting with a remote terminal and they aren't relevant under jsexec,ãthe webserver, or other places where Synchronet runs JS.ããThere are ways to deal with running scripts either under jsexec or in a BBS session (you seemed to haveãthe idea of doing 'if (js.global.console)'). Sometimes it's just easier to pick one or the other. Thisãscript in particular (generating a report about dupe users) seems like a utility I'd just want to runãunder jsexec and I wouldn't need to run during an ssh session.ãã---ãechickenãelectronic chicken bbs - bbs.electronicchicken.comã þ Synchronet þ electronic chicken bbs - bbs.electronicchicken.comã
  • From Mortifis@VERT/ALLEYCAT to echicken on Fri Jul 19 13:08:27 2019
    Re: More dumb questionsã > By: Mortifis to All on Fri Jul 19 2019 11:18:34ãã > Mo> When scripting a commandline utility, console.clear() and otherã > Mo> console.* functions are 'undefined' Is there a load(*.js) I need toã > Mo> call at the start of the script to has access to those functions or areã > Mo> they hard coded in sbbs? ãã > 'console' only exists in scripts running in the 'bbs' context, ie. under aã > telnet/rlogin/ssh session. ã > Its methods are strictly for interacting with a remote terminal and theyã > aren't relevant under jsexec,ã > the webserver, or other places where Synchronet runs JS.ãã > There are ways to deal with running scripts either under jsexec or in a BBSã > session (you seemed to haveã > the idea of doing 'if (js.global.console)').ãã Ya, I see that now, I found conio.clrscr; and conio.suspend which does what Iãneeded. ãã > Sometimes it's just easier toã > pick one or the other. Thisã > script in particular (generating a report about dupe users) seems like aã > utility I'd just want to runã > under jsexec and I wouldn't need to run during an ssh session.ãã ã I was following the premise under mailall.js LOL but, with your help, I amãslowly seeing the error or my ways :-)ããThe script has already grown beyond an FYI script and is has menu optionsããThanks, ECããããMy teachers always said "You can't make a living looking out a window!", theyãwere wrong, I drive truck :-Pãã---ã þ Synchronet þ AlleyCat! BBS - http://alleycat.synchro.net:81ã
  • From Mortifis@VERT/ALLEYCAT to echicken on Fri Jul 19 14:00:37 2019
    Re: More dumb questionsã > By: Mortifis to All on Fri Jul 19 2019 11:18:34ãã ãAnd yet another one, so when I say 'console' I am referring to running viaãjsexec in a terminal and optput is stdout ... how does one change font colorsãand the background color of an input ( readln() ) prompt?ããI'll owe you a case of beer after this ... :)ããããMy teachers always said "You can't make a living looking out a window!", theyãwere wrong, I drive truck :-Pãã---ã þ Synchronet þ AlleyCat! BBS - http://alleycat.synchro.net:81ã
  • From echicken@VERT/ECBBS to Mortifis on Fri Jul 19 15:04:15 2019
    Re: Re: More dumb questionsã By: Mortifis to echicken on Fri Jul 19 2019 14:00:37ãã Mo> And yet another one, so when I say 'console' I am referring to running viaã Mo> jsexec in a terminal and optput is stdout ... how does one change fontã Mo> colors and the background color of an input ( readln() ) prompt?ããI don't think any of the basic output methods have any provisions for doing magic colour stuff, so you'dãprobably have to send escape sequences yourself. It's possible that we have some JS libraries that mightãhelp with that, but I'd have to look (and it's more likely that they rely on stuff that the consoleãobject already does).ãã---ãechickenãelectronic chicken bbs - bbs.electronicchicken.comã þ Synchronet þ electronic chicken bbs - bbs.electronicchicken.comã
  • From Mortifis@VERT/ALLEYCAT to echicken on Fri Jul 19 16:33:27 2019
    Re: Re: More dumb questionsã > By: Mortifis to echicken on Fri Jul 19 2019 14:00:37ãã > Mo> And yet another one, so when I say 'console' I am referring to runningã > Mo> via jsexec in a terminal and optput is stdout ... how does one changeã > Mo> font colors and the background color of an input ( readln() ) prompt?ãã > I don't think any of the basic output methods have any provisions for doingã > magic colour stuff, so you'dã > probably have to send escape sequences yourself. It's possible that we haveã > some JS libraries that mightã > help with that, but I'd have to look (and it's more likely that they rely onã > stuff that the consoleã > object already does).ããI see conio.textcolor and conio.textbackground but I am unsure how to use itã... I tried conio.textcolor=3 but it displays jibberish and completely hosesãthe outputããããMy teachers always said "You can't make a living looking out a window!", theyãwere wrong, I drive truck :-Pãã---ã þ Synchronet þ AlleyCat! BBS - http://alleycat.synchro.net:81ã
  • From Digital Man@VERT to Mortifis on Fri Jul 19 12:54:27 2019
    Re: Re: More dumb questionsã By: Mortifis to echicken on Fri Jul 19 2019 04:33 pmãã > > Re: Re: More dumb questionsã > > By: Mortifis to echicken on Fri Jul 19 2019 14:00:37ã >ã > > Mo> And yet another one, so when I say 'console' I am referring toã > > Mo> running via jsexec in a terminal and optput is stdout ... how doesã > > Mo> one change font colors and the background color of an input (ã > > Mo> readln() ) prompt?ã >ã > > I don't think any of the basic output methods have any provisions forã > > doing magic colour stuff, so you'dã > > probably have to send escape sequences yourself. It's possible that weã > > have some JS libraries that mightã > > help with that, but I'd have to look (and it's more likely that they relyã > > on stuff that the consoleã > > object already does).ã >ã > I see conio.textcolor and conio.textbackground but I am unsure how to use itã > ... I tried conio.textcolor=3 but it displays jibberish and completely hosesã > the outputããThe conio stuff is *not* stdio. I would just stick to the basic write/writeln functions for a jsexec utility. See the other utility-like JS scripts for examples.ãã digital manããSynchronet/BBS Terminology Definition #47:ãMUD = Multi-User DungeonãNorco, CA WX: 80.8øF, 52.0% humidity, 6 mph E wind, 0.00 inches rain/24hrsã---ã þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.netã
  • From echicken@VERT/ECBBS to Mortifis on Fri Jul 19 15:58:51 2019
    Re: Re: More dumb questionsã By: Mortifis to echicken on Fri Jul 19 2019 16:33:27ãã Mo> I see conio.textcolor and conio.textbackground but I am unsure how to useã Mo> it ... I tried conio.textcolor=3 but it displays jibberish and completelyã Mo> hoses the outputããI completely forgot that thing existed. Can't remember ever using it, though.ããI would imagine that if you want to use it for i/o, you should use its methods and no others.ããI just whipped up this quick test and it seemed to do what I expected:ããconio.init();ãconio.clrscr();ãconio.textcolor = 14;ãconio.cputs('hihi');ãconio.getch();ãã---ãechickenãelectronic chicken bbs - bbs.electronicchicken.comã þ Synchronet þ electronic chicken bbs - bbs.electronicchicken.comã
  • From Mortifis@VERT/ALLEYCAT to echicken on Fri Jul 19 17:42:27 2019
    Re: Re: More dumb questionsã > By: Mortifis to echicken on Fri Jul 19 2019 16:33:27ãã > Mo> I see conio.textcolor and conio.textbackground but I am unsure how toã > Mo> use it ... I tried conio.textcolor=3 but it displays jibberish andã > Mo> completely hoses the outputãã > I completely forgot that thing existed. Can't remember ever using it,ã > though.ãã > I would imagine that if you want to use it for i/o, you should use itsã > methods and no others.ãã > I just whipped up this quick test and it seemed to do what I expected:ãã > conio.init();ã > conio.clrscr();ã > conio.textcolor = 14;ã > conio.cputs('hihi');ã > conio.getch();ããthat hoses the stdout the same, oh well, colors are, technically, unnecessary,ãthank you, might be a Windows thing.ããI have a basic script dup_user_checker.js that takes argv's and allows userãediting ... would it be possible to upload (or have it uploaded) to the cvs /ãexec/examples directory?ãããããMy teachers always said "You can't make a living looking out a window!", theyãwere wrong, I drive truck :-Pãã---ã þ Synchronet þ AlleyCat! BBS - http://alleycat.synchro.net:81ã