global
methods
|
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
| | 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([number exit_code])
| 3.11
| stop script execution, optionally setting the global property exit_code to the specified numeric value
| | load | boolean | load([object scope,] string filename [,args])
| 3.11
| 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 true if the execution was successful
| | mswait | void | mswait([number milliseconds])
| 3.10
| millisecond wait/sleep routine (AKA sleep)
| | yield | void | yield([bool forced])
| 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(number max)
| 3.10
| return random integer between 0 and max-1
| | time | number | time()
| 3.10
| return current time in Unix (time_t) format (number of seconds since Jan-01-1970)
| | beep | void | beep([number freq, duration])
| 3.10
| produce a tone on the local speaker at specified frequency for specified duration (in milliseconds)
| | sound | boolean | sound([string filename])
| 3.10
| play a waveform (.wav) sound file
| | ctrl | string | ctrl(number or string)
| 3.11
| return ASCII control character representing character passed - Example: ctrl('C') returns ''
| | ascii | number | ascii([string text] or [number value])
| 3.10
| convert string to ASCII value or vice-versa (returns number OR string)
| | ascii_str | string | ascii_str(string text)
| 3.10
| convert extended-ASCII in string to plain ASCII
| | strip_ctrl | string | strip_ctrl(string text)
| 3.10
| strip control characters from string
| | strip_exascii | string | strip_exascii(string text)
| 3.10
| strip extended-ASCII characters from string
| | truncsp | string | truncsp(string text)
| 3.10
| truncate white-space characters off end of string
| | truncstr | string | truncstr(string text, charset)
| 3.10
| truncate string at first char in charset
| | lfexpand | string | lfexpand(string text)
| 3.10
| expand line-feeds (LF) to carriage-return/line-feeds (CRLF)
| | file_getname | string | file_getname(string path)
| 3.11
| returns filename portion of passed path string
| | file_getext | string | file_getext(string path)
| 3.11
| returns file extension portion of passed path/filename string (including '.') or undefined if no extension is found
| | file_getcase | string | file_getcase(string filename)
| 3.11
| 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)
| 3.10
| verify a file's existence
| | file_remove | boolean | file_remove(string filename)
| 3.10
| delete a file
| | file_rename | boolean | file_rename(oldname, newname)
| 3.11
| rename a file, possibly moving it to another directory in the process
| | file_copy | boolean | file_copy(source, destination)
| 3.11
| copy a file from one directory or filename to another
| | file_backup | boolean | file_backup(string filename [,number level] [,bool rename])
| 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(string filename)
| 3.10
| check if specified filename is a directory
| | file_attrib | number | file_attrib(string filename)
| 3.10
| get a file's permissions/attributes
| | file_date | number | file_date(string filename)
| 3.10
| get a file's last modified date/time (in time_t format)
| | file_size | number | file_size(string filename)
| 3.10
| get a file's length (in bytes)
| | file_utime | boolean | file_utime(string filename [,access_time] [,mod_time])
| 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(string filename)
| 3.11
| 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])
| 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(string directory [,unit_size])
| 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.
| | socket_select | array | socket_select([array of socket objects or descriptors] [,number timeout] [,bool write])
| 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(string directory)
| 3.10
| make a directory
| | rmdir | boolean | rmdir(string directory)
| 3.10
| remove a directory
| | strftime | string | strftime(string format [,number time])
| 3.10
| return a formatted time string (ala C strftime)
| | format | string | format(string format [,args])
| 3.10
| 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] [,bool ansi] [,bool ctrl_a])
| 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
| | html_decode | string | html_decode(string text)
| 3.11
| return a decoded HTML-encoded text string
| | word_wrap | string | word_wrap(string text [,line_length])
| 3.11
| 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])
| 3.11
| 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)
| 3.11
| returns ROT13-translated version of text string (will encode or decode text)
| | base64_encode | string | base64_encode(string text)
| 3.11
| returns base64-encoded version of text string or null on error
| | base64_decode | string | base64_decode(string text)
| 3.11
| returns base64-decoded text string or null on error (not useful for binary data)
| | crc16_calc | number | crc16_calc(string text)
| 3.11
| calculate and return 16-bit CRC of text string
| | crc32_calc | number | crc32_calc(string text)
| 3.11
| calculate and return 32-bit CRC of text string
| | chksum_calc | number | chksum_calc(string text)
| 3.11
| calculate and return 32-bit checksum of text string
| | md5_calc | string | md5_calc(string text [,bool hex])
| 3.11
| calculate and return 128-bit MD5 digest of text string, result encoded in base64 (default) or hexadecimal
| | resolve_ip | string | resolve_ip(string hostname)
| 3.11
| resolve IP address of specified hostname (AKA gethostbyname)
| | resolve_host | string | resolve_host(string ip_address)
| 3.11
| resolve hostname of specified IP address (AKA gethostbyaddr)
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
js
properties
|
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
|
system
methods
|
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(string alias)
| 3.10
| returns name of user that matches alias (if found in ctrl/alias.cfg)
| | matchuser | number | system.matchuser(string username [,bool sysop_alias])
| 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(string filename, search)
| 3.10
| search text/filename.can for pseudo-regexp
| | findstr | boolean | system.findstr(string filename, search)
| 3.10
| search any file for pseudo-regexp
| | zonestr | string | system.zonestr([timezone])
| 3.10
| convert time zone integer to string, defaults to system timezone if timezone not specified
| | timestr | string | system.timestr([time])
| 3.10
| convert time_t integer into a time string, defaults to current time if time not specified
| | datestr | string | system.datestr([time])
| 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(number node)
| 3.11
| 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)
| 3.10
| send a node a short text message, delivered immediately
| | get_telegram | string | system.get_telegram(number user)
| 3.11
| returns any short text messages waiting for the specified user
| | put_telegram | boolean | system.put_telegram(number user, string message)
| 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(string password)
| 3.11
| compares the supplied password against the system password and return's true if it matches
| | | | | | | | | | | | | | | | | | | | | |
system
properties
|
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
| null device filename
|
| 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
|
| 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.inetaddr)
|
| 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)
|
| 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)
|
bbs
methods
|
Name
|
Returns
|
Usage
|
Ver
|
Description
|
| atcode | string | bbs.atcode(string code)
| 3.10
| returns @-code value, specified code string does not include @ character delimiters
| | text | string | bbs.text(number line)
| 3.10
| returns specified text string from text.dat
| | replace_text | boolean | bbs.replace_text(number line, string text)
| 3.10
| replaces specified text string in memory
| | revert_text | boolean | bbs.revert_text([number line])
| 3.10
| reverts specified text string to original text string; if line unspecified, reverts all text lines
| | load_text | boolean | bbs.load_text(string basefilename)
| 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(string username, password_prompt)
| 3.10
| login with username, 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(filename)
| 3.10
| add file list to batch download queue
| | 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([subboard])
| 3.10
| display message sub-board information (current subboard, if unspecified)
| | dir_info | void | bbs.dir_info([directory])
| 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()
| 3.10
| display current node statistics
| | list_users | void | bbs.list_users()
| 3.10
| display user list
| | edit_user | void | bbs.edit_user()
| 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()
| 3.10
| read private e-mail
| | email | boolean | bbs.email(number user [,number mode] [,string top] [,string subject])
| 3.10
| send private e-mail or netmail
| | netmail | boolean | bbs.netmail(string address [,number mode] [,string subject])
| 3.10
| send private netmail
| | bulk_mail | void | bbs.bulk_mail([ars])
| 3.10
| send bulk private e-mail
| | upload_file | boolean | bbs.upload_file(directory)
| 3.10
| upload file to file directory specified by number or internal code
| | bulk_upload | boolean | bbs.bulk_upload(directory)
| 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)
| 3.10
| re-sort the file directory specified by number or internal code)
| | list_files | number | bbs.list_files(directory [,string filespec] [,number mode])
| 3.10
| 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])
| 3.10
| list extended file information for files in the specified file directory
| | post_msg | boolean | bbs.post_msg(sub-board [,number mode])
| 3.10
| 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 type])
| 3.10
| configure message scan (type is either SCAN_CFG_NEW or SCAN_CFG_TOYOU)
| | cfg_msg_ptrs | void | bbs.cfg_msg_ptrs([number type])
| 3.10
| change message scan pointer values (type is either SCAN_CFG_NEW or SCAN_CFG_TOYOU)
| | reinit_msg_ptrs | void | bbs.reinit_msg_ptrs()
| 3.10
| re-initialize new message scan pointers
| | scan_subs | void | bbs.scan_subs([number mode, boolean all])
| 3.10
| scan sub-boards for messages
| | scan_dirs | void | bbs.scan_dirs([number mode, boolean all])
| 3.10
| scan directories for files
| | scan_posts | boolean | bbs.scan_posts([sub-board, number mode, string find])
| 3.10
| scan posts in the specified message sub-board (number or internal code), optionally search for 'find' string
| | menu | void | bbs.menu(base_filename)
| 3.10
| display a menu file from the text/menu directory
| | log_key | boolean | bbs.log_key(key [,boolean comma])
| 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 [,number mode] [,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 internal code
| | user_event | boolean | bbs.user_event(number event_type)
| 3.10
| execute user event by event type (see EVENT_* in sbbsdefs.js for valid values)
| | telnet_gate | void | bbs.telnet_gate(string address [,number mode])
| 3.10
| external telnet 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(string 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
| | 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()
| 3.10
| enter private inter-node chat
| | 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(number node, string text)
| 3.10
| send an inter-node message
| | get_telegram | void | bbs.get_telegram([number usernum])
| 3.10
| receive and display a telegram
| | put_telegram | boolean | bbs.put_telegram(number user, string 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(string str [,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(number time)
| 3.10
| confirm or change newscan time, returns new newscan 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
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
bbs
properties
|
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
|
| new_file_time | number
| 3.10
| file newscan time, in time_t format
|
| last_new_file_time | number
| 3.10
| previous newscan 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
|
| curlib | number
| 3.10
| current file library
|
| curdir | number
| 3.10
| current file directory
|
| 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
|
| 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_orig | number
| 3.10
| message thread, original message number
|
| 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
|
console
methods
|
Name
|
Returns
|
Usage
|
Ver
|
Description
|
| inkey | string | console.inkey([number mode] [,number timeout])
| 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([number mode])
| 3.10
| get a single key, with wait, see K_* in sbbsdefs.js for mode bits
| | getstr | string | console.getstr([string][,maxlen][,mode])
| 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])
| 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(string question)
| 3.10
| YES/no question
| | noyes | boolean | console.noyes(string question)
| 3.10
| NO/yes question
| | mnemonics | void | console.mnemonics(string text)
| 3.10
| print a mnemonics string
| | clear | void | console.clear()
| 3.10
| clear screen and home cursor
| | home | void | console.home()
| 3.11
| send cursor to home position (x,y:1,1)
| | clearline | void | console.clearline()
| 3.10
| clear current line
| | cleartoeol | void | console.cleartoeol()
| 3.11
| clear to end-of-line (ANSI)
| | 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([number count])
| 3.11
| beep for count number of times (default count is 1)
| | print | void | console.print(string text)
| 3.10
| display a string (supports Ctrl-A codes)
| | write | void | console.write(string text)
| 3.10
| display a raw string
| | putmsg | void | console.putmsg(string text [,number mode])
| 3.10
| display message text (Ctrl-A codes, @-codes, pipe codes, etc), see P_* in sbbsdefs.js for mode bits
| | center | void | console.center(string text)
| 3.10
| display a string centered on the screen
| | strlen | number | console.strlen(string text)
| 3.10
| returns the number of characters in text, excluding Ctrl-A codes
| | printfile | void | console.printfile(string text [,number mode])
| 3.10
| print a message text file with optional mode
| | printtail | void | console.printtail(string text, number lines [,number mode])
| 3.10
| print last x lines of file with optional mode
| | editfile | void | console.editfile(string filename)
| 3.10
| edit/create a text file using the user's preferred message editor
| | uselect | number | console.uselect([number, string title, string item, string ars])
| 3.10
| 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(number attribute)
| 3.10
| returns ANSI encoding of specified attribute
| | 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(number 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([number rows])
| 3.11
| Move cursor up one or more rows (ANSI)
| | down | void | console.down([number rows])
| 3.11
| Move cursor down one or more rows (ANSI)
| | right | void | console.right([number columns])
| 3.11
| Move cursor right one or more columns (ANSI)
| | left | void | console.left([number columns])
| 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([boolean lock])
| 3.10
| Lock the user input thread (allowing direct client socket access)
| | telnet_cmd | void | console.telnet_cmd(number cmd [,number option])
| 3.10
| Send telnet command (with optional command option) to remote client
| | handle_ctrlkey | boolean | console.handle_ctrlkey(string key [,number mode])
| 3.11
| Call internal control key handler for specified control key, returns true if handled
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
console
properties
|
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 | number
| 3.10
| input/output has been aborted
|
| abortable | number
| 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
|