TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/AresChat/sb0t/llms.txt
Use this file to discover all available pages before exploring further.
Crypto static object provides cryptographic hash functions for use in sb0t scripts. It is useful for fingerprinting content, generating tokens, verifying data integrity, or producing checksums for storage and comparison.
MD5 and SHA-1 are not considered cryptographically secure for modern systems. Do not use these functions for password hashing or security-sensitive operations. They are appropriate for checksums, fingerprinting, and non-security content identifiers.
Crypto
Crypto.md5hash(text)
Computes the MD5 hash of a UTF-8 encoded string and returns a CryptoResult object.
The input string to hash. Encoded as UTF-8 before hashing.
CryptoResult — an object exposing the hash in multiple formats. Returns null if text is null or undefined.
Crypto.sha1hash(text)
Computes the SHA-1 hash of a UTF-8 encoded string and returns a CryptoResult object.
The input string to hash. Encoded as UTF-8 before hashing.
CryptoResult — an object exposing the hash in multiple formats. Returns null if text is null or undefined.
CryptoResult Object
BothCrypto.md5hash() and Crypto.sha1hash() return a CryptoResult instance with the following methods:
.toHex()
Returns the hash as an uppercase hexadecimal string (e.g. "D41D8CD98F00B204E9800998ECF8427E").
Returns: string
.toBase64()
Returns the hash as a Base64-encoded string.
Returns: string
.toArray()
Returns the raw hash bytes as a JavaScript array of integers (0–255), one element per byte.
Returns: Array<number>
Examples
Base64
TheBase64 static object encodes and decodes strings using standard Base64 encoding. Input and output use UTF-8 text.
Base64.encode(text)
Encodes a string as Base64.
The plain-text string to encode.
string — the Base64-encoded result. Returns null if text is null or undefined.
Base64.decode(text)
Decodes a Base64-encoded string back to plain text.
The Base64-encoded string to decode.
string — the decoded UTF-8 string, or null if the input is not valid Base64.
Zip
TheZip static object compresses and decompresses strings using the server’s built-in compression engine. The string is encoded as UTF-8 before compression and decoded from UTF-8 after decompression.
Zip.compress(text)
Compresses a string.
The string to compress.
string — the compressed data as a string using the system default encoding. Returns null on failure or if text is undefined.
Zip.uncompress(text)
Decompresses a previously compressed string.
The compressed string (as returned by
Zip.compress()).string — the decompressed UTF-8 string. Returns null on failure.
Hashlink
TheHashlink static object encodes and decodes Ares arlnk:// room links. These links embed a room name, IP address, and port into a compact encrypted string that Ares clients can use to connect directly to a room.
Hashlink.encode(obj)
Encodes a room descriptor object into an arlnk:// link string.
string — the full arlnk://... link, or null on error.
Hashlink.decode(link)
Decodes an arlnk:// link string into a room descriptor object.
The
arlnk:// hashlink string to decode.HashlinkResult — an object with name (string), ip (string), and port (number) properties. Returns null if the link is invalid.
Spelling
TheSpelling static object provides spell-checking utilities backed by the server’s built-in spell checker.
Spelling.check(text)
Checks the spelling of a block of text and returns a corrected version.
The text to check.
string — the spell-corrected text, or null if text is undefined.
Spelling.suggest(word)
Returns a collection of spelling suggestions for a single word.
The word to get suggestions for.
SpellingSuggestionCollection — an array-like object with a length property and numeric indexes, each containing a suggested replacement string.
Spelling.confirm(word)
Checks whether a single word is spelled correctly.
The word to check.
boolean — true if the word is correct, false otherwise.
Registry
TheRegistry static object provides persistent key-value storage for scripts using the Windows Registry. All values are stored under HKEY_CURRENT_USER\Software\sb0t\<appname>\scripting\<scriptname>, scoped to the current script.
Registry storage is Windows-only and scoped to the current user account running sb0t. Values survive server restarts. Only string, integer, and floating-point values can be stored.
Registry.exists(key)
Checks whether a named value exists in the registry for this script.
The registry value name to check.
boolean
Registry.getValue(key)
Reads a stored value from the registry.
The registry value name to read.
string — the stored value, or null if the key does not exist.
Registry.setValue(key, value)
Writes a value to the registry. Accepts strings, integers, and floating-point numbers.
The registry value name to write.
The value to store.
boolean — true on success, false if the value type is unsupported.
Registry.deleteValue(key)
Deletes a named value from the registry.
The registry value name to delete.
boolean — true if deleted, false if the key did not exist.
Registry.getKeys()
Returns all stored value names for the current script.
Returns: RegistryKeyCollection — an array-like object with a length property and numeric indexes, each containing a key name string.
Registry.clear()
Deletes all registry values stored for the current script.
Returns: boolean — true on success.
File
TheFile static object provides simple text file persistence for scripts. All file operations are sandboxed to the script’s own data/ subfolder inside the server’s data directory. Filenames may not contain .., /, \, or spaces.
The data directory is automatically created on first write. Paths are strictly sandboxed — traversal sequences and directory separators are rejected.
File.exists(filename)
Checks whether a file exists in the script’s data folder.
The filename to check (no path separators or
..).boolean
File.load(filename)
Reads the full text content of a file.
The filename to read.
string — the file contents, or null if the file does not exist or the filename is invalid.
File.save(filename, content)
Writes a string to a file, replacing any existing content.
The filename to write.
The text content to save. Written as UTF-8.
boolean — true on success.
File.append(filename, content)
Appends a string to a file. Creates the file if it does not exist.
The filename to append to.
The text to append.
boolean — true on success.
File.kill(filename)
Deletes a file from the script’s data folder.
The filename to delete.
boolean — true if the file existed and was deleted, false otherwise.