• Help with a JavaScript game

    From Zarakava to All on Sun Aug 14 17:21:14 2011
    Hello! I don't know if this'll get answered for a while, but no huge deal.

    I'm working on programming a javascript/bbs door game, and it's going great up to one point.

    With the console.inkey() command, no matter what the timeout, it always does a console.pause() afterwards.
    console.getkey() works fine, but I would really prefer to have it timeout, as I'm having a loop check some conditions every second. Is there a way to get read of that console.pause() after the inkey?
  • From Nightfox@DIGDIST to Zarakava on Sun Aug 14 22:37:25 2011
    Re: Help with a JavaScript game
    By: Zarakava to All on Sun Aug 14 2011 17:21:14

    With the console.inkey() command, no matter what the timeout, it always does console.pause() afterwards.
    console.getkey() works fine, but I would really prefer to have it timeout, a I'm having a loop check some conditions every second. Is there a way to get read of that console.pause() after the inkey?

    Looking at sbbsdefs.js, I see the following mode setting:
    K_NOCRLF=(1<<9);/* Don't print CRLF after string input */

    Have you tried specifying K_NOCRLF for the mode parameter of console.inkey()? I haven't tried that myself, but it sounds like that may do what you want..

    Nightfox

    ---
    ■ Synchronet ■ Digital Distortion BBS - digdist.bbsindex.com
  • From Nightfox@DIGDIST to Zarakava on Sun Aug 14 22:42:15 2011
    Re: Help with a JavaScript game
    By: Zarakava to All on Sun Aug 14 2011 17:21:14

    With the console.inkey() command, no matter what the timeout, it always does console.pause() afterwards.
    console.getkey() works fine, but I would really prefer to have it timeout, a I'm having a loop check some conditions every second. Is there a way to get read of that console.pause() after the inkey?

    I think I read your email too quickly before I replied last time.. The mode setting I found turns off printing a CR/LF at the end.

    Is it always outputting a pause for you, or does it only do it at the end of a screenful of text, for instance?

    Looking through sbbsdefs.js, I also see these modes that can be used for bbs.sys_status:
    var SS_PAUSEOFF=(1<<18);/* Pause off, overriding user default*/
    And for use with user.settings:
    var USER_PAUSE=(1<<4);/* Pause on every screen full*/
    And for putmsg and printfile:
    var P_NOPAUSE=(1<<4);/* Disable screen pause*/

    If it's a screenful pause you're seeing, perhaps you can temporarily set one of those modes to get around the issue.

    But I don't know for sure..

    Nightfox

    ---
    ■ Synchronet ■ Digital Distortion BBS - digdist.bbsindex.com
  • From Digital Man to Zarakava on Mon Aug 15 18:35:41 2011
    Re: Help with a JavaScript game
    By: Zarakava to All on Sun Aug 14 2011 05:21 pm

    Hello! I don't know if this'll get answered for a while, but no huge deal.

    I'm working on programming a javascript/bbs door game, and it's going great up to one point.

    With the console.inkey() command, no matter what the timeout, it always
    does a console.pause() afterwards.

    console.inkey() should not cause a pause prompt.

    console.getkey() works fine, but I would really prefer to have it timeout, as I'm having a loop check some conditions every second. Is there a way to get read of that console.pause() after the inkey?

    I think the first thing is to find out what's causing the pause. Are displaying something in this loop? You can always clear the line counter, but I think it's good idea to find out what is incrementing the line counter in the first place (and it's not inkey()).


    digital man

    Synchronet "Real Fact" #78:
    172 Synchronet Match Maker registrations were sold (@$69) between 1995 and 1996.
  • From Digital Man to Nightfox on Mon Aug 15 18:36:10 2011
    Re: Help with a JavaScript game
    By: Nightfox to Zarakava on Sun Aug 14 2011 10:37 pm

    Re: Help with a JavaScript game
    By: Zarakava to All on Sun Aug 14 2011 17:21:14

    With the console.inkey() command, no matter what the timeout, it always does console.pause() afterwards.
    console.getkey() works fine, but I would really prefer to have it timeout, a I'm having a loop check some conditions every second. Is
    there a way to get read of that console.pause() after the inkey?

    Looking at sbbsdefs.js, I see the following mode setting:
    K_NOCRLF=(1<<9);/* Don't print CRLF after string input */

    Have you tried specifying K_NOCRLF for the mode parameter of console.inkey()? I haven't tried that myself, but it sounds like that may
    do what you want..

    Display console.inkey() doesn't display anything, that mode flag would no effect.

    digital man

    Synchronet "Real Fact" #63:
    Synchronet PCMS (introduced w/v2.0) is Programmable Command and Menu Structure.
  • From Nightfox@DIGDIST to Digital Man on Mon Aug 15 20:22:08 2011
    Re: Help with a JavaScript game
    By: Digital Man to Nightfox on Mon Aug 15 2011 18:36:10

    K_NOCRLF=(1<<9);/* Don't print CRLF after string input */

    Display console.inkey() doesn't display anything, that mode flag would no effect.

    Ah, I see.

    Nightfox

    ---
    ■ Synchronet ■ Digital Distortion BBS - digdist.bbsindex.com
  • From Zarakava to Digital Man on Sun Aug 21 15:59:06 2011
    I hadn't actually checked this in a bit, but the previous error was fixed by a suggestion from echicken

    console.line_counter=0;

    New problem.

    file.iniRemoveSection(1);

    Is not working. Gives the error c:\sbbs\exec\timedEvents.js line 67:
    TypeError: file.iniRemoveSection is not a function.

    File is Defined, as I used file.iniSetObject just a line before. Any advice?
  • From Zarakava to Zarakava on Sun Aug 21 16:45:25 2011
    I hadn't actually checked this in a bit, but the previous error was fixed
    by a suggestion from echicken

    console.line_counter=0;

    New problem.

    file.iniRemoveSection(1);

    Is not working. Gives the error c:\sbbs\exec\timedEvents.js line 67: TypeError: file.iniRemoveSection is not a function.

    File is Defined, as I used file.iniSetObject just a line before. Any
    advice?
    Ignore this, I was using 3.13...