global
methods
Name
|
Returns
|
Usage
|
Description
|
log | string | log(value [,value])
add a line of text to the server and/or system log, values are typically string constants or variables
| read | string | read([count])
read up to count characters from input stream
| readln | string | readln([count])
read a single line, up to count characters, from input stream
| write | void | write(value [,value])
send one or more values (typically strings) to the server output
| writeln | void | writeln(value [,value])
send a line of text to the console or event log with automatic line termination (CRLF), values are typically string constants or variables (AKA print)
| printf | string | printf(string format [,value][,value])
print a formatted string - CAUTION: for experienced C programmers ONLY
| alert | void | alert(value)
print an alert message (ala client-side JS)
| prompt | string | prompt([value])
displays a prompt (value) and returns a string of user input (ala clent-side JS)
| confirm | boolean | confirm(value)
displays a Yes/No prompt and returns true or false based on users confirmation (ala client-side JS)
| exit | void | exit([number exit_code])
stop script execution, optionally setting the global property exit_code to the specified numeric value
| load | boolean | load(string filename [,args])
load and execute a JavaScript file, returns true if the execution was successful
| mswait | void | mswait([number milliseconds])
millisecond wait/sleep routine (AKA sleep)
| yield | void | yield([bool forced])
release current thread time-slice, a forced yield will yield to all other pending tasks (lowering CPU utilization), a non-forced yield will yield only to pending tasks of equal or higher priority. forced defaults to true
| random | number | random(number max)
return random integer between 0 and max-1
| time | number | time()
return current time in Unix (time_t) format (number of seconds since Jan-01-1970)
| beep | void | beep([number freq, duration])
produce a tone on the local speaker at specified frequency for specified duration (in milliseconds)
| sound | boolean | sound([string filename])
play a waveform (.wav) sound file
| ctrl | string | ctrl(number or string)
return ASCII control character representing character passed - Example: ctrl('C') returns ''
| ascii | number | ascii([string text] or [number value])
convert string to ASCII value or vice-versa (returns number OR string)
| ascii_str | string | ascii_str(string text)
convert extended-ASCII in string to plain ASCII
| strip_ctrl | string | strip_ctrl(string text)
strip control characters from string
| strip_exascii | string | strip_exascii(string text)
strip extended-ASCII characters from string
| truncsp | string | truncsp(string text)
truncate white-space characters off end of string
| truncstr | string | truncstr(string text, charset)
truncate string at first char in charset
| lfexpand | string | lfexpand(string text)
expand line-feeds (LF) to carriage-return/line-feeds (CRLF)
| file_getname | string | file_getname(string path)
returns filename portion of passed path string
| file_getext | string | file_getext(string path)
returns file extension portion of passed path/filename string (including '.') or undefined if no extension is found
| file_getcase | string | file_getcase(string filename)
returns correct case of filename (long version of filename on Win32) or undefined if the file doesn't exist
| file_exists | boolean | file_exists(string filename)
verify a file's existence
| file_remove | boolean | file_remove(string filename)
delete a file
| file_rename | boolean | file_rename(oldname, newname)
rename a file, possibly moving it to another directory in the process
| file_copy | boolean | file_copy(source, destination)
copy a file from one directory or filename to another
| file_backup | boolean | file_backup(string filename [,number level] [,bool rename])
backup the specified filename as filename.number.extension where number is the backup number 0 through level-1 (default backup level is 5), if rename is true, the original file is renamed instead of copied (default is false)
| file_isdir | boolean | file_isdir(string filename)
check if specified filename is a directory
| file_attrib | number | file_attrib(string filename)
get a file's permissions/attributes
| file_date | number | file_date(string filename)
get a file's last modified date/time (in time_t format)
| file_size | number | file_size(string filename)
get a file's length (in bytes)
| file_utime | boolean | file_utime(string filename [,access_time] [,mod_time])
change a file's last accessed and modification date/time (in time_t format), or change to current time
| file_touch | boolean | file_touch(string filename)
updates a file's last modification date/time to current time, creating an empty file if it doesn't already exist
| directory | array | directory(string pattern [,flags])
returns an array of directory entries, pattern is the path and filename or wildcards to search for (e.g. '/subdir/*.txt'), flags is a bitfield of optional glob flags (default is GLOB_MARK)
| mkdir | boolean | mkdir(string directory)
make a directory
| rmdir | boolean | rmdir(string directory)
remove a directory
| strftime | string | strftime(string format [,number time])
return a formatted time string (ala C strftime)
| format | string | format(string format [,args])
return a formatted string (ala sprintf) - CAUTION: for experienced C programmers ONLY
| html_encode | string | html_encode(string text [,bool ex_ascii] [,bool white_space])
return an HTML-encoded text string (using standard HTML character entities), escaping IBM extended-ASCII and white-space characters by default
| html_decode | string | html_decode(string text)
return a decoded HTML-encoded text string
| word_wrap | string | word_wrap(string text [,line_length])
returns a word-wrapped version of the text string argument, line_length defaults to 79
| quote_msg | string | quote_msg(string text [,line_length] [,prefix])
returns a quoted version of the message text string argumnet, line_length defaults to 79, prefix defaults to " > "
| rot13_translate | string | rot13_translate(string text)
returns ROT13-translated version of text string (will encode or decode text)
| base64_encode | string | base64_encode(string text)
returns base64-encoded version of text string or null on error
| base64_decode | string | base64_decode(string text)
returns base64-decoded text string or null on error (not useful for binary data)
| crc16_calc | number | crc16_calc(string text)
calculate and return 16-bit CRC of text string
| crc32_calc | number | crc32_calc(string text)
calculate and return 32-bit CRC of text string
| chksum_calc | number | chksum_calc(string text)
calculate and return 32-bit checksum of text string
| md5_calc | string | md5_calc(string text [,bool hex])
calculate and return 128-bit MD5 digest of text string, result encoded in base64 (default) or hexadecimal
| resolve_ip | string | resolve_ip(string hostname)
resolve IP address of specified hostname (AKA gethostbyname)
| resolve_host | string | resolve_host(string ip_address)
resolve hostname of specified IP address (AKA gethostbyaddr)
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
js
properties
Name
|
Type
|
Description
|
terminated | boolean
| termination has been requested (stop execution as soon as possible) |
branch_counter | number
| number of branch operations performed in this runtime |
branch_limit | number
| maximum number of branches, used for infinite-loop detection (0=disabled) |
yield_interval | number
| interval of periodic time-slice yields (lower number=higher frequency, 0=disabled) |
gc_interval | number
| interval of periodic garbage collection attempts (lower number=higher frequency, 0=disabled) |
gc_attempts | number
| number of garbage collections attempted in this runtime - READ ONLY |
gc_counter | number
| number of garbage collections performed in this runtime - READ ONLY |
gc_last_bytes | number
| number of heap bytes in use after last garbage collection - READ ONLY |
bytes | number
| number of heap bytes currently in use - READ ONLY |
max_bytes | number
| maximum number of bytes available for heap |
system
methods
Name
|
Returns
|
Usage
|
Description
|
username | string | system.username(number)
returns name of user in specified user record number, or empty string if not found
| alias | string | system.alias(string alias)
returns name of user that matches alias (if found in ctrl/alias.cfg)
| matchuser | number | system.matchuser(string username [,bool sysop_alias])
exact user name matching, returns number of user whose name/alias matches username or 0 if not found, matches well-known sysop aliases by default
| matchuserdata | number | system.matchuserdata(field, data [,usernumber])
search user database for data in a specific field (specified by offset), returns first matching user record number, optional usernumber specifies user record to skip
| trashcan | boolean | system.trashcan(string filename, search)
search text/filename.can for pseudo-regexp
| findstr | boolean | system.findstr(string filename, search)
search any file for pseudo-regexp
| zonestr | string | system.zonestr([timezone])
convert time zone integer to string, defaults to system timezone if timezone not specified
| timestr | string | system.timestr([time])
convert time_t integer into a time string, defaults to current time if time not specified
| datestr | string | system.datestr([time])
convert time_t integer into a date string (in either MM/DD/YY or DD/MM/YY format), defaults to current date if time not specified
| secondstr | string | system.secondstr(seconds)
convert elapsed time in seconds into a string in hh:mm:ss format
| spamlog | boolean | system.spamlog([protocol, action, reason, host, ip, to, from])
log a suspected SPAM attempt
| hacklog | boolean | system.hacklog([protocol, user, text, host, ip, port])
log a suspected hack attempt
| filter_ip | boolean | system.filter_ip([protocol, reason, host, ip, username])
add an IP address (with comment) to the system's IP filter file
| get_node_message | string | system.get_node_message(number node)
read any messages waiting for the specified node and return in a single string
| put_node_message | boolean | system.put_node_message(number node, string message)
send a node a short text message, delivered immediately
| get_telegram | string | system.get_telegram(number user)
returns any short text messages waiting for the specified user
| put_telegram | boolean | system.put_telegram(number user, string message)
sends a user a short text message, delivered immediately or during next logon
| new_user | object | system.new_user(name/alias)
creates a new user record, returns a new User object representing the new user account
| exec | number | system.exec(command-line)
executes a native system/shell command-line, returns 0 on success
| check_syspass | boolean | system.check_syspass(string password)
compares the supplied password against the system password and return's true if it matches
| | | | | | | | | | | | | | | | | | | | |
system
properties
Name
|
Type
|
Description
|
name | string
| BBS name |
operator | string
| operator name |
qwk_id | string
| system QWK-ID (for QWK packets) |
settings | number
| settings bitfield (see SS_* in sbbsdefs.js for bit definitions) |
psname | string
| PostLink name |
psnum | number
| PostLink system number |
inetaddr | string
| Internet address (host or domain name) |
location | string
| location (city, state) |
timezone | number
| timezone (use system.zonestr() to get string representation) |
pwdays | number
| days between forced password changes |
deldays | number
| days to preserve deleted user records |
lastuser | number
| last user record number in user database (includes deleted and inactive user records) |
lastuseron | string
| name of last user to logoff |
freediskspace | number
| amount of free disk space (in bytes) |
freediskspacek | number
| amount of free disk space (in kilobytes) |
nodes | number
| total number of BBS nodes |
lastnode | number
| last displayable node number |
newuser_password | string
| new user password |
newuser_magic_word | string
| new user magic word |
newuser_level | number
| new user level |
newuser_flags1 | number
| new user flag set #1 |
newuser_flags2 | number
| new user flag set #2 |
newuser_flags3 | number
| new user flag set #3 |
newuser_flags4 | number
| new user flag set #4 |
newuser_restrictions | number
| new user restriction flags |
newuser_exemptions | number
| new user exemption flags |
newuser_credits | number
| new user credits |
newuser_minutes | number
| new user extra minutes |
newuser_command_shell | number
| new user command shell |
newuser_editor | string
| new user external editor |
newuser_settings | number
| new user settings |
newuser_download_protocol | string
| new user file transfer protocol (command key) |
newuser_expiration_days | number
| new user expiration days |
newuser_questions | number
| new user questions bitfield (see UQ_* in sbbsdefs.js for bit definitions) |
expired_level | number
| expired user level |
expired_flags1 | number
| expired user flag set #1 |
expired_flags2 | number
| expired user flag set #2 |
expired_flags3 | number
| expired user flag set #3 |
expired_flags4 | number
| expired user flag set #4 |
expired_restrictions | number
| expired user restriction flags |
expired_exemptions | number
| expired user exemption flags |
node_dir | string
| node directory |
ctrl_dir | string
| control file directory |
data_dir | string
| data file directory |
text_dir | string
| text file directory |
temp_dir | string
| temporary file directory |
exec_dir | string
| executable file directory |
mods_dir | string
| modified modules directory (optional) |
logs_dir | string
| log file directory |
devnull | string
| null device filename |
local_host_name | string
| private host name that uniquely identifies this system on the local network |
host_name | string
| public host name that uniquely identifies this system on the Internet (usually the same as system.inetaddr) |
version | string
| Synchronet version number (e.g. '3.10') |
revision | string
| Synchronet revision letter (e.g. 'k') |
full_version | string
| Synchronet full version information (e.g. '3.10k Beta Debug') |
version_notice | string
| Synchronet version notice (includes version and platform) |
platform | string
| platform description (e.g. 'Win32', 'Linux', 'FreeBSD') |
socket_lib | string
| socket library version information |
msgbase_lib | string
| message base library version information |
compiled_with | string
| compiler used to build Synchronet |
compiled_when | string
| date and time compiled |
copyright | string
| Synchronet copyright display |
js_version | string
| JavaScript engine version information |
os_version | string
| operating system version information |
uptime | number
| time/date system was brought online (in time_t format) |
bbs
methods
Name
|
Returns
|
Usage
|
Description
|
atcode | string | bbs.atcode(string code)
returns @-code value, specified code string does not include @ character delimiters
| text | string | bbs.text(number line)
returns specified text string from text.dat
| replace_text | boolean | bbs.replace_text(number line, string text)
replaces specified text string in memory
| revert_text | boolean | bbs.revert_text([number line])
reverts specified text string to original text string; if line unspecified, reverts all text lines
| load_text | boolean | bbs.load_text(string basefilename)
load an alternate text.dat from ctrl directory, automatically appends '.dat' to basefilename
| newuser | void | bbs.newuser()
interactive new user procedure
| login | boolean | bbs.login(string username, password_prompt)
login with username, displaying password_prompt for password (if required)
| logon | boolean | bbs.logon()
interactive logon procedure
| logoff | void | bbs.logoff()
interactive logoff procedure
| logout | void | bbs.logout()
non-interactive logout procedure
| hangup | void | bbs.hangup()
hangup (disconnect) immediately
| nodesync | void | bbs.nodesync()
synchronize with node database, checks for messages, interruption, etc. (AKA node_sync)
| auto_msg | void | bbs.auto_msg()
read/create system's auto-message
| time_bank | void | bbs.time_bank()
enter the time banking system
| qwk_sec | void | bbs.qwk_sec()
enter the QWK message packet upload/download/config section
| text_sec | void | bbs.text_sec()
enter the text files section
| xtrn_sec | void | bbs.xtrn_sec()
enter the external programs section
| xfer_policy | void | bbs.xfer_policy()
display the file transfer policy
| batch_menu | void | bbs.batch_menu()
enter the batch file transfer menu
| batch_download | boolean | bbs.batch_download()
start a batch download
| batch_add_list | void | bbs.batch_add_list(filename)
add file list to batch download queue
| temp_xfer | void | bbs.temp_xfer()
enter the temporary file tranfer menu
| user_sync | void | bbs.user_sync()
read the current user data from the database
| user_config | void | bbs.user_config()
enter the user settings configuration menu
| sys_info | void | bbs.sys_info()
display system information
| sub_info | void | bbs.sub_info([subboard])
display message sub-board information (current subboard, if unspecified)
| dir_info | void | bbs.dir_info([directory])
display file directory information (current directory, if unspecified)
| user_info | void | bbs.user_info()
display current user information
| ver | void | bbs.ver()
display software version information
| sys_stats | void | bbs.sys_stats()
display system statistics
| node_stats | void | bbs.node_stats()
display current node statistics
| list_users | void | bbs.list_users()
display user list
| edit_user | void | bbs.edit_user()
enter the user editor
| change_user | void | bbs.change_user()
change to a different user
| list_logons | void | bbs.list_logons()
display the logon list
| read_mail | void | bbs.read_mail()
read private e-mail
| email | boolean | bbs.email(number user [,number mode] [,string top] [,string subject])
send private e-mail or netmail
| netmail | boolean | bbs.netmail(string address [,number mode] [,string subject])
send private netmail
| bulk_mail | void | bbs.bulk_mail([ars])
send bulk private e-mail
| upload_file | boolean | bbs.upload_file(directory)
upload file to file directory specified by number or internal code
| bulk_upload | boolean | bbs.bulk_upload(directory)
add files (already in local storage path) to file directory specified by number or internal code
| resort_dir | boolean | bbs.resort_dir(directory)
re-sort the file directory specified by number or internal code)
| list_files | number | bbs.list_files(directory [,string filespec] [,number mode])
list files in the specified file directory, optionally specifying a file specification (wildcards) and mode (bitfield)
| list_file_info | number | bbs.list_file_info(directory [,string filespec] [,number mode])
list extended file information for files in the specified file directory
| post_msg | boolean | bbs.post_msg(sub-board [,number mode])
post a message in the specified message sub-board (number or internal code) with optinal mode (bitfield)
| cfg_msg_scan | void | bbs.cfg_msg_scan([number mode])
configure message scan
| cfg_msg_ptrs | void | bbs.cfg_msg_ptrs([number mode])
change message scan pointers
| reinit_msg_ptrs | void | bbs.reinit_msg_ptrs()
re-initialize new message scan pointers
| scan_subs | void | bbs.scan_subs([number mode, boolean all])
scan sub-boards for messages
| scan_dirs | void | bbs.scan_dirs([number mode, boolean all])
scan directories for files
| scan_posts | boolean | bbs.scan_posts([sub-board, number mode, string find])
scan posts in the specified message sub-board (number or internal code), optionally search for 'find' string
| menu | void | bbs.menu(base_filename)
display a menu file from the text/menu directory
| log_key | boolean | bbs.log_key(key [,boolean comma])
log key to node.log (comma optional)
| log_str | boolean | bbs.log_str(text)
log string to node.log
| finduser | number | bbs.finduser(username_or_number)
find user name (partial name support), interactive
| trashcan | boolean | bbs.trashcan(base_filename, search_string)
search file for psuedo-regexp (search string) in trashcan file (text/base_filename.can)
| exec | number | bbs.exec(cmdline [,number mode] [,string startup_dir])
execute a program, optionally changing current directory to startup_dir (see EX_* in sbbsdefs.js for valid mode bits)
| exec_xtrn | boolean | bbs.exec_xtrn(xtrn_number_or_code)
execute external program by internal code
| user_event | boolean | bbs.user_event(number event_type)
execute user event by event type (see EVENT_* in sbbsdefs.js for valid values)
| telnet_gate | void | bbs.telnet_gate(string address [,number mode])
external telnet gateway (see TG_* in sbbsdefs.js for valid mode bits)
| check_syspass | boolean | bbs.check_syspass()
prompt for and verify system password
| good_password | string | bbs.good_password(string password)
check if requested user password meets minimum password requirements (length, uniqueness, etc.)
| page_sysop | boolean | bbs.page_sysop()
page the sysop for chat
| page_guru | boolean | bbs.page_guru()
page the guru for chat
| multinode_chat | void | bbs.multinode_chat()
enter multi-node chat
| private_message | void | bbs.private_message()
use the private inter-node message prompt
| private_chat | void | bbs.private_chat()
enter private inter-node chat
| get_node_message | void | bbs.get_node_message()
receive and display an inter-node message
| put_node_message | boolean | bbs.put_node_message(number node, string text)
send an inter-node message
| get_telegram | void | bbs.get_telegram([number usernum])
receive and display a telegram
| put_telegram | boolean | bbs.put_telegram(number user, string text)
send a telegram to a user
| list_nodes | void | bbs.list_nodes()
list all nodes
| whos_online | void | bbs.whos_online()
list active nodes only (who's online)
| spy | void | bbs.spy(node_number)
spy on a node
| cmdstr | string | bbs.cmdstr(string str [,string fpath] [,string fspec])
return expanded command string using Synchronet command-line specifiers
| get_filespec | string | bbs.get_filespec()
returns a file specification input by the user (optionally with wildcards)
| get_newscantime | number | bbs.get_newscantime(number time)
confirm or change newscan time, returns new newscan time value (time_t format)
| select_shell | boolean | bbs.select_shell()
prompt user to select a new command shell
| select_editor | boolean | bbs.select_editor()
prompt user to select a new external message editor
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
bbs
properties
Name
|
Type
|
Description
|
sys_status | number
| system status bitfield (see SS_* in sbbsdefs.js for bit definitions) |
startup_options | number
| startup options bitfield (see BBS_OPT_* in sbbsdefs.js for bit definitions) |
answer_time | number
| answer time, in time_t format |
logon_time | number
| logon time, in time_t format |
new_file_time | number
| file newscan time, in time_t format |
last_new_file_time | number
| previous newscan time, in time_t format |
online | number
| online (see ON_* in sbbsdefs.js for valid values) |
time_left | number
| time left (in seconds) |
event_time | number
| time of next exclusive event (in time_t format), or 0 if none |
event_code | string
| internal code of next exclusive event |
node_num | number
| current node number |
node_settings | number
| current node settings bitfield (see NM_* in sbbsdefs.js for bit definitions) |
node_action | number
| current node action (see nodedefs.js for valid values) |
node_val_user | number
| validation feedback user for this node (or 0 for no validation feedback required) |
logon_ulb | number
| bytes uploaded during this session |
logon_dlb | number
| bytes downloaded during this session |
logon_uls | number
| files uploaded during this session |
logon_dls | number
| files downloaded during this session |
logon_posts | number
| messages posted during this session |
logon_emails | number
| e-mails sent during this session |
logon_fbacks | number
| feedback messages sent during this session |
posts_read | number
| messages read during this session |
menu_dir | string
| menu subdirectory (overrides default) |
menu_file | string
| menu file (overrides default) |
main_cmds | number
| total main menu commands received from user during this session |
file_cmds | number
| total file menu commands received from user during this session |
curgrp | number
| current message group |
cursub | number
| current message sub-board |
curlib | number
| current file library |
curdir | number
| current file directory |
connection | string
| remote connection type |
rlogin_name | string
| rlogin name |
client_name | string
| client name |
alt_ul_dir | number
| current alternate upload path number |
smb_group | string
| message group name of message being read |
smb_group_desc | string
| message group description of message being read |
smb_group_number | number
| message group number of message being read |
smb_sub | string
| sub-board name of message being read |
smb_sub_desc | string
| sub-board description of message being read |
smb_sub_code | string
| sub-board internal code of message being read |
smb_sub_number | number
| sub-board number of message being read |
smb_attr | number
| message base attributes |
smb_last_msg | number
| highest message number in message base |
smb_total_msgs | number
| total number of messages in message base |
smb_msgs | number
| number of messages loaded from message base |
smb_curmsg | number
| current message number in message base |
msg_to | string
| message recipient name |
msg_to_ext | string
| message recipient extension |
msg_to_net | string
| message recipient network type |
msg_to_agent | number
| message recipient agent type |
msg_from | string
| message sender name |
msg_from_ext | string
| message sender extension |
msg_from_net | string
| message sender network type |
msg_from_agent | number
| message sender agent type |
msg_replyto | string
| message reply-to name |
msg_replyto_ext | string
| message reply-to extension |
msg_replyto_net | string
| message reply-to network type |
msg_replyto_agent | number
| message reply-to agent type |
msg_subject | string
| message subject |
msg_date | number
| message date/time |
msg_timezone | number
| message time zone |
msg_date_imported | number
| message date/time imported |
msg_attr | number
| message attributes |
msg_auxattr | number
| message auxillary attributes |
msg_netattr | number
| message network attributes |
msg_offset | number
| message header offset |
msg_number | number
| message number |
msg_expiration | number
| message expiration |
msg_forwarded | number
| message forwarded |
msg_thread_orig | number
| message thread, original message number |
msg_thread_next | number
| message thread, next message number |
msg_thread_first | number
| message thread, first reply to this message |
msg_id | string
| message identifier |
msg_reply_id | string
| message replied-to identifier |
msg_delivery_attempts | number
| message delivery attempt counter |
batch_upload_total | number
| number of files in batch upload queue |
batch_dnload_total | number
| number of files in batch download queue |
console
methods
Name
|
Returns
|
Usage
|
Description
|
inkey | string | console.inkey([number mode] [,number timeout])
get a single key with optional timeout in milliseconds (defaults to 0, for no wait), see K_* in sbbsdefs.js for mode bits
| getkey | string | console.getkey([number mode])
get a single key, with wait, see K_* in sbbsdefs.js for mode bits
| getstr | string | console.getstr([string][,maxlen][,mode])
get a text string from the user, see K_* in sbbsdefs.js for mode bits
| getnum | number | console.getnum([maxnum])
get a number between 1 and maxnum from the user
| getkeys | number | console.getkeys(string keys [,maxnum])
get one key from of a list of valid command keys, or a number between 1 and maxnum
| gettemplate | string | console.gettemplate(format [,string] [,mode])
get a string based on template
| ungetstr | void | console.ungetstr()
put a string in the keyboard buffer
| yesno | boolean | console.yesno(string question)
YES/no question
| noyes | boolean | console.noyes(string question)
NO/yes question
| mnemonics | void | console.mnemonics(string text)
print a mnemonics string
| clear | void | console.clear()
clear screen and home cursor
| home | void | console.home()
send cursor to home position (x,y:1,1)
| clearline | void | console.clearline()
clear current line
| cleartoeol | void | console.cleartoeol()
clear to end-of-line (ANSI)
| crlf | void | console.crlf()
output a carriage-return/line-feed pair (new-line)
| pause | void | console.pause()
display pause prompt and wait for key hit
| beep | void | console.beep([number count])
beep for count number of times (default count is 1)
| print | void | console.print(string text)
display a string (supports Ctrl-A codes)
| write | void | console.write(string text)
display a raw string
| putmsg | void | console.putmsg(string text [,number mode])
display message text (Ctrl-A codes, @-codes, pipe codes, etc), see P_* in sbbsdefs.js for mode bits
| center | void | console.center(string text)
display a string centered on the screen
| strlen | number | console.strlen(string text)
returns the number of characters in text, excluding Ctrl-A codes
| printfile | void | console.printfile(string text [,number mode])
print a message text file with optional mode
| printtail | void | console.printtail(string text, number lines [,number mode])
print last x lines of file with optional mode
| editfile | void | console.editfile(string filename)
edit/create a text file using the user's preferred message editor
| uselect | number | console.uselect([number, string title, string item, string ars])
user selection menu, call for each item, then with no args to display select menu
| saveline | void | console.saveline()
save last output line
| restoreline | void | console.restoreline()
restore last output line
| ansi | string | console.ansi(number attribute)
returns ANSI encoding of specified attribute
| pushxy | void | console.pushxy()
save current cursor position (AKA ansi_save)
| popxy | void | console.popxy()
restore saved cursor position (AKA ansi_restore)
| gotoxy | void | console.gotoxy(number x,y)
Move cursor to a specific screen coordinate (ANSI), arguments can be separate x and y cooridinates or an object with x and y properites (like that returned from console.getxy())
| up | void | console.up([number rows])
Move cursor up one or more rows (ANSI)
| down | void | console.down([number rows])
Move cursor down one or more rows (ANSI)
| right | void | console.right([number columns])
Move cursor right one or more columns (ANSI)
| left | void | console.left([number columns])
Move cursor left one or more columns (ANSI)
| getlines | void | console.getlines()
Auto-detect the number of rows/lines on the user's terminal (ANSI)
| getxy | object | console.getxy()
Returns the current cursor position as an object (with x and y properties)
| lock_input | void | console.lock_input([boolean lock])
Lock the user input thread (allowing direct client socket access)
| telnet_cmd | void | console.telnet_cmd(number cmd [,number option])
Send telnet command (with optional command option) to remote client
| handle_ctrlkey | boolean | console.handle_ctrlkey(string key [,number mode])
Call internal control key handler for specified control key, returns true if handled
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
console
properties
Name
|
Type
|
Description
|
status | number
| status bitfield (see CON_* in sbbsdefs.js for bit definitions) |
line_counter | number
| current line counter (used for automatic screen pause) |
attributes | number
| current display attributes (set with number or string value) |
top_of_screen | number
| set to 1 if the terminal cursor is already at the top of the screen |
screen_rows | number
| number of terminal screen rows (in lines) |
screen_columns | number
| number of terminal screen columns (in character cells) |
autoterm | number
| bitfield of automatically detected terminal settings (see USER_* in sbbsdefs.js for bit definitions) |
terminal | string
| terminal type description (e.g. 'ANSI') |
timeout | number
| user inactivity timeout reference |
timeleft_warning | number
| low timeleft warning flag |
aborted | number
| input/output has been aborted |
abortable | number
| output can be aborted with Ctrl-C |
telnet_mode | number
| current telnet mode bitfield (see TELNET_MODE_* in sbbsdefs.js for bit definitions) |
wordwrap | string
| word-wrap buffer (used by getstr) - READ ONLY |
question | string
| current yes/no question (set by yesno and noyes) |
getstr_offset | number
| cursor position offset for use with getstr(K_USEOFFSET) |
ctrlkey_passthru | number
| control key pass-through bitmask, set bits represent control key combinations not handled by inkey() method |
msg_area.grp_list.sub_list
properties
Name
|
Type
|
Description
|
number | number
| sub-board number |
grp_number | number
| group number |
code | string
| sub-board internal code |
name | string
| sub-board name |
description | string
| sub-board description |
qwk_name | string
| sub-board QWK name |
newsgroup | string
| newsgroup name (as configured or dymamically generated) |
ars | string
| sub-board access requirements |
read_ars | string
| sub-board reading requirements |
post_ars | string
| sub-board posting requirements |
operator_ars | string
| sub-board operator requirements |
moderated_ars | string
| sub-board moderated-user requirements (if non-blank) |
data_dir | string
| sub-board data storage location |
fidonet_origin | string
| FidoNet origin line |
qwknet_tagline | string
| QWK Network tagline |
settings | number
| toggle options (bitfield) |
ptridx | number
| index into message scan configuration/pointer file |
qwk_conf | number
| QWK conference number |
max_crcs | number
| configured maximum number of message CRCs to store (for dupe checking) |
max_msgs | number
| configured maximum number of messages before purging |
max_age | number
| configured maximum age (in days) of messages before expiration |
can_read | boolean
| user has sufficient access to read messages |
can_post | boolean
| user has sufficient access to post messages |
is_operator | boolean
| user has operator access to this message area |
is_moderated | boolean
| user's posts are moderated |
scan_ptr | number
| user's current new message scan pointer |
scan_cfg | number
| user's message scan configuration (bitfield) |
last_read | number
| user's last-read message number |
file_area.lib_list.dir_list
properties
Name
|
Type
|
Description
|
number | number
| directory number |
lib_number | number
| library number |
code | string
| directory internal code |
name | string
| directory name |
description | string
| directory description |
path | string
| directory file storage location |
ars | string
| directory access requirements |
upload_ars | string
| directory upload requirements |
download_ars | string
| directory download requirements |
exempt_ars | string
| directory exemption requirements |
operator_ars | string
| directory operator requirements |
extensions | string
| allowed file extensions (comma delimited) |
upload_sem | string
| upload semaphore file |
data_dir | string
| directory data storage location |
settings | number
| toggle options (bitfield) |
seqdev | number
| sequential (slow storage) device number |
sort | number
| sort order (see SORT_* in sbbsdefs.js for valid values) |
max_files | number
| configured maximum number of files |
max_age | number
| configured maximum age (in days) of files before expiration |
upload_credit_pct | number
| percent of file size awarded uploader in credits upon file upload |
download_credit_pct | number
| percent of file size awarded uploader in credits upon subsequent downloads |
link | string
| directory link (for HTML index) |
can_upload | boolean
| user has sufficient access to upload files |
can_download | boolean
| user has sufficient access to download files |
is_exempt | boolean
| user is exempt from download credit costs |
is_operator | boolean
| user has operator access to this directory |
MsgBase
properties
Name
|
Type
|
Description
|
error | string
| last occurred message base error - READ ONLY |
file | string
| base path and filename of message base - READ ONLY |
retry_time | number
| message base open/lock retry timeout (in seconds) |
retry_delay | number
| delay between message base open/lock retries (in milliseconds) |
first_msg | number
| first message number - READ ONLY |
last_msg | number
| last message number - READ ONLY |
total_msgs | number
| total number of messages - READ ONLY |
max_crcs | number
| maximum number of message CRCs to store (for dupe checking) - READ ONLY |
max_msgs | number
| maximum number of messages before expiration - READ ONLY |
max_age | number
| maximum age (in days) of messages to store - READ ONLY |
attributes | number
| message base attributes - READ ONLY |
subnum | number
| sub-board number (0-based, -1 for e-mail) - READ ONLY |
is_open | boolean
| true if the message base has been opened successfully - READ ONLY |
MsgBase.cfg
properties
Name
|
Type
|
Description
|
number | number
| sub-board number |
grp_number | number
| group number |
code | string
| sub-board internal code |
name | string
| sub-board name |
description | string
| sub-board description |
qwk_name | string
| sub-board QWK name |
newsgroup | string
| newsgroup name (as configured or dymamically generated) |
ars | string
| sub-board access requirements |
read_ars | string
| sub-board reading requirements |
post_ars | string
| sub-board posting requirements |
operator_ars | string
| sub-board operator requirements |
moderated_ars | string
| sub-board moderated-user requirements (if non-blank) |
data_dir | string
| sub-board data storage location |
fidonet_origin | string
| FidoNet origin line |
qwknet_tagline | string
| QWK Network tagline |
settings | number
| toggle options (bitfield) |
ptridx | number
| index into message scan configuration/pointer file |
qwk_conf | number
| QWK conference number |
max_crcs | number
| configured maximum number of message CRCs to store (for dupe checking) |
max_msgs | number
| configured maximum number of messages before purging |
max_age | number
| configured maximum age (in days) of messages before expiration |