Synchronet v3.19b-Win32 (install) has been released (Jan-2022).

You can donate to the Synchronet project using PayPal.

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
custom:javascript [2019/07/26 16:32] – [Output] mention the limited @-code support in console.print() digital mancustom:javascript [2019/07/26 18:05] – [Output] Created Input and Prompt sections with beginning tables (need work) digital man
Line 134: Line 134:
 | ''alert()''     | Yes                    | Yes    | Yes          | Yes | Telnet-IAC, Ctrl-A | No                 | If user not online, same as ''log(LOG_WARNING, ...)'' | | ''alert()''     | Yes                    | Yes    | Yes          | Yes | Telnet-IAC, Ctrl-A | No                 | If user not online, same as ''log(LOG_WARNING, ...)'' |
 | ''log()''             | Yes              | Yes    | N/A          | N/A |                    | Yes((following the log-level argument)) | Displayed/logged on the server only | | ''log()''             | Yes              | Yes    | N/A          | N/A |                    | Yes((following the log-level argument)) | Displayed/logged on the server only |
-| ''console.print()''   | Yes              | No     | No           | Yes | Telnet-IAC, Ctrl-A, [[custom:atcodes|@-Codes]] | Yes | @-Codes only supported within''[[text.dat]]'' strings and mnemonics|+| ''console.print()''   | Yes              | No     | No           | Yes | Telnet-IAC, Ctrl-A | Yes | |
 | ''console.write()''   | Yes              | No     | No           | Yes | Telnet-IAC         | Yes | No line-counting/auto-pause | | ''console.write()''   | Yes              | No     | No           | Yes | Telnet-IAC         | Yes | No line-counting/auto-pause |
 | ''console.writeln()'' | Yes              | No     | Yes          | Yes | Telnet-IAC         | Yes | No line-counting/auto-pause | | ''console.writeln()'' | Yes              | No     | Yes          | Yes | Telnet-IAC         | Yes | No line-counting/auto-pause |
Line 146: Line 146:
 === Carriage Returns === === Carriage Returns ===
 If you wish to send a traditional "carriage return" character to the client terminal (i.e. move the cursor to the far left column without advancing to the next line) it is recommended that you use an output method/function that supports [[custom:Ctrl-A codes]] and you send the Ctrl-A ''[''  sequences //instead of// an ASCII 13 (''\r'') character. This is required for PETSCII terminal compatibility, where an ASCII 13 character performs a complete "newline" sequence (the equivalent of ''\r\n'') on the client terminal. If you wish to send a traditional "carriage return" character to the client terminal (i.e. move the cursor to the far left column without advancing to the next line) it is recommended that you use an output method/function that supports [[custom:Ctrl-A codes]] and you send the Ctrl-A ''[''  sequences //instead of// an ASCII 13 (''\r'') character. This is required for PETSCII terminal compatibility, where an ASCII 13 character performs a complete "newline" sequence (the equivalent of ''\r\n'') on the client terminal.
 +
 +==== Input ==== 
 +
 +^ Method                    ^ BBS((Terminal Server)) ^ JSexec ^ Notes ^
 +| ''read()''                | Yes                    | Yes    |       |
 +| ''readln()''              | Yes                    | Yes    |       |
 +| ''console.getstr()''      | Yes                    | No           |
 +| ''console.getkey()''      | Yes                    | No           |
 +| ''console.getbyte()''     | Yes                    | No           |
 +| ''console.getnum()''      | Yes                    | No           |
 +| ''console.getkeys()''     | Yes                    | No           |
 +| ''console.gettemplate()'' | Yes                    | No           |
 +
 +==== Prompt ==== 
 +
 +Often you'll want your script to prompt the user for some input (e.g. a string of text or a single key). A prompt involves both //output//  (first, from the BBS) and //input// (from the user):
 +
 +^ Method              ^ BBS((Terminal Server)) ^ JSexec ^ Notes ^
 +| ''prompt()''        | Yes                    | Yes    |       |
 +| ''confirm()''       | Yes                    | Yes    |       |
 +| ''deny()''          | Yes                    | Yes    |       |
 +| ''console.yesno()'' | Yes                    | No           |
 +| ''console.noyes()'' | Yes                    | No           |
 +| ''console.mnemonics()'' | Yes                    | No           |
 +
 ===== See Also ===== ===== See Also =====
   * [[http://synchro.net/docs/jsobjs.html|Synchronet JavaScript Object Model]]   * [[http://synchro.net/docs/jsobjs.html|Synchronet JavaScript Object Model]]