Name | Returns | Usage | Ver | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
log | string | log([level,] value [,value])
3.11
| add a line of text to the server and/or system log, values are typically string constants or variables, level is the debug level/priority (default: LOG_INFO)
| read | string | read([count])
| 3.11
| read up to count characters from input stream
| readln | string | readln([count])
| 3.11
| read a single line, up to count characters, from input stream
| write | void | write(value [,value])
| 3.11
| send one or more values (typically strings) to the server output
| write_raw | void | write_raw(value [,value])
| 3.14
| send a stream of bytes (possibly containing NULLs or special control code sequences) to the server output
| writeln | void | writeln(value [,value])
| 3.11
| 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])
| 3.10
| print a formatted string - CAUTION: for experienced C programmers ONLY
| alert | void | alert(value)
| 3.10
| print an alert message (ala client-side JS)
| prompt | string | prompt([value])
| 3.10
| displays a prompt (value) and returns a string of user input (ala clent-side JS)
| confirm | boolean | confirm(value)
| 3.10
| displays a Yes/No prompt and returns true or false based on users confirmation (ala client-side JS)
| exit | void | exit([exit_code])
| 3.11
| stop script execution, optionally setting the global property exit_code to the specified numeric value
| load | undefined | load([bool background or object scope,] string filename [,args])
| 3.12
| load and execute a JavaScript module (filename), optionally specifying a target scope object (default: this) and a list of arguments to pass to the module (as argv). Returns the result (last executed statement) of the executed script or a newly created Queue object if background is true). | Background (added in v3.12): If background is true, the loaded script runs in the background (in a child thread) but may communicate with the parent script/thread by reading from and/or writing to the parent_queue (an automatically created Queue object). The result (last executed statement) of the executed script (or the optional exit_code passed to the exit()/ function) will be automatically written to the parent_queue which may be read later by the parent script (using load_result.read(), for example). mswait | number | mswait([milliseconds=1])
| 3.13
| millisecond wait/sleep routine (AKA sleep), returns number of elapsed clock ticks (in v3.13)
| yield | void | yield([forced=true])
| 3.11
| 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(max_number=100)
| 3.10
| return random integer between 0 and max_number-1
| time | number | time()
| 3.10
| return current time and date in Unix (time_t) format (number of seconds since Jan-01-1970)
| beep | void | beep([frequency=500] [,duration=500])
| 3.10
| produce a tone on the local speaker at specified frequency for specified duration (in milliseconds)
| sound | boolean | sound([filename])
| 3.10
| play a waveform (.wav) sound file (currently, on Windows platforms only)
| ctrl | string | ctrl(number or string)
| 3.11
| return ASCII control character representing character passed - Example: ctrl('C') returns ''
| ascii | undefined | ascii([string text] or [number value])
| 3.10
| convert single character to numeric ASCII value or vice-versa (returns number OR string)
| ascii_str | string | ascii_str(text)
| 3.10
| convert extended-ASCII in text string to plain ASCII, returns modified string
| strip_ctrl | string | strip_ctrl(text)
| 3.10
| strip control characters from string, returns modified string
| strip_exascii | string | strip_exascii(text)
| 3.10
| strip extended-ASCII characters from string, returns modified string
| truncsp | string | truncsp(text)
| 3.10
| truncate (trim) white-space characters off end of string, returns modified string
| truncstr | string | truncstr(text, charset)
| 3.10
| truncate (trim) string at first char in charset, returns modified string
| lfexpand | string | lfexpand(text)
| 3.10
| expand line-feeds (LF) to carriage-return/line-feeds (CRLF), returns modified string
| wildmatch | boolean | wildmatch([case_sensitive=false,] string [,pattern='*'] [,path=false])
| 3.14
| returns true if the string matches the wildcard pattern (wildcards supported are '*' and '?'), if path is true, '*' will not match path delimeter characters (e.g. '/')
| backslash | string | backslash(path)
| 3.12
| returns directory path with trailing (platform-specific) path delimeter (i.e. "slash" or "backslash")
| file_getname | string | file_getname(path/filename)
| 3.11
| returns filename portion of passed path string
| file_getext | string | file_getext(path/filename)
| 3.11
| returns file extension portion of passed path/filename string (including '.') or undefined if no extension is found
| file_getcase | string | file_getcase(path/filename)
| 3.11
| returns correct case of filename (long version of filename on Win32) or undefined if the file doesn't exist
| file_cfgname | string | file_cfgname(path, filename)
| 3.12
| returns completed configuration filename from supplied path and filename, optionally including the local hostname (e.g. path/file.host.domain.ext or path/file.host.ext) if such a variation of the filename exists
| file_exists | boolean | file_exists(path/filename)
| 3.10
| verify a file's existence
| file_remove | boolean | file_remove(path/filename)
| 3.10
| delete a file
| file_removecase | boolean | file_removecase(path/filename)
| 3.14
| delete files case insensitively
| file_rename | boolean | file_rename(path/oldname, path/newname)
| 3.11
| rename a file, possibly moving it to another directory in the process
| file_copy | boolean | file_copy(path/source, path/destination)
| 3.11
| copy a file from one directory or filename to another
| file_backup | boolean | file_backup(path/filename [,level=5] [,rename=false])
| 3.11
| 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(path/filename)
| 3.10
| check if specified filename is a directory
| file_attrib | number | file_attrib(path/filename)
| 3.10
| get a file's permissions/attributes
| file_date | number | file_date(path/filename)
| 3.10
| get a file's last modified date/time (in time_t format)
| file_size | number | file_size(path/filename)
| 3.10
| get a file's length (in bytes)
| file_utime | boolean | file_utime(path/filename [,access_time=current] [,mod_time=current])
| 3.11
| change a file's last accessed and modification date/time (in time_t format), or change to current time
| file_touch | boolean | file_touch(path/filename)
| 3.11
| updates a file's last modification date/time to current time, creating an empty file if it doesn't already exist
| file_mutex | boolean | file_mutex(path/filename [,text=local_hostname] [,max_age=0])
| 3.12
| attempts to create an mutual-exclusion (e.g. lock) file, optionally with the contents of text. If a non-zero max_age (supported in v3.13b+) is specified and the lock file exists, but is older than this value (in seconds), it is presumed stale and removed/over-written
| file_compare | boolean | file_compare(path/file1, path/file2)
| 3.14
| compare 2 files, returning true if they are identical, false otherwise
| directory | array | directory(path/pattern [,flags=GLOB_MARK])
| 3.10
| 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)
| dir_freespace | number | dir_freespace(directory [,unit_size=1])
| 3.11
| returns the amount of available disk space in the specified directory using the specified unit_size in bytes (default: 1), specify a unit_size of 1024 to return the available space in kilobytes.
| disk_size | number | disk_size(directory [,unit_size=1])
| 3.14
| returns the total disk size of the specified directory using the specified unit_size in bytes (default: 1), specify a unit_size of 1024 to return the total disk size in kilobytes.
| socket_select | array | socket_select([array of socket objects or descriptors] [,timeout=0] [,write=false])
| 3.11
| checks an array of socket objects or descriptors for read or write ability (default is read), default timeout value is 0.0 seconds (immediate timeout), returns an array of 0-based index values into the socket array, representing the sockets that were ready for reading or writing
| mkdir | boolean | mkdir(path/directory)
| 3.10
| make a directory
| rmdir | boolean | rmdir(path/directory)
| 3.10
| remove a directory
| strftime | string | strftime(format [,time=current])
| 3.10
| return a formatted time string (ala C strftime)
| format | string | format(format [,args])
| 3.10
| return a formatted string (ala the standard C sprintf function)
| html_encode | string | html_encode(text [,ex_ascii=true] [,white_space=true] [,ansi=true] [,ctrl_a=true] [, state (object)])
| 3.11
| return an HTML-encoded text string (using standard HTML character entities), escaping IBM extended-ASCII, white-space characters, ANSI codes, and CTRL-A codes by default.Optionally storing the current ANSI state in state object
| html_decode | string | html_decode(html)
| 3.11
| return a decoded HTML-encoded text string
| word_wrap | string | word_wrap(text [,line_length=79 [, orig_line_length=79 [, handle_quotes=true]]]])
| 3.11
| returns a word-wrapped version of the text string argument optionally handing quotes magically, line_length defaults to 79 orig_line_length defaults to 79 and handle_quotes defaults to true
| quote_msg | string | quote_msg(text [,line_length=79] [,prefix=" > "])
| 3.11
| returns a quoted version of the message text string argument, line_length defaults to 79, prefix defaults to " > "
| rot13_translate | string | rot13_translate(text)
| 3.11
| returns ROT13-translated version of text string (will encode or decode text)
| base64_encode | string | base64_encode(text)
| 3.11
| returns base64-encoded version of text string or null on error
| base64_decode | string | base64_decode(text)
| 3.11
| returns base64-decoded text string or null on error
| crc16_calc | number | crc16_calc(text)
| 3.11
| calculate and return 16-bit CRC of text string
| crc32_calc | number | crc32_calc(text)
| 3.11
| calculate and return 32-bit CRC of text string
| chksum_calc | number | chksum_calc(text)
| 3.11
| calculate and return 32-bit checksum of text string
| md5_calc | string | md5_calc(text [,hex=false])
| 3.11
| calculate and return 128-bit MD5 digest of text string, result encoded in base64 (default) or hexadecimal
| resolve_ip | string | resolve_ip(hostname)
| 3.11
| resolve IP address of specified hostname (AKA gethostbyname)
| resolve_host | string | resolve_host(ip_address)
| 3.11
| resolve hostname of specified IP address (AKA gethostbyaddr)
| netaddr_type | number | netaddr_type(email_address)
| 3.12
| returns the proper message net_type for the specified email_address, (e.g. NET_INTERNET for Internet e-mail or NET_NONE for local e-mail)
| list_named_queues | array | list_named_queues()
| 3.12
| returns an array of named queues (created with the Queue constructor)
| flags_str | undefined | flags_str([string] or [number])
| 3.13
| convert a string of security flags (letters) into their numeric value or vice-versa (returns number OR string) - (added in v3.13)
| |
Name | Type | Description |
---|---|---|
argc | number | number of arguments passed to the script |
argv | array | array of argument strings (argv.length == argc) |
errno | number | last system error number |
errno_str | string | description of last system error |
socket_errno | number | last socket-related error number (same as errno on Unix platforms) |
Name | Returns | Usage | Ver | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
eval | undefined | js.eval(script)
3.11
| evaluate a JavaScript string in its own (secure) context, returning the result
| gc | void | js.gc(forced=true)
| 3.11
| perform a garbage collection operation (freeing memory for unused allocated objects), if forced is true (the default) a garbage collection is always performed, otherwise it is only performed if deemed appropriate by the JavaScript engine
| on_exit | void | js.on_exit(to_eval)
| 3.13
| add a string to evaluate/execute (LIFO stack) upon script's termination
| report_error | void | js.report_error(error [,fatal=false])
| 3.13
| report an error using the standard JavaScript error reporting mechanism (including script filename and line number), if fatal is true, immediately terminates script
| get_parent | object | js.get_parent(object)
| 3.14
| return the parent of the specified object
| |
Name | Type | Ver | Description |
---|---|---|---|
version | string | 3.11 | JavaScript engine version information (AKA system.js_version) |
auto_terminate | boolean | 3.11 | set to false to disable the automatic termination of the script upon external request |
terminated | boolean | 3.11 | termination has been requested (stop execution as soon as possible) |
branch_counter | number | 3.11 | number of branch operations performed in this runtime |
branch_limit | number | 3.11 | maximum number of branches, used for infinite-loop detection (0=disabled) |
yield_interval | number | 3.11 | interval of periodic time-slice yields (lower number=higher frequency, 0=disabled) |
gc_interval | number | 3.11 | interval of periodic garbage collection attempts (lower number=higher frequency, 0=disabled) |
gc_attempts | number | 3.11 | number of garbage collections attempted in this runtime - READ ONLY |
gc_counter | number | 3.11 | number of garbage collections performed in this runtime - READ ONLY |
gc_last_bytes | number | 3.11 | number of heap bytes in use after last garbage collection - READ ONLY |
bytes | number | 3.11 | number of heap bytes currently in use - READ ONLY |
max_bytes | number | 3.11 | maximum number of bytes available for heap |
global | object | 3.14 | global (top level) object - READ ONLY |
Name | Returns | Usage | Ver | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
username | string | system.username(number)
3.11
| returns name of user in specified user record number, or empty string if not found
| alias | string | system.alias(alias)
| 3.10
| returns name of user that matches alias (if found in ctrl/alias.cfg)
| matchuser | number | system.matchuser(username [,sysop_alias=true])
| 3.10
| 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])
| 3.10
| 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(path/filename, find_string)
| 3.10
| search text/filename.can for pseudo-regexp
| findstr | boolean | system.findstr(path/filename, find_string)
| 3.10
| search any file for pseudo-regexp
| zonestr | string | system.zonestr([timezone=local])
| 3.10
| convert time zone integer to string, defaults to system timezone if timezone not specified
| timestr | string | system.timestr([time=current])
| 3.10
| convert time_t integer into a time string, defaults to current time if time not specified
| datestr | string | system.datestr([time=current])
| 3.10
| 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)
| 3.10
| convert elapsed time in seconds into a string in hh:mm:ss format
| spamlog | boolean | system.spamlog([protocol, action, reason, host, ip, to, from])
| 3.10
| log a suspected SPAM attempt
| hacklog | boolean | system.hacklog([protocol, user, text, host, ip, port])
| 3.10
| log a suspected hack attempt
| filter_ip | boolean | system.filter_ip([protocol, reason, host, ip, username])
| 3.11
| add an IP address (with comment) to the system's IP filter file
| get_node_message | string | system.get_node_message(node_number)
| 3.11
| read any messages waiting for the specified node and return in a single string
| put_node_message | boolean | system.put_node_message(node_number, message_text)
| 3.10
| send a node a short text message, delivered immediately
| get_telegram | string | system.get_telegram(user_number)
| 3.11
| returns any short text messages waiting for the specified user
| put_telegram | boolean | system.put_telegram(user_number, message_text)
| 3.10
| sends a user a short text message, delivered immediately or during next logon
| new_user | object | system.new_user(name/alias)
| 3.10
| creates a new user record, returns a new User object representing the new user account
| exec | number | system.exec(command-line)
| 3.11
| executes a native system/shell command-line, returns 0 on success
| popen | array | system.popen(command-line)
| 3.11
| executes a native system/shell command-line, returns array of captured output lines on success (only functional on UNIX systems)
| check_syspass | boolean | system.check_syspass(password)
| 3.11
| compares the supplied password against the system password and return's true if it matches
| |
Name | Type | Ver | Description |
---|---|---|---|
name | string | 3.10 | BBS name |
operator | string | 3.10 | operator name |
qwk_id | string | 3.10 | system QWK-ID (for QWK packets) |
settings | number | 3.10 | settings bitfield (see SS_* in sbbsdefs.js for bit definitions) |
psname | string | 3.10 | PostLink name |
psnum | number | 3.10 | PostLink system number |
inet_addr | string | 3.11 | Internet address (host or domain name) |
location | string | 3.10 | location (city, state) |
timezone | number | 3.10 | timezone (use system.zonestr() to get string representation) |
pwdays | number | 3.10 | days between forced password changes |
deldays | number | 3.10 | days to preserve deleted user records |
lastuser | number | 3.11 | last user record number in user database (includes deleted and inactive user records) |
lastuseron | string | 3.10 | name of last user to logoff |
freediskspace | number | 3.10 | amount of free disk space (in bytes) |
freediskspacek | number | 3.10 | amount of free disk space (in kilobytes) |
nodes | number | 3.10 | total number of BBS nodes |
lastnode | number | 3.10 | last displayable node number |
newuser_password | string | 3.10 | new user password |
newuser_magic_word | string | 3.10 | new user magic word |
newuser_level | number | 3.10 | new user level |
newuser_flags1 | number | 3.10 | new user flag set #1 |
newuser_flags2 | number | 3.10 | new user flag set #2 |
newuser_flags3 | number | 3.10 | new user flag set #3 |
newuser_flags4 | number | 3.10 | new user flag set #4 |
newuser_restrictions | number | 3.10 | new user restriction flags |
newuser_exemptions | number | 3.10 | new user exemption flags |
newuser_credits | number | 3.10 | new user credits |
newuser_minutes | number | 3.10 | new user extra minutes |
newuser_command_shell | number | 3.10 | new user command shell |
newuser_editor | string | 3.10 | new user external editor |
newuser_settings | number | 3.10 | new user settings |
newuser_download_protocol | string | 3.10 | new user file transfer protocol (command key) |
newuser_expiration_days | number | 3.10 | new user expiration days |
newuser_questions | number | 3.10 | new user questions bitfield (see UQ_* in sbbsdefs.js for bit definitions) |
expired_level | number | 3.10 | expired user level |
expired_flags1 | number | 3.10 | expired user flag set #1 |
expired_flags2 | number | 3.10 | expired user flag set #2 |
expired_flags3 | number | 3.10 | expired user flag set #3 |
expired_flags4 | number | 3.10 | expired user flag set #4 |
expired_restrictions | number | 3.10 | expired user restriction flags |
expired_exemptions | number | 3.10 | expired user exemption flags |
node_dir | string | 3.10 | node directory |
ctrl_dir | string | 3.10 | control file directory |
data_dir | string | 3.10 | data file directory |
text_dir | string | 3.10 | text file directory |
temp_dir | string | 3.10 | temporary file directory |
exec_dir | string | 3.10 | executable file directory |
mods_dir | string | 3.10 | modified modules directory (optional) |
logs_dir | string | 3.10 | log file directory |
devnull | string | 3.11 | platform-specific "null" device filename |
temp_path | string | 3.12 | platform-specific temporary file directory |
cmd_shell | string | 3.14 | platform-specific command processor/shell |
clock_ticks | number | 3.11 | amount of elapsed processor time in clock 'ticks' |
clock_ticks_per_second | number | 3.11 | number of clock ticks per second |
timer | number | 3.14 | high-resolution timer, in seconds (fractional seconds supported) |
local_host_name | string | 3.11 | private host name that uniquely identifies this system on the local network |
host_name | string | N/A | public host name that uniquely identifies this system on the Internet (usually the same as system.inet_addr) |
version | string | N/A | Synchronet version number (e.g. '3.10') |
revision | string | N/A | Synchronet revision letter (e.g. 'k') |
beta_version | string | N/A | Synchronet alpha/beta designation (e.g. ' beta') |
full_version | string | N/A | Synchronet full version information (e.g. '3.10k Beta Debug') |
version_notice | string | N/A | Synchronet version notice (includes version and platform) |
version_num | number | N/A | Synchronet version number in decimal (e.g. 31301 for v3.13b) |
version_hex | number | N/A | Synchronet version number in hexadecimal (e.g. 0x31301 for v3.13b) |
platform | string | N/A | platform description (e.g. 'Win32', 'Linux', 'FreeBSD') |
socket_lib | string | N/A | socket library version information |
msgbase_lib | string | N/A | message base library version information |
compiled_with | string | N/A | compiler used to build Synchronet |
compiled_when | string | N/A | date and time compiled |
copyright | string | N/A | Synchronet copyright display |
js_version | string | N/A | JavaScript engine version information |
os_version | string | N/A | operating system version information |
uptime | number | N/A | time/date system was brought online (in time_t format) |
fido_addr_list | object | N/A | array of FidoNet Technology Network (FTN) addresses associated with this system |
Name | Type | Ver | Description |
---|---|---|---|
total_logons | number | 3.10 | total logons |
logons_today | number | 3.10 | logons today |
total_timeon | number | 3.10 | total time used |
timeon_today | number | 3.10 | time used today |
total_files | number | 3.10 | total files in file bases |
files_uploaded_today | number | 3.10 | files uploaded today |
bytes_uploaded_today | number | 3.10 | bytes uploaded today |
files_downloaded_today | number | 3.10 | files downloaded today |
bytes_downloaded_today | number | 3.10 | bytes downloaded today |
total_messages | number | 3.10 | total messages in message bases |
messages_posted_today | number | 3.10 | messages posted today |
total_email | number | 3.10 | total messages in mail base |
email_sent_today | number | 3.10 | email sent today |
total_feedback | number | 3.10 | total feedback messages waiting |
feedback_sent_today | number | 3.10 | feedback sent today |
total_users | number | 3.10 | total user records (does not include deleted or inactive user records) |
new_users_today | number | 3.10 | new users today |
Name | Type | Ver | Description |
---|---|---|---|
status | number | 3.10 | status (see nodedefs.js for valid values) |
errors | number | 3.10 | error counter |
action | number | 3.10 | current user action (see nodedefs.js) |
useron | number | 3.10 | current user number |
connection | number | 3.10 | connection speed (0xffff = Telnet or RLogin) |
misc | number | 3.10 | miscellaneous bitfield (see nodedefs.js) |
aux | number | 3.10 | auxillary value |
extaux | number | 3.10 | extended auxillary value |
Name | Type | Ver | Description |
---|---|---|---|
version | string | 3.10 | server name and version number |
version_detail | string | 3.10 | detailed version/build information |
interface_ip_address | string | 3.11 | IP address of bound network interface (0.0.0.0 = ANY) |
options | number | 3.11 | bit-field of server-specific startup options |
clients | number | 3.11 | number of active clients (if available) |
Name | Type | Ver | Description |
---|---|---|---|
ip_address | string | 3.10 | client's IP address (in dotted-decimal format) |
host_name | string | 3.10 | client's host name (up to 64 characters) |
port | number | 3.10 | client's TCP or UDP port number |
connect_time | number | 3.10 | date/time of initial connection (in time_t format) |
protocol | string | 3.10 | protocol description (e.g. 'Telnet', 'FTP', etc.) |
user_name | string | 3.10 | user's name/alias (if logged in) |
socket | object | N/A | instance of Socket class representing client's TCP/IP connection |
To create a new user object: var u = new User(number)
Name | Returns | Usage | Ver | Description | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
compare_ars | boolean | user.compare_ars(string ars)
3.10
| Verify user meets access requirements string
| adjust_credits | boolean | user.adjust_credits(count)
| 3.14
| Adjust user's credits by count (negative to subtract)
| adjust_minutes | boolean | user.adjust_minutes(count)
| 3.14
| Adjust user's extra minutes count (negative to subtract)
| posted_message | boolean | user.posted_message([count])
| 3.14
| Adjust user's posted-messages statistics by count (default: 1) (negative to subtract)
| sent_email | boolean | user.sent_email([count] [,bool feedback])
| 3.14
| Adjust user's email/feedback-sent statistics by count (default: 1) (negative to subtract)
| uploaded_file | boolean | user.uploaded_file([bytes] [,files])
| 3.14
| Adjust user's files/bytes-uploaded statistics
| downloaded_file | boolean | user.downloaded_file([bytes] [,files])
| 3.14
| Adjust user's files/bytes-downloaded statistics
| |
Name | Type | Ver | Description |
---|---|---|---|
number | number | 3.10 | record number (1-based) |
alias | string | 3.10 | alias/name |
name | string | 3.10 | real name |
handle | string | 3.10 | chat handle |
ip_address | string | 3.10 | IP address last logged on from |
note | string | 3.10 | AKA ip_address |
host_name | string | 3.10 | host name last logged on from |
computer | string | 3.10 | AKA host_name |
comment | string | 3.10 | sysop's comment |
netmail | string | 3.10 | external e-mail address |
string | 3.10 | local Internet e-mail address - READ ONLY | |
address | string | 3.10 | street address |
location | string | 3.10 | location (city, state) |
zipcode | string | 3.10 | zip/postal code |
phone | string | 3.10 | phone number |
birthdate | string | 3.10 | birth date |
age | number | 3.10 | calculated age in years - READ ONLY |
connection | string | 3.10 | connection type |
modem | string | 3.10 | AKA connection |
screen_rows | number | 3.10 | terminal rows (lines) |
gender | string | 3.10 | gender type |
cursub | string | 3.10 | current message sub-board |
curdir | string | 3.10 | current file directory |
curxtrn | string | 3.10 | current external program being run |
editor | string | 3.10 | external message editor |
command_shell | string | 3.10 | command shell |
settings | number | 3.10 | settings bitfield - see USER_* in sbbsdefs.js for bit definitions |
qwk_settings | number | 3.10 | QWK packet settings bitfield - see QWK_* in sbbsdefs.js for bit definitions |
chat_settings | number | 3.10 | chat settings bitfield - see CHAT_* in sbbsdefs.js for bit definitions |
temp_file_ext | string | 3.10 | temporary file type (extension) |
new_file_time | number | 3.11 | new file scan date/time (time_t format) |
download_protocol | string | 3.10 | file transfer protocol (command key) |
logontime | number | 3.10 | logon time (time_t format) |
cached | boolean | 3.14 | record is currently cached in memory |
Name | Type | Ver | Description |
---|---|---|---|
laston_date | number | 3.10 | date of previous logon |
firston_date | number | 3.10 | date of first logon |
total_logons | number | 3.10 | total number of logons |
logons_today | number | 3.10 | total logons today |
total_timeon | number | 3.10 | total time used (in minutes) |
timeon_today | number | 3.10 | time used today |
timeon_last_logon | number | 3.10 | time used last session |
total_posts | number | 3.10 | total messages posted |
total_emails | number | 3.10 | total e-mails sent |
total_feedbacks | number | 3.10 | total feedback messages sent |
email_today | number | 3.10 | e-mail sent today |
posts_today | number | 3.10 | messages posted today |
bytes_uploaded | number | 3.10 | total bytes uploaded |
files_uploaded | number | 3.10 | total files uploaded |
bytes_downloaded | number | 3.10 | total bytes downloaded |
files_downloaded | number | 3.10 | total files downloaded |
leech_attempts | number | 3.10 | suspected leech downloads |
mail_waiting | number | 3.12 | number of e-mail messages currently waiting |
mail_pending | number | 3.12 | number of e-mail messages sent, currently pending deletion |
Name | Type | Ver | Description |
---|---|---|---|
time_per_logon | number | 3.11 | time (in minutes) per logon |
time_per_day | number | 3.11 | time (in minutes) per day |
logons_per_day | number | 3.11 | logons per day |
lines_per_message | number | 3.11 | lines per message (post or email) |
email_per_day | number | 3.11 | email sent per day |
posts_per_day | number | 3.11 | messages posted per day |
free_credits_per_day | number | 3.11 | free credits given per day |
Name | Type | Ver | Description |
---|---|---|---|
password | string | 3.10 | password |
password_date | number | 3.10 | date password last modified (time_t format) |
level | number | 3.10 | security level (0-99) |
flags1 | number | 3.10 | flag set #1 (bitfield) |
flags2 | number | 3.10 | flag set #2 (bitfield) |
flags3 | number | 3.10 | flag set #3 (bitfield) |
flags4 | number | 3.10 | flag set #4 (bitfield) |
exemptions | number | 3.10 | exemption flags (bitfield) |
restrictions | number | 3.10 | restriction flags (bitfield) |
credits | number | 3.10 | credits |
free_credits | number | 3.10 | free credits (for today only) |
minutes | number | 3.10 | extra minutes (time bank) |
extra_time | number | 3.10 | extra minutes (for today only) |
expiration_date | number | 3.10 | expiration date/time (time_t format) |
Name | Returns | Usage | Ver | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
atcode | string | bbs.atcode(code_string)
3.10
| returns @-code value, specified code string does not include @ character delimiters
| text | string | bbs.text(line_number)
| 3.10
| returns specified text string from text.dat
| replace_text | boolean | bbs.replace_text(line_number, string text)
| 3.10
| replaces specified text string in memory
| revert_text | boolean | bbs.revert_text([line_number=all])
| 3.10
| reverts specified text string to original text string; if line_number unspecified, reverts all text lines
| load_text | boolean | bbs.load_text(base_filename)
| 3.10
| load an alternate text.dat from ctrl directory, automatically appends '.dat' to basefilename
| newuser | void | bbs.newuser()
| 3.10
| interactive new user procedure
| login | boolean | bbs.login(user_name, password_prompt)
| 3.10
| login with user_name, displaying password_prompt for password (if required)
| logon | boolean | bbs.logon()
| 3.10
| interactive logon procedure
| logoff | void | bbs.logoff()
| 3.10
| interactive logoff procedure
| logout | void | bbs.logout()
| 3.10
| non-interactive logout procedure
| hangup | void | bbs.hangup()
| 3.10
| hangup (disconnect) immediately
| nodesync | void | bbs.nodesync()
| 3.10
| synchronize with node database, checks for messages, interruption, etc. (AKA node_sync)
| auto_msg | void | bbs.auto_msg()
| 3.10
| read/create system's auto-message
| time_bank | void | bbs.time_bank()
| 3.10
| enter the time banking system
| qwk_sec | void | bbs.qwk_sec()
| 3.10
| enter the QWK message packet upload/download/config section
| text_sec | void | bbs.text_sec()
| 3.10
| enter the text files section
| xtrn_sec | void | bbs.xtrn_sec()
| 3.10
| enter the external programs section
| xfer_policy | void | bbs.xfer_policy()
| 3.10
| display the file transfer policy
| batch_menu | void | bbs.batch_menu()
| 3.10
| enter the batch file transfer menu
| batch_download | boolean | bbs.batch_download()
| 3.10
| start a batch download
| batch_add_list | void | bbs.batch_add_list(list_filename)
| 3.10
| add file list to batch download queue
| send_file | boolean | bbs.send_file(filename [,protocol])
| 3.14
| send specified filename (complete path) to user via user-prompted (or optionally specified) protocol
| receive_file | boolean | bbs.receive_file(filename [,protocol])
| 3.14
| received specified filename (complete path) frome user via user-prompted (or optionally specified) protocol
| temp_xfer | void | bbs.temp_xfer()
| 3.10
| enter the temporary file tranfer menu
| user_sync | void | bbs.user_sync()
| 3.10
| read the current user data from the database
| user_config | void | bbs.user_config()
| 3.10
| enter the user settings configuration menu
| sys_info | void | bbs.sys_info()
| 3.10
| display system information
| sub_info | void | bbs.sub_info([sub-board=current])
| 3.10
| display message sub-board information (current sub-board, if unspecified)
| dir_info | void | bbs.dir_info([directory=current])
| 3.10
| display file directory information (current directory, if unspecified)
| user_info | void | bbs.user_info()
| 3.10
| display current user information
| ver | void | bbs.ver()
| 3.10
| display software version information
| sys_stats | void | bbs.sys_stats()
| 3.10
| display system statistics
| node_stats | void | bbs.node_stats([node_number=current])
| 3.10
| display current (or specified) node statistics
| list_users | void | bbs.list_users([mode=UL_ALL])
| 3.10
| display user list(see UL_* in sbbsdefs.js for valid mode values)
| edit_user | void | bbs.edit_user([user_number=current])
| 3.10
| enter the user editor
| change_user | void | bbs.change_user()
| 3.10
| change to a different user
| list_logons | void | bbs.list_logons()
| 3.10
| display the logon list
| read_mail | void | bbs.read_mail([which=MAIL_YOUR] [,user_number=current])
| 3.10
| read private e-mail(see MAIL_* in sbbsdefs.js for valid which values)
| email | boolean | bbs.email(to_user_number [,mode=WM_EMAIL] [,top=none] [,subject=none])
| 3.10
| send private e-mail to a local user
| netmail | boolean | bbs.netmail(address [,mode=WM_NONE] [,subject=none])
| 3.10
| send private netmail
| bulk_mail | void | bbs.bulk_mail([ars])
| 3.10
| send bulk private e-mail, if ars not specified, prompt for destination users
| upload_file | boolean | bbs.upload_file([directory=current])
| 3.10
| upload file to file directory specified by number or internal code
| bulk_upload | boolean | bbs.bulk_upload([directory=current])
| 3.10
| add files (already in local storage path) to file directory specified by number or internal code
| resort_dir | boolean | bbs.resort_dir([directory=current])
| 3.10
| re-sort the file directory specified by number or internal code)
| list_files | number | bbs.list_files([directory=current] [,filespec="*.*" or search_string] [,mode=FL_NONE])
| 3.10
| list files in the specified file directory, optionally specifying a file specification (wildcards) or a description search string, and mode (bitfield)
| list_file_info | number | bbs.list_file_info([directory=current] [,filespec="*.*"] [,mode=FI_INFO])
| 3.10
| list extended file information for files in the specified file directory
| post_msg | boolean | bbs.post_msg([sub-board=current] [,mode=WM_MODE] [,object reply_header])
| 3.13
| post a message in the specified message sub-board (number or internal code) with optinal mode (bitfield) | If reply_header is specified (a header object returned from MsgBase.get_msg_header()), that header will be used for the in-reply-to header fields (this argument added in v3.13) cfg_msg_scan | void | bbs.cfg_msg_scan([type=SCAN_CFG_NEW])
| 3.10
| configure message scan (type is either SCAN_CFG_NEW or SCAN_CFG_TOYOU)
| cfg_msg_ptrs | void | bbs.cfg_msg_ptrs()
| 3.10
| change message scan pointer values
| reinit_msg_ptrs | void | bbs.reinit_msg_ptrs()
| 3.10
| re-initialize new message scan pointers
| scan_subs | void | bbs.scan_subs([mode=SCAN_NEW] [,all=false])
| 3.10
| scan sub-boards for messages
| scan_dirs | void | bbs.scan_dirs([mode=FL_NONE] [,all=false])
| 3.10
| scan directories for files
| scan_msgs | boolean | bbs.scan_msgs([sub-board=current] [,mode=SCAN_READ] [,string find])
| 3.10
| scan messages in the specified message sub-board (number or internal code), optionally search for 'find' string (AKA scan_posts)
| list_msgs | number | bbs.list_msgs([sub-board=current] [,mode=SCAN_READ] [,message_number=0] [,string find])
| 3.14
| list messages in the specified message sub-board (number or internal code), optionally search for 'find' string, returns number of messages listed
| menu | void | bbs.menu(base_filename)
| 3.10
| display a menu file from the text/menu directory
| log_key | boolean | bbs.log_key(key [,comma=false])
| 3.10
| log key to node.log (comma optional)
| log_str | boolean | bbs.log_str(text)
| 3.10
| log string to node.log
| finduser | number | bbs.finduser(username_or_number)
| 3.10
| find user name (partial name support), interactive
| trashcan | boolean | bbs.trashcan(base_filename, search_string)
| 3.10
| search file for psuedo-regexp (search string) in trashcan file (text/base_filename.can)
| exec | number | bbs.exec(cmdline [,mode=EX_NONE] [,string startup_dir])
| 3.10
| 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)
| 3.10
| execute external program by number or internal code
| user_event | boolean | bbs.user_event(event_type)
| 3.10
| execute user event by event type (see EVENT_* in sbbsdefs.js for valid values)
| telnet_gate | void | bbs.telnet_gate(address [,mode=TG_NONE])
| 3.10
| external telnet/rlogin gateway (see TG_* in sbbsdefs.js for valid mode bits)
| check_syspass | boolean | bbs.check_syspass()
| 3.10
| prompt for and verify system password
| good_password | string | bbs.good_password(password)
| 3.10
| check if requested user password meets minimum password requirements (length, uniqueness, etc.)
| page_sysop | boolean | bbs.page_sysop()
| 3.10
| page the sysop for chat, returns false if the sysop could not be paged
| page_guru | boolean | bbs.page_guru()
| 3.10
| page the guru for chat
| multinode_chat | void | bbs.multinode_chat()
| 3.10
| enter multi-node chat
| private_message | void | bbs.private_message()
| 3.10
| use the private inter-node message prompt
| private_chat | void | bbs.private_chat([local=false])
| 3.10
| enter private inter-node chat, or local sysop chat (if local=true)
| get_node_message | void | bbs.get_node_message()
| 3.10
| receive and display an inter-node message
| put_node_message | boolean | bbs.put_node_message(node_number, text)
| 3.10
| send an inter-node message
| get_telegram | void | bbs.get_telegram([user_number=current])
| 3.10
| receive and display waiting telegrams for specified (or current) user
| put_telegram | boolean | bbs.put_telegram(user_number, text)
| 3.10
| send a telegram to a user
| list_nodes | void | bbs.list_nodes()
| 3.10
| list all nodes
| whos_online | void | bbs.whos_online()
| 3.10
| list active nodes only (who's online)
| spy | void | bbs.spy(node_number)
| 3.10
| spy on a node
| cmdstr | string | bbs.cmdstr(command_string [,string fpath=""] [,string fspec=""])
| 3.10
| return expanded command string using Synchronet command-line specifiers
| get_filespec | string | bbs.get_filespec()
| 3.10
| returns a file specification input by the user (optionally with wildcards)
| get_newscantime | number | bbs.get_newscantime(time=current)
| 3.10
| confirm or change a new-scan time, returns the new new-scan time value (time_t format)
| select_shell | boolean | bbs.select_shell()
| 3.10
| prompt user to select a new command shell
| select_editor | boolean | bbs.select_editor()
| 3.10
| prompt user to select a new external message editor
| |
Name | Type | Ver | Description |
---|---|---|---|
sys_status | number | 3.10 | system status bitfield (see SS_* in sbbsdefs.js for bit definitions) |
startup_options | number | 3.10 | startup options bitfield (see BBS_OPT_* in sbbsdefs.js for bit definitions) |
answer_time | number | 3.10 | answer time, in time_t format |
logon_time | number | 3.10 | logon time, in time_t format |
start_time | number | 3.14 | time from which user's time left is calculated, in time_t format |
new_file_time | number | 3.10 | current file new-scan time, in time_t format |
last_new_file_time | number | 3.10 | previous file new-scan time, in time_t format |
online | number | 3.10 | online (see ON_* in sbbsdefs.js for valid values) |
time_left | number | 3.11 | time left (in seconds) |
event_time | number | 3.11 | time of next exclusive event (in time_t format), or 0 if none |
event_code | string | 3.11 | internal code of next exclusive event |
node_num | number | 3.10 | current node number |
node_settings | number | 3.10 | current node settings bitfield (see NM_* in sbbsdefs.js for bit definitions) |
node_action | number | 3.10 | current node action (see nodedefs.js for valid values) |
node_val_user | number | 3.10 | validation feedback user for this node (or 0 for no validation feedback required) |
logon_ulb | number | 3.10 | bytes uploaded during this session |
logon_dlb | number | 3.10 | bytes downloaded during this session |
logon_uls | number | 3.10 | files uploaded during this session |
logon_dls | number | 3.10 | files downloaded during this session |
logon_posts | number | 3.10 | messages posted during this session |
logon_emails | number | 3.10 | e-mails sent during this session |
logon_fbacks | number | 3.10 | feedback messages sent during this session |
posts_read | number | 3.10 | messages read during this session |
menu_dir | string | 3.10 | menu subdirectory (overrides default) |
menu_file | string | 3.10 | menu file (overrides default) |
main_cmds | number | 3.10 | total main menu commands received from user during this session |
file_cmds | number | 3.10 | total file menu commands received from user during this session |
curgrp | number | 3.10 | current message group |
cursub | number | 3.10 | current message sub-board |
cursub_code | string | 3.14 | current message sub-board internal code |
curlib | number | 3.10 | current file library |
curdir | number | 3.10 | current file directory |
curdir_code | string | 3.14 | current file directory internal code |
connection | string | 3.10 | remote connection type |
rlogin_name | string | 3.10 | rlogin name |
client_name | string | 3.10 | client name |
alt_ul_dir | number | 3.10 | current alternate upload path number |
errorlevel | number | 3.12 | error level returned from last executed external program |
smb_group | string | 3.10 | message group name of message being read |
smb_group_desc | string | 3.10 | message group description of message being read |
smb_group_number | number | 3.10 | message group number of message being read |
smb_sub | string | 3.10 | sub-board name of message being read |
smb_sub_desc | string | 3.10 | sub-board description of message being read |
smb_sub_code | string | 3.10 | sub-board internal code of message being read |
smb_sub_number | number | 3.10 | sub-board number of message being read |
smb_attr | number | 3.10 | message base attributes |
smb_last_msg | number | 3.10 | highest message number in message base |
smb_total_msgs | number | 3.10 | total number of messages in message base |
smb_msgs | number | 3.10 | number of messages loaded from message base |
smb_curmsg | number | 3.10 | current message number in message base |
msg_to | string | 3.10 | message recipient name |
msg_to_ext | string | 3.10 | message recipient extension |
msg_to_net | string | 3.10 | message recipient network type |
msg_to_agent | number | 3.10 | message recipient agent type |
msg_from | string | 3.10 | message sender name |
msg_from_ext | string | 3.10 | message sender extension |
msg_from_net | string | 3.10 | message sender network type |
msg_from_agent | number | 3.10 | message sender agent type |
msg_replyto | string | 3.10 | message reply-to name |
msg_replyto_ext | string | 3.10 | message reply-to extension |
msg_replyto_net | string | 3.10 | message reply-to network type |
msg_replyto_agent | number | 3.10 | message reply-to agent type |
msg_subject | string | 3.10 | message subject |
msg_date | number | 3.10 | message date/time |
msg_timezone | number | 3.10 | message time zone |
msg_date_imported | number | 3.10 | message date/time imported |
msg_attr | number | 3.10 | message attributes |
msg_auxattr | number | 3.10 | message auxillary attributes |
msg_netattr | number | 3.10 | message network attributes |
msg_offset | number | 3.10 | message header offset |
msg_number | number | 3.10 | message number |
msg_expiration | number | 3.10 | message expiration |
msg_forwarded | number | 3.10 | message forwarded |
msg_thread_back | number | 3.12 | message thread, back message number (AKA msg_thread_orig) |
msg_thread_next | number | 3.10 | message thread, next message number |
msg_thread_first | number | 3.10 | message thread, first reply to this message |
msg_id | string | 3.10 | message identifier |
msg_reply_id | string | 3.10 | message replied-to identifier |
msg_delivery_attempts | number | 3.10 | message delivery attempt counter |
batch_upload_total | number | 3.10 | number of files in batch upload queue |
batch_dnload_total | number | 3.10 | number of files in batch download queue |
command_str | string | 3.14 | current command shell/module command string value |
Name | Returns | Usage | Ver | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
inkey | string | console.inkey([mode=K_NONE] [,timeout=0])
3.11
| 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([mode=K_NONE])
| 3.10
| get a single key, with wait, see K_* in sbbsdefs.js for mode bits
| getstr | string | console.getstr([string] [,maxlen=128] [,mode=K_NONE])
| 3.10
| get a text string from the user, see K_* in sbbsdefs.js for mode bits
| getnum | number | console.getnum([maxnum])
| 3.10
| get a number between 1 and maxnum from the user
| getkeys | number | console.getkeys(string keys [,maxnum])
| 3.10
| 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=0])
| 3.10
| get a string based on template
| ungetstr | void | console.ungetstr()
| 3.10
| put a string in the keyboard buffer
| yesno | boolean | console.yesno(question)
| 3.10
| YES/no question
| noyes | boolean | console.noyes(question)
| 3.10
| NO/yes question
| mnemonics | void | console.mnemonics(text)
| 3.10
| print a mnemonics string, command keys highlighted with tilde (~) characters
| clear | void | console.clear([attribute])
| 3.10
| clear screen and home cursor, optionally (in v3.13b+) setting current attribute first
| home | void | console.home()
| 3.11
| send cursor to home position (x,y:1,1)
| clearline | void | console.clearline([attribute])
| 3.10
| clear current line, optionally (in v3.13b+) setting current attribute first
| cleartoeol | void | console.cleartoeol([attribute])
| 3.11
| clear to end-of-line (ANSI), optionally (in v3.13b+) setting current attribute first
| crlf | void | console.crlf()
| 3.10
| output a carriage-return/line-feed pair (new-line)
| pause | void | console.pause()
| 3.10
| display pause prompt and wait for key hit
| beep | void | console.beep([count=1])
| 3.11
| beep for count number of times (default count is 1)
| print | void | console.print(text)
| 3.10
| display a string (supports Ctrl-A codes)
| write | void | console.write(text)
| 3.10
| display a raw string
| putmsg | void | console.putmsg(text [,mode=P_NONE])
| 3.10
| display message text (Ctrl-A codes, @-codes, pipe codes, etc), see P_* in sbbsdefs.js for mode bits
| center | void | console.center(text)
| 3.10
| display a string centered on the screen
| strlen | number | console.strlen(text)
| 3.10
| returns the number of characters in text, excluding Ctrl-A codes
| printfile | void | console.printfile(filename [,mode=P_NONE])
| 3.10
| print a message text file with optional mode
| printtail | void | console.printtail(filename, lines [,mode=P_NONE])
| 3.10
| print last x lines of file with optional mode
| editfile | void | console.editfile(filename)
| 3.10
| edit/create a text file using the user's preferred message editor
| uselect | number | console.uselect([number, title, item] [,ars])
| 3.12
| user selection menu, call for each item, then with no args to display select menu
| saveline | void | console.saveline()
| 3.10
| save last output line
| restoreline | void | console.restoreline()
| 3.10
| restore last output line
| ansi | string | console.ansi(attribute_number)
| 3.10
| returns ANSI encoding of specified attribute_number
| pushxy | void | console.pushxy()
| 3.11
| save current cursor position (AKA ansi_save)
| popxy | void | console.popxy()
| 3.11
| restore saved cursor position (AKA ansi_restore)
| gotoxy | void | console.gotoxy([x,y] or [object { x,y }])
| 3.11
| 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([rows=1])
| 3.11
| move cursor up one or more rows (ANSI)
| down | void | console.down([rows=1])
| 3.11
| move cursor down one or more rows (ANSI)
| right | void | console.right([columns=1])
| 3.11
| move cursor right one or more columns (ANSI)
| left | void | console.left([columns=1])
| 3.11
| move cursor left one or more columns (ANSI)
| getlines | void | console.getlines()
| 3.11
| auto-detect the number of rows/lines on the user's terminal (ANSI)
| getxy | object | console.getxy()
| 3.11
| returns the current cursor position as an object (with x and y properties)
| lock_input | void | console.lock_input([lock=true])
| 3.10
| lock the user input thread (allowing direct client socket access)
| telnet_cmd | void | console.telnet_cmd(command [,option=0])
| 3.10
| send Telnet command (with optional command option) to remote client
| handle_ctrlkey | boolean | console.handle_ctrlkey(key [,mode=K_NONE])
| 3.11
| call internal control key handler for specified control key, returns true if handled
| term_supports | boolean | console.term_supports([terminal_flags])
| 3.14
| either returns bool, indicating whether or not the current user/client supports all the specified terminal_flags, or returns the current user/client's terminal_flags (numeric bit-field) if no terminal_flags were specified
| |
Name | Type | Ver | Description |
---|---|---|---|
status | number | 3.10 | status bitfield (see CON_* in sbbsdefs.js for bit definitions) |
line_counter | number | 3.10 | current line counter (used for automatic screen pause) |
attributes | number | 3.10 | current display attributes (set with number or string value) |
top_of_screen | number | 3.10 | set to 1 if the terminal cursor is already at the top of the screen |
screen_rows | number | 3.10 | number of terminal screen rows (in lines) |
screen_columns | number | 3.11 | number of terminal screen columns (in character cells) |
autoterm | number | 3.10 | bitfield of automatically detected terminal settings (see USER_* in sbbsdefs.js for bit definitions) |
terminal | string | 3.11 | terminal type description (e.g. 'ANSI') |
timeout | number | 3.10 | user inactivity timeout reference |
timeleft_warning | number | 3.10 | low timeleft warning flag |
aborted | boolean | 3.10 | input/output has been aborted |
abortable | boolean | 3.10 | output can be aborted with Ctrl-C |
telnet_mode | number | 3.10 | current telnet mode bitfield (see TELNET_MODE_* in sbbsdefs.js for bit definitions) |
wordwrap | string | 3.10 | word-wrap buffer (used by getstr) - READ ONLY |
question | string | 3.10 | current yes/no question (set by yesno and noyes) |
getstr_offset | number | 3.11 | cursor position offset for use with getstr(K_USEOFFSET) |
ctrlkey_passthru | number | 3.10 | control key pass-through bitmask, set bits represent control key combinations not handled by inkey() method This may optionally be specified as a string of characters. The format of this string is [+-][@-_]. If neither plus nor minus is the first character, the value will be replaced by one constructed from the string. A + indicates that characters following will be added to the set, and a - indicates they should be removed. ex: console.ctrlkey_passthru="-UP+AB" will clear CTRL-U and CTRL-P and set CTRL-A and CTRL-B. |
input_buffer_level | number | 3.12 | number of bytes currently in the input buffer (from the remote client) - READ ONLY |
input_buffer_space | number | 3.12 | number of bytes available in the input buffer - READ ONLY |
output_buffer_level | number | 3.12 | number of bytes currently in the output buffer (from the local server) - READ ONLY |
output_buffer_space | number | 3.12 | number of bytes available in the output buffer - READ ONLY |
Name | Type | Description |
---|---|---|
index | number | index into grp_list array (or -1 if not in array) (introduced in v3.12) |
number | number | unique number for this message group |
name | string | group name |
description | string | group description |
ars | string | group access requirements |
Name | Type | Description |
---|---|---|
index | number | index into sub_list array (or -1 if not in array) (introduced in v3.12) |
grp_index | number | group's index into grp_list array (introduced in v3.12) |
number | number | unique number for this sub-board |
grp_number | number | group number |
grp_name | string | group name (introduced in v3.12) |
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 (highest-read message number) |
scan_cfg | number | user's message scan configuration (bitfield) see SCAN_CFG_* in sbbsdefs.js for valid bits |
lead_read | number | user's last-read message number |
Name | Type | Description |
---|---|---|
min_diskspace | number | minimum amount of available disk space (in bytes) required for user uploads to be allowed |
settings | number | file area settings (bitfield) - see FM_* in sbbsdefs.js for details |
Name | Type | Description |
---|---|---|
index | number | index into lib_list array (or -1 if not in array) (introduced in v3.12) |
number | number | unique number for this library |
name | string | library name |
description | string | library description |
ars | string | library access requirements |
link | string | library link (for HTML index) |
Name | Type | Description |
---|---|---|
index | number | index into dir_list array (or -1 if not in array) (introduced in v3.12) |
number | number | unique number for this directory |
lib_index | number | library index (introduced in v3.12) |
lib_number | number | library number |
lib_name | string | library name (introduced in v3.12) |
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 |
is_offline | boolean | directory is for offline storage (introduced in v3.14) |
is_upload | boolean | directory is for uploads only (introduced in v3.14) |
is_sysop | boolean | directory is for uploads to sysop only (introduced in v3.14) |
Name | Type | Description |
---|---|---|
index | number | index into sec_list array (or -1 if not in index) (introduced in v3.12) |
number | number | unique number for this external program section |
code | string | external program section internal code |
name | string | external program section name |
ars | string | external program section access requirements |
Name | Type | Description |
---|---|---|
index | number | index into prog_list array (or -1 if not in index) (introduced in v3.12) |
number | number | program number |
sec_index | number | program section index (introduced in v3.12) |
sec_number | number | program section number |
sec_code | string | program section internal code (introduced in v3.12) |
code | string | internal code |
name | string | name |
cmd | string | command-line |
clean_cmd | string | clean-up command-line |
startup_dir | string | startup directory |
ars | string | access requirements |
execution_ars | string | execution requirements |
settings | number | toggle options (bitfield) |
type | number | drop file type |
event | number | event type (0=none) |
textra | number | extra time given to users running this program |
max_time | number | maximum time allowed in program |
cost | number | execution cost (credits to run this program) |
can_run | boolean | user has sufficient access to run this program |
Name | Type | Description |
---|---|---|
cmd | string | command-line |
startup_dir | string | startup directory |
node_num | number | node number |
time | number | time to execute |
freq | number | frequency to execute |
days | number | days of week to execute (bitfield) |
mdays | number | days of month to execute (bitfield) |
last_run | number | date/time last run (in time_t format) |
settings | number | toggle options (bitfield) |
Name | Type | Description |
---|---|---|
name | string | name |
cmd | string | command-line |
ars | string | access requirements |
settings | number | toggle options (bitfield) |
type | number | drop file type |
To create a new MsgBase object: var msgbase = new MsgBase('code')
where code is a sub-board internal code, or mail for the e-mail message base
Name | Returns | Usage | Ver | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
open | boolean | MsgBase.open()
3.10
| open message base
| close | boolean | MsgBase.close()
| 3.10
| close message base (if open)
| get_msg_header | object | MsgBase.get_msg_header([by_offset=false,] number_or_id [,expand_fields=true])
| 3.12
| returns a specific message header, null on failure. | New in v3.12: Pass false for the expand_fields argument (default: true) if you will be re-writing the header later with put_msg_header() put_msg_header | boolean | MsgBase.put_msg_header([by_offset=false,] number, object header)
| 3.10
| write a message header
| get_msg_body | string | MsgBase.get_msg_body([by_offset=false,] number_or_id [,strip_ctrl_a=false] [,rfc822_encoded=false] [,include_tails=true])
| 3.10
| returns the body text of a specific message, null on failure. The default behavior is to leave Ctrl-A codes intact, perform no RFC-822 encoding, and to include tails (if any) in the returned body text.
| get_msg_tail | string | MsgBase.get_msg_tail([by_offset=false,] number_or_id [,strip_ctrl_a]=false)
| 3.10
| returns the tail text of a specific message, null on failure
| get_msg_index | object | MsgBase.get_msg_index([by_offset=false,] number)
| 3.11
| returns a specific message index, null on failure. The index object will contain the following properties: |
remove_msg | boolean | MsgBase.remove_msg([by_offset=false,] number_or_id)
| 3.11
| mark message for deletion
| save_msg | boolean | MsgBase.save_msg(object header [,client=none] [,body_text=""] [,array rcpt_list=none])
| 3.12
| create a new message in message base, the header object may contain the following properties: |
New in v3.12: The optional client argument is an instance of the Client class to be used for the security log header fields (e.g. sender IP address, hostname, protocol, and port). New in v3.12: The optional rcpt_list is an array of objects that specifies multiple recipients for a single message (e.g. bulk e-mail). Each object in the array may include the following header properties (described above): to, to_ext, to_org, to_net_type, to_net_addr, and to_agent |
Name | Type | Ver | Description |
---|---|---|---|
error | string | 3.10 | last occurred message base error - READ ONLY |
status | number | 3.12 | return value of last SMB Library function call - READ ONLY |
file | string | 3.10 | base path and filename of message base - READ ONLY |
retry_time | number | 3.10 | message base open/lock retry timeout (in seconds) |
retry_delay | number | 3.11 | delay between message base open/lock retries (in milliseconds) |
first_msg | number | 3.10 | first message number - READ ONLY |
last_msg | number | 3.10 | last message number - READ ONLY |
total_msgs | number | 3.10 | total number of messages - READ ONLY |
max_crcs | number | 3.10 | maximum number of message CRCs to store (for dupe checking) - READ ONLY |
max_msgs | number | 3.10 | maximum number of messages before expiration - READ ONLY |
max_age | number | 3.10 | maximum age (in days) of messages to store - READ ONLY |
attributes | number | 3.10 | message base attributes - READ ONLY |
subnum | number | 3.10 | sub-board number (0-based, -1 for e-mail) - READ ONLY |
is_open | boolean | 3.10 | true if the message base has been opened successfully - READ ONLY |
Name | Type | Description |
---|---|---|
index | undefined | index into sub_list array (or -1 if not in array) (introduced in v3.12) |
grp_index | undefined | group's index into grp_list array (introduced in v3.12) |
number | number | unique number for this sub-board |
grp_number | number | group number |
grp_name | string | group name (introduced in v3.12) |
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 |
Special features include:
To create a new File object: var f = new File(filename)
Name | Returns | Usage | Ver | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
open | boolean | File.open([mode="w+"] [,shareable=false] [,buffer_length])
3.10
| open file, shareable defaults to false, buffer_length defaults to 2048 bytes, mode (default: 'w+') specifies the type of access requested for the file, as follows: | r  open for reading; if the file does not exist or cannot be found, the open call fails w  open an empty file for writing; if the given file exists, its contents are destroyed a  open for writing at the end of the file (appending); creates the file first if it doesn’t exist r+ open for both reading and writing (the file must exist) w+ open an empty file for both reading and writing; if the given file exists, its contents are destroyed a+ open for reading and appending b  open in binary (untranslated) mode; translations involving carriage-return and linefeed characters are suppressed (e.g. r+b) e  open a non-shareable file (that must not already exist) for exclusive access (introduced in v3.12) Note: When using the iniSet methods to modify a .ini file, the file must be opened for both reading and writing. Note: To open an existing or create a new file for both reading and writing, use the file_exists function like so: file.open(file_exists(file.name) ? 'r+':'w+'); close | void | File.close()
| 3.10
| close file
| remove | boolean | File.remove()
| 3.10
| remove the file from the disk
| clear_error | boolean | File.clear_error()
| 3.10
| clears the current error value (AKA clearError)
| flush | boolean | File.flush()
| 3.10
| flush/commit buffers to disk
| rewind | boolean | File.rewind()
| 3.11
| repositions the file pointer (position) to the beginning of a file and clears error and end-of-file indicators
| truncate | boolean | File.truncate([length=0])
| 3.14
| changes the file length (default: 0) and repositions the file pointer (position) to the new end-of-file
| lock | boolean | File.lock([offset=0] [,length=file_length-offset])
| 3.10
| lock file record for exclusive access (file must be opened shareable)
| unlock | boolean | File.unlock([offset=0] [,length=file_length-offset])
| 3.10
| unlock file record for exclusive access
| read | string | File.read([maxlen=file_length-file_position])
| 3.10
| read a string from file (optionally unix-to-unix or base64 decoding in the process), maxlen defaults to the current length of the file minus the current file position
| readln | string | File.readln([maxlen=512])
| 3.10
| read a line-feed terminated string, maxlen defaults to 512 characters
| readBin | number | File.readBin([bytes=4])
| 3.10
| read a binary integer from the file, default number of bytes is 4 (32-bits)
| readAll | array | File.readAll([maxlen=512])
| 3.10
| read all lines into an array of strings, maxlen defaults to 512 characters
| write | boolean | File.write(text [,length=text_length])
| 3.10
| write a string to the file (optionally unix-to-unix or base64 decoding in the process)
| writeln | boolean | File.writeln([text])
| 3.10
| write a line-feed terminated string to the file
| writeBin | boolean | File.writeBin(value [,bytes=4])
| 3.10
| write a binary integer to the file, default number of bytes is 4 (32-bits)
| writeAll | boolean | File.writeAll(array lines)
| 3.10
| write an array of strings to file
| printf | number | File.printf(format [,args])
| 3.10
| write a formatted string to the file (ala fprintf) - CAUTION: for experienced C programmers ONLY
| iniGetSections | array | File.iniGetSections([prefix=none])
| 3.11
| parse all section names from a .ini file (format = '[section]') and return the section names as an array of strings, optionally, only those section names that begin with the specified prefix
| iniGetKeys | array | File.iniGetKeys([section=root])
| 3.11
| parse all key names from the specified section in a .ini file and return the key names as an array of strings. if section is undefined, returns key names from the root section
| iniGetValue | undefined | File.iniGetValue(section, key [,default=none])
| 3.11
| parse a key from a .ini file and return its value (format = 'key = value'). returns the specified default value if the key or value is missing or invalid. to parse a key from the root section, pass null for section. will return a bool, number, string, or an array of strings determined by the type of default value specified
| iniSetValue | boolean | File.iniSetValue(section, key, [value=none])
| 3.12
| set the specified key to the specified value in the specified section of a .ini file. to set a key in the root section, pass null for section.
| iniGetObject | object | File.iniGetObject([section=root])
| 3.11
| parse an entire section from a .ini file and return all of its keys and values as properties of an object. if section is undefined, returns key and values from the root section
| iniSetObject | boolean | File.iniSetObject(section, object)
| 3.12
| write all the properties of the specified object as separate key=value pairs in the specified section of a .ini file. to write an object in the root section, pass null for section.
| iniGetAllObjects | array | File.iniGetAllObjects([name_property] [,prefix=none])
| 3.11
| parse all sections from a .ini file and return all (non-root) sections in an array of objects with each section's keys as properties of each object. name_property is the name of the property to create to contain the section's name (default is "name"), the optional prefix has the same use as in the iniGetSections method, if a prefix is specified, it is removed from each section's name
| iniSetAllObjects | array | File.iniSetAllObjects(object array [,name_property="name"])
| 3.12
| write an array of objects to a .ini file, each object in its own section named after the object's name_property (default: name)
| iniRemoveKey | boolean | File.iniRemoveKey(section, key)
| 3.14
| remove specified key from specified section in .ini file.
| iniRemoveSection | boolean | File.iniRemoveSection(section)
| 3.14
| remove specified section from .ini file.
| |
Name | Type | Ver | Description |
---|---|---|---|
name | string | 3.10 | filename specified in constructor - READ ONLY |
mode | string | 3.10 | mode string specified in open call - READ ONLY |
exists | boolean | 3.10 | true if the file exists - READ ONLY |
is_open | boolean | 3.10 | true if the file has been opened successfully - READ ONLY |
eof | boolean | 3.10 | true if the current file position is at the end of file - READ ONLY |
error | number | 3.10 | the last occurred error value (use clear_error to clear) - READ ONLY |
descriptor | number | 3.10 | the open file descriptor (advanced use only) - READ ONLY |
etx | number | 3.10 | end-of-text character (advanced use only), if non-zero used by read, readln, and write |
debug | boolean | 3.10 | set to true to enable debug log output |
position | number | 3.10 | the current file position (offset in bytes), change value to seek within file |
date | number | 3.11 | last modified date/time (in time_t format) |
length | number | 3.10 | the current length of the file (in bytes) |
attributes | number | 3.10 | file mode/attributes |
network_byte_order | boolean | 3.11 | set to true if binary data is to be written and read in Network Byte Order (big end first) |
rot13 | boolean | 3.11 | set to true to enable automatic ROT13 translatation of text |
uue | boolean | 3.11 | set to true to enable automatic Unix-to-Unix encode and decode on read and write calls |
yenc | boolean | 3.11 | set to true to enable automatic yEnc encode and decode on read and write calls |
base64 | boolean | 3.11 | set to true to enable automatic Base64 encode and decode on read and write calls |
crc16 | number | 3.11 | calculated 16-bit CRC of file contents - READ ONLY |
crc32 | number | 3.11 | calculated 32-bit CRC of file contents - READ ONLY |
chksum | number | 3.11 | calculated 32-bit checksum of file contents - READ ONLY |
md5_hex | undefined | 3.11 | calculated 128-bit MD5 digest of file contents as hexadecimal string - READ ONLY |
md5_base64 | undefined | 3.11 | calculated 128-bit MD5 digest of file contents as base64-encoded string - READ ONLY |
To create a new (named) Queue object: var q = new Queue(name)
Name | Returns | Usage | Ver | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
poll | undefined | Queue.poll([timeout=0])
3.12
| wait for any value to be written to the queue for up to timeout milliseconds (default: 0), returns true or the name (string) of the value waiting (if it has one), or false if no values are waiting
| read | undefined | Queue.read([string name] or [timeout=0])
| 3.13
| read a value from the queue, if name not specified, reads next value from the bottom of the queue (waiting up to timeout milliseconds)
| peek | undefined | Queue.peek([timeout=0])
| 3.13
| peek at the value at the bottom of the queue, wait up to timeout milliseconds for any value to be written (default: 0)
| write | boolean | Queue.write(value [,name=none])
| 3.12
| write a value (optionally named) to the queue
| |
Name | Type | Ver | Description |
---|---|---|---|
name | undefined | 3.12 | name of the queue (if it has one) |
data_waiting | boolean | 3.12 | true if data is waiting to be read from queue |
read_level | number | 3.12 | number of values in the read queue |
write_level | number | 3.12 | number of values in the write qeueue |
To create a new Socket object: load('sockdefs.js'); var s = new Socket(type, protocol)
where type = SOCK_STREAM for TCP (default) or SOCK_DGRAM for UDP
and protocol (optional) = the name of the protocol or service the socket is to be used for
Name | Returns | Usage | Ver | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
close | void | Socket.close()
3.10
| close (shutdown) the socket immediately
| bind | boolean | Socket.bind([port] [,ip_address])
| 3.11
| bind socket to a TCP or UDP port (number or service name), optionally specifying a network interface (via ip_address)
| connect | boolean | Socket.connect(host, port [,timeout=10.0])
| 3.11
| connect to a remote port (number or service name) on the specified host (IP address or host name), default timeout value is 10.0 (seconds)
| listen | boolean | Socket.listen()
| 3.10
| place socket in a state to listen for incoming connections (use before an accept)
| accept | object | Socket.accept()
| 3.10
| accept an incoming connection, returns a new Socket object representing the new connection
| send | boolean | Socket.send(data)
| 3.10
| send a string (AKA write)
| sendto | boolean | Socket.sendto(data, address, port)
| 3.10
| send data to a specific host (IP address or host name) and port (number or service name), for UDP sockets
| sendfile | boolean | Socket.sendfile(path/filename)
| 3.10
| send an entire file over the socket
| sendBin | boolean | Socket.sendBin(value [,bytes=4])
| 3.11
| send a binary integer over the socket, default number of bytes is 4 (32-bits)
| recv | string | Socket.recv([maxlen=512])
| 3.10
| receive a string, default maxlen is 512 characters (AKA read)
| peek | string | Socket.peek([maxlen=512])
| 3.10
| receive a string, default maxlen is 512 characters, leaves string in receive buffer
| recvline | string | Socket.recvline([maxlen=512] [,timeout=30.0])
| 3.10
| receive a line-feed terminated string, default maxlen is 512 characters, default timeout is 30 seconds (AKA readline and readln)
| recvfrom | object | Socket.recvfrom([binary=false] [,maxlen=512 or int_size=4])
| 3.11
| receive data (string or integer) from a socket (typically UDP) | returns object with ip_address and port of sender along with data properties binary defaults to false, maxlen defaults to 512 chars, int_size defaults to 4 bytes (32-bits) recvBin | number | Socket.recvBin([bytes=4])
| 3.11
| receive a binary integer from the socket, default number of bytes is 4 (32-bits)
| getoption | number | Socket.getoption(option)
| 3.10
| get socket option value, option may be socket option name (see sockopts in sockdefs.js) or number
| setoption | boolean | Socket.setoption(option, value)
| 3.10
| set socket option value, option may be socket option name (see sockopts in sockdefs.js) or number
| ioctl | number | Socket.ioctl(command [,argument=0])
| 3.10
| send socket IOCTL (advanced)
| poll | number | Socket.poll([timeout=0] [,write=false])
| 3.10
| poll socket for read or write ability (default is read), default timeout value is 0.0 seconds (immediate timeout)
| |
Name | Type | Ver | Description |
---|---|---|---|
error | number | 3.11 | error status for the last socket operation that failed - READ ONLY |
is_connected | boolean | 3.10 | true if socket is in a connected state - READ ONLY |
is_writeable | boolean | 3.11 | true if socket can accept written data - READ ONLY |
data_waiting | boolean | 3.10 | true if data is waiting to be read from socket - READ ONLY |
nread | number | 3.10 | number of bytes waiting to be read - READ ONLY |
debug | number | 3.10 | enable debug logging |
descriptor | number | 3.10 | socket descriptor (advanced uses only) |
nonblocking | boolean | 3.10 | use non-blocking operation (default is false) |
local_ip_address | string | 3.10 | local IP address (string in dotted-decimal format) |
local_port | number | 3.10 | local TCP or UDP port number |
remote_ip_address | string | 3.10 | remote IP address (string in dotted-decimal format) |
remote_port | number | 3.10 | remote TCP or UDP port number |
type | number | 3.10 | socket type, SOCK_STREAM (TCP) or SOCK_DGRAM (UDP) |
network_byte_order | boolean | 3.11 | true if binary data is to be sent in Network Byte Order (big end first), default is true |
option_list | object | N/A | array of socket option names supported by the current platform |
Totals: 495 properties, 286 methods