Returns the type name of a value.
The provided value.
The type name. Can be "null", "boolean", "integer", "float", "string", "list", "map", "buffer", "error", or an "objectref" string.
Returns the "length" of a value.
The value.
If value is:
STRING, the length in characters.
LIST, the length in elements.
MAP, the amount of keys.
BUFFER, the size in bytes.
OBJECTREF, if Collection, returns size().
Others, 1.
Returns if a value is "empty".
The value.
Returns true if:
NULL.
OBJECTREF: is a Collection and isEmpty() returns true.
BOOLEAN: is false.
INTEGER or FLOAT: is 0 or NaN.
STRING: length = 0.
BUFFER: length = 0.
LIST: length = 0.
MAP: length = 0.
Attempts to close one or more closeable resources. The resource is deregistered on this instance. If the object passed is not an AutoCloseable, nothing happens.
Do nothing.
A closeable resource.
A list of closeable resources.
True.
If an Error occurs on close.
Deregisters an open resource on this instance. BE VERY CAREFUL ABOUT USING THIS! This is intended for scripts that return an open resource to the host after execution.
Do nothing.
A closeable resource.
True.
If an AutoCloseable was not provided.
Converts a value to its boolean value.
The value to convert.
The boolean-equivalent value.
Converts a value to an integer value.
The value to convert.
The integer-equivalent value.
Converts a value to a float value.
The value to convert.
The float-equivalent value.
Converts a value to a string value.
The value to convert.
The string-equivalent value.
Prints something to standard out.
Value to print.
Returns nothing.
Prints something to standard out, appending a newline.
Value to print.
Returns nothing.
Prints something to standard error.
Value to print.
Returns nothing.
Prints something to standard error, appending a newline.
Value to print.
Returns nothing.
Returns a string in full uppercase.
The string (if not STRING, will be converted).
The same string converted to uppercase.
Returns a string in full lowercase.
The string (if not STRING, will be converted).
The same string converted to lowercase.
Returns a string trimmed of whitespace (0x00 - 0x20, ASCII) at both ends.
The string (if not STRING, will be converted).
The trimmed string.
Returns a single character from a string.
The string (if not STRING, will be converted).
The index (0-based).
If the index is out-of-bounds.
The character returned.
Returns a substring of another string.
The string (if not STRING, will be converted).
The starting index (0-based), inclusive.
Use string length.
The ending index (0-based), exclusive. If negative, stop at that many characters from the end.
If either index is out-of-bounds or the end index is less than the start index.
The substring returned.
Returns the starting index of a string inside another string.
The string (if not STRING, will be converted).
The string to search for (if not STRING, will be converted).
If not found.
The starting index.
Returns the starting index of a string inside another string, searching from the end.
The string (if not STRING, will be converted).
The string to search for (if not STRING, will be converted).
If not found.
The starting index.
Splits a string into many substrings using a delimiting string of characters.
The string to split (converted to string if not a string).
The target substring for delimiting splits (converted to string if not a string).
The resultant list of strings.
Joins a list of strings together into one string.
The list of items to convert to strings and join.
Returns this as a string.
Use the empty string.
The joiner string to use between list items.
The resultant string after the join.
Checks if a string starts with another substring (case sensitive).
The string to test (converted to string if not a string).
The substring to test with (converted to string if not a string).
Use 0.
The starting offset in characters from the beginning to test from.
True, if [string] (after the first [offset] characters) starts with [prefix], false otherwise.
Checks if a string ends with another substring (case sensitive).
The string to test (converted to string if not a string).
The substring to test with (converted to string if not a string).
True, if [string] ends with [suffix], false otherwise.
Replaces all occurrances of a string in a string with another string.
The string to perform replacement on (converted to string if not a string).
The target substring to replace (converted to string if not a string).
The replacement string (converted to string if not a string).
The resultant string, after replacement.
Creates a new list by copying an existing list into a new reference, or encapsulating a non-list value as a list.
The list to copy.
The resultant list.
Creates a new list of a specific length, optionally with all values initialized to a specified value.
The new list length.
The fill value. Copies are not made for each element.
The resultant new list.
Adds a value to a list. If the "list" argument is not a list or not added, this returns false, else true.
The list.
The value to add.
Adds it to the end.
The index to add the value at (shifts the others).
True if added. False if not a list.
Removes the first value from a list that matches the item. Finds list/map-typed items by reference and objects by equals().
The list.
The value to remove.
True if removed. False if not found or not a list.
Removes the first value from a list at a specific index.
The list.
The index.
The value removed, NULL if index is out-of-bounds or a list was not provided.
Sorts a list in place.
The list to sort.
The list that was sorted (not a new copy).
Checks if a list contains a specific value, sequential search. Finds list/map-typed items by reference and objects by equals().
The list to search.
The value to search for.
True if it contains the value, false if not.
Gets the index of the first occurrence of a value in a list. Finds list/map-typed items by reference and objects by equals().
The list to search.
The value to search for.
If not found.
The index of the found element.
Gets the index of the last occurrence of a value in a list. Finds list/map-typed items by reference and objects by equals().
The list to search.
The value to search for.
If not found.
The index of the found element.
Creates a new, smaller list from a larger list using a range of contiguous list indices, such that the new list contains the elements in the desired range, in order.
The list to use.
The starting index (0-based), inclusive.
Use list length.
The ending index (0-based), exclusive. If negative, stop at that many elements from the end.
If either index is out-of-bounds or the end index is less than the start index.
The new list.
Creates a new list from another list, such that the contents of the list are discrete and sorted, its contents now suitable for set operations.
The list to prepare.
The new list, set-ified.
Adds a value to a list, expected to be set up like a set (sorted, discrete).
The set (list).
The value to add.
True if value was added (and is not already in the list), false otherwise.
Removes a value from a list, expected to be set up like a set (sorted, discrete). This is more performant than a list - search is binary search.
The set (list).
The value to remove.
True if the value was removed, false otherwise.
Checks if a value exists in a list, expected to be set up like a set (sorted, discrete). This is more performant than a list - search is binary search.
The set (list).
The value to look for.
True if the value was found, false otherwise.
Gets the index of a value in a list, expected to be set up like a set (sorted, discrete). This is more performant than a list - search is binary search.
The set (list).
The value to look for.
If not found.
The index in the list that it was found.
Creates the union of two sets, returning a new set with values in both.
The first set (list).
A value to encapsulate into a set.
The second set (list).
A value to encapsulate into a set.
The new set that is the union of both sets.
Creates the intersection of two sets, returning a new set with values in both.
The first set (list).
A value to encapsulate into a set.
The second set (list).
A value to encapsulate into a set.
The new set that is the intersection of both sets.
Creates the exclusive-or of two sets, returning the union of both sets minus the intersection.
The first set (list).
A value to encapsulate into a set.
The second set (list).
A value to encapsulate into a set.
The new set that is the XOr of both sets.
Creates a new set that is the first set minus the values in the second set.
The first set (list).
A value to encapsulate into a set.
The second set (list).
A value to encapsulate into a set.
The new set that is the difference of both sets.
Gets a list of all of the keys in a map. The returned list is suitable for set operations (sorted, discrete).
The map.
If not a map.
A new list of the map's keys.
Returns a value that corresponds to a key in the map, or null if not found. Keys are resolved case-insensitively.
The map.
The key (converted to string).
The corresponding value, if found, or null, if no value for that key.
Sets a value that corresponds to a key in the map. If the first parameter is not a map, nothing happens. Keys are resolved case-insensitively.
The map.
Do nothing.
The key (converted to string).
The corresponding value to assign.
map.
Returns a value that corresponds to a key in the map, or a default value if not found. Keys are resolved case-insensitively.
The map.
The key (converted to string).
The value to return if not found.
The corresponding value, if found, or [default], if no value for that key.
Returns a new map that is the result of taking the first map and adding all of the keys of the second, replacing the keys that exist in the first. The copies are shallow - references are preserved. Keys are matched/resolved case-insensitively.
The first map.
An empty map.
The second map.
An empty map.
A new map.
Creates a new, blank buffer of a specific size.
The size of the buffer in bytes.
Use native byte order/endian mode.
True = big endian, false = little endian.
A new allocated buffer of [size] bytes.
If size is < 0.
If not allocated.
Resizes a buffer (without creating a new one). The values of the data are kept, except for what would be discarded on a buffer shrink, and the data in an expanded part is set to 0.
The buffer to resize.
The new size of the buffer in bytes.
buffer.
Size is < 0.
If not allocated.
Wraps a list as a buffer.
The list of values to interpret as (clamped) byte values from [0, 255].
Use native endian.
True = big, false = little.
A new allocated buffer of [length(list)] bytes.
If not allocated.
Unwraps a buffer into a list.
The buffer to unwrap.
A new list where each element is a value from 0 to 255, representing all of the values in the buffer in order.
If [buffer] is not a buffer.
Creates a new buffer that is a subset of bytes from another buffer.
The source buffer to use.
Use length(buffer) - index.
The amount of bytes to copy to the new buffer.
Use current position as the starting index.
The starting index.
New allocated buffer of [length] bytes, copied from source (same byte order).
If [buffer] is not a buffer.
If index or index + length is out of bounds.
Sets the current cursor position for a buffer.
The buffer to use.
Use 0.
The new current buffer cursor position (0-based).
buffer.
If [buffer] is not a buffer.
If the position is out of bounds.
Gets the current cursor position for a buffer.
The buffer to use.
The buffer's current cursor position (0-based).
If [buffer] is not a buffer.
Sets the current byte order for a buffer.
The buffer to use.
Use native byte order/endian mode.
True = big endian, false = little endian.
buffer.
If [buffer] is not a buffer.
If the position is out of bounds.
Gets the current byte order for a buffer.
The buffer to use.
The buffer's current byte order - true if big endian, false if little endian.
If [buffer] is not a buffer.
Reads a bulk set of bytes from another buffer into a destination buffer. Will stop if the end of the destination buffer is reached.
The destination buffer to fill.
The source buffer to read from.
The list of integers to use as bytes.
Read as much as possible to fill the destination or read the rest of source.
The maximum amount of bytes to read/set.
Use the destination buffer's current position (cursor position will be advanced).
The index into the destination buffer (cursor position will NOT be advanced).
Use the source buffer's current position (cursor position will be advanced).
The index into the source buffer (cursor position will NOT be advanced).
The amount of the bytes read, or -1 if the end of the source was already reached at call.
If either destbuf or srcbuf are not buffers.
If index or index + length is out of bounds.
Fills a buffer with a single value.
The destination buffer to use.
Use 0.
The byte value to fill.
Use length(buffer) - index.
The amount of bytes to set.
Use buffer's current cursor position (cursor position will be advanced).
The starting index into the buffer (cursor position will NOT be advanced).
buffer.
If [buffer] is not a buffer.
Sets a byte in a buffer.
The buffer to use.
The byte value to set (0 - 255)
Use the current position (cursor position will be advanced).
The index into the buffer (cursor position will NOT be advanced).
buffer.
If [buffer] is not a buffer.
If [index] is out of the buffer's bounds.
Gets a byte in a buffer (returned unsigned).
The buffer to use.
Use the current position (cursor position will be advanced).
The index into the buffer (cursor position will NOT be advanced).
The value at the index (0 - 255).
If [buffer] is not a buffer.
If [index] is out of the buffer's bounds.
Sets a short value in a buffer (16-bit, signed). The buffer's current byte order affects how the bytes are written.
The buffer to use.
The short value to set (-32768 - 32767)
Use the current position (cursor position will be advanced).
The index into the buffer (cursor position will NOT be advanced).
buffer.
If [buffer] is not a buffer.
If [index, index+2) is out of the buffer's bounds.
Gets a short in a buffer (16-bit, signed). The buffer's current byte order affects how the bytes are read.
The buffer to use.
Use the current position (cursor position will be advanced).
The index into the buffer (cursor position will NOT be advanced).
The value at the index (-32768 - 32767).
If [buffer] is not a buffer.
If [index, index+2) is out of the buffer's bounds.
Sets a short value in a buffer (16-bit, unsigned). The buffer's current byte order affects how the bytes are written.
The buffer to use.
The short value to set (0 - 65535)
Use the current position (cursor position will be advanced).
The index into the buffer (cursor position will NOT be advanced).
buffer.
If [buffer] is not a buffer.
If [index, index+2) is out of the buffer's bounds.
Gets a short in a buffer (16-bit, unsigned). The buffer's current byte order affects how the bytes are read.
The buffer to use.
Use the current position (cursor position will be advanced).
The index into the buffer (cursor position will NOT be advanced).
The value at the index (0 - 65535).
If [buffer] is not a buffer.
If [index, index+2) is out of the buffer's bounds.
Sets an integer value in a buffer (32-bit, signed). The buffer's current byte order affects how the bytes are written.
The buffer to use.
The integer value to set (-2^31 - 2^31-1)
Use the current position (cursor position will be advanced).
The index into the buffer (cursor position will NOT be advanced).
buffer.
If [buffer] is not a buffer.
If [index, index+4) is out of the buffer's bounds.
Gets an integer in a buffer (32-bit, signed). The buffer's current byte order affects how the bytes are read.
The buffer to use.
Use the current position (cursor position will be advanced).
The index into the buffer (cursor position will NOT be advanced).
The value at the index (-2^31 - 2^31-1).
If [buffer] is not a buffer.
If [index, index+4) is out of the buffer's bounds.
Sets an integer value in a buffer (32-bit, unsigned). The buffer's current byte order affects how the bytes are written.
The buffer to use.
The integer value to set (0 - 2^32-1)
Use the current position (cursor position will be advanced).
The index into the buffer (cursor position will NOT be advanced).
buffer.
If [buffer] is not a buffer.
If [index, index+4) is out of the buffer's bounds.
Gets an integer in a buffer (32-bit, unsigned). The buffer's current byte order affects how the bytes are read.
The buffer to use.
Use the current position (cursor position will be advanced).
The index into the buffer (cursor position will NOT be advanced).
The value at the index (0 - 2^32-1).
If [buffer] is not a buffer.
If [index, index+4) is out of the buffer's bounds.
Sets a floating-point value in a buffer (32-bit). The buffer's current byte order affects how the bytes are written. NOTE: Floating-point values are stored in memory as double-precision - some precision may be lost on write!
The buffer to use.
The float value to set.
Use the current position (cursor position will be advanced).
The index into the buffer (cursor position will NOT be advanced).
buffer.
If [buffer] is not a buffer.
If [index, index+4) is out of the buffer's bounds.
Gets a float in a buffer (32-bit). The buffer's current byte order affects how the bytes are read.NOTE: Floating-point values are stored in memory as double-precision - some data may be extrapolated on read!
The buffer to use.
Use the current position (cursor position will be advanced).
The index into the buffer (cursor position will NOT be advanced).
The value at the index.
If [buffer] is not a buffer.
If [index, index+4) is out of the buffer's bounds.
Sets a long integer value in a buffer (64-bit, signed). The buffer's current byte order affects how the bytes are written.
The buffer to use.
The integer value to set (-2^63 - 2^63-1)
Use the current position (cursor position will be advanced).
The index into the buffer (cursor position will NOT be advanced).
buffer.
If [buffer] is not a buffer.
If [index, index+8) is out of the buffer's bounds.
Gets a long integer in a buffer (64-bit, signed). The buffer's current byte order affects how the bytes are read.
The buffer to use.
Use the current position (cursor position will be advanced).
The index into the buffer (cursor position will NOT be advanced).
The value at the index (-2^63 - 2^63-1).
If [buffer] is not a buffer.
If [index, index+8) is out of the buffer's bounds.
Sets a double-precision floating-point value in a buffer (64-bit). BufferType byte order affects how the bytes are written.
The buffer to use.
The float value to set.
Use the current position (cursor position will be advanced).
The index into the buffer (cursor position will NOT be advanced).
buffer.
If [buffer] is not a buffer.
If [index, index+8) is out of the buffer's bounds.
Gets a double-precision float in a buffer (64-bit). BufferType byte order affects how the bytes are read.
The buffer to use.
Use the current position (cursor position will be advanced).
The index into the buffer (cursor position will NOT be advanced).
The value at the index.
If [buffer] is not a buffer.
If [index, index+8) is out of the buffer's bounds.
Writes a string to a buffer.
The buffer to use.
The string to write.
Use native encoding.
The name of the encoding to use.
Use the current position (cursor position will be advanced).
The index into the buffer (cursor position will NOT be advanced).
buffer.
If [buffer] is not a buffer.
If [buffer] is not a buffer.
If not enough room to write the string.
Gets a string from the buffer.
The buffer to use.
The amount of bytes to read and decode into a string.
Use native encoding.
The name of the encoding to use.
Use the current position (cursor position will be advanced).
The index into the buffer (cursor position will NOT be advanced).
The string read and decoded.
If [buffer] is not a buffer.
If [buffer] is not a buffer.
If not enough room to write the string.
Outputs a buffer's contents as a string of hexadecimal digits, from first byte to last byte.
The buffer.
If the input is not a buffer.
A contiguous string of hexadecimal characters representing the buffer's contents, two characters per byte.
Checks if the provided value is an error type.
The provided value.
True if so, false if not.
Creates an error type.
The error type.
The error message.
Use the error message.
The error localized message.
The created error.
Returns the error type. If not an error, this returns null.
The error.
If not an error.
The error type.
Returns the error message. If not an error, this returns null.
The error.
If not an error.
The error message.
Returns the localized error message. If not an error, this returns null.
The error.
If not an error.
The localized error message.
Returns an error type as a map. If not an error, this returns null.
The error.
If not an error.
A map of {type:STRING, message:STRING, localizedmessage:STRING}.
Returns the minimum of two values.
The first value.
The second value.
The value that is less than the other value.
Returns the maximum of two values.
The first value.
The second value.
The value that is greater than the other value.
Raises a number to another mathematical power.
The first value.
The second value.
The value raised to the provided power.
Rounds a number to the nearest whole number.
The value to round.
The value rounded to the nearest integer value.
Returns the mathematical floor of a number.
The value.
The floor of the provided value.
Returns the mathematical ceiling of a number.
The value.
The ceiling of the provided value.
Rounds a number to the nearest arbitrary digit place. The "place" is a power of 10. FIX(n, 0) = ROUND(n)
The value.
The place.
The rounded value.
Returns Euler's constant.
2.718281828459045
Returns the Natural Log (base e) of a value.
The value.
Log (base e) of the provided value.
Returns the Base 10 Log of a value.
The value.
Base 10 Log of the provided value.
Returns the square root of a value.
The value.
The square root of the provided value.
Returns Pi.
3.141592653589793
Converts degrees to radians.
The value in degrees.
The value in radians.
Converts radians to degrees.
The value in radians.
The value in degrees.
Mathematical sine.
The value in radians.
SIN(value)
Mathematical cosine.
The value in radians.
COS(value)
Mathematical tangent.
The value in radians.
TAN(value)
Mathematical arc sine.
The value in radians.
ASIN(value)
Mathematical arc cosine.
The value in radians.
ACOS(value)
Mathematical arc tangent.
The value in radians.
ATAN(value)
Clamps a value between two values.
The value.
The lower bound.
The higher bound.
The value clamped to the provided range.
Wraps a value around a value range. The higher bound is never returned.
The value.
The lower bound.
The higher bound.
The value wrapped around the provided range.
Linearly interpolates from the first value to the second.
The unit scalar between the first and second value. 0.0 is first, 1.0 is the second.
The first value.
The second value.
A value scaled between the provided range. If the scalar is beyond the range of 0.0 to 1.0, this will return a value outside the range.
Parses a string to an integer with an optional radix.
The value to parse.
Radix 10.
An optional radix.
The parsed value.
NaN, if not parsable.
Converts color (byte, 0 to 255) components to an ARGB integer.
Red component byte.
Green component byte.
Blue component byte.
Alpha component byte.
The output ARGB color value.
Converts color (float, 0.0 to 1.0) components to an ARGB integer.
Red component float.
Green component float.
Blue component float.
Alpha component float.
The output ARGB color value.
Checks if a string is a valid RegEx pattern.
The string to test.
True if the pattern is valid, false otherwise.
Splits a string by a RegEx pattern.
The RegEx pattern to use.
The string to split.
A list of strings.
If the pattern is malformed.
Checks if a string contains a set of characters that matches the provided RegEx.
The RegEx pattern to use.
The string to inspect.
True if so, false if not.
If the pattern is malformed.
Checks if a string completely matches a set of characters using the provided RegEx.
The RegEx pattern to use.
The string to inspect.
True if so, false if not.
If the pattern is malformed.
Finds a substring in a set of characters that matches the provided RegEx.
The RegEx pattern to use.
The string to inspect.
If no matched substrings/groups.
A map of details of the first matched group.
If the pattern is malformed.
Finds every substring in a set of characters that matches a provided RegEx.
The RegEx pattern to use.
The string to inspect.
A list of maps of details of each matched group in the order found.
If the pattern is malformed.
Returns current date/time as milliseconds since Epoch (January 1, 1970 UTC).
The current date/time in milliseconds since Epoch.
Formats a date using milliseconds since Epoch.
Milliseconds since Epoch.
A SimpleDateFormat formatting string.
The formatted time string.
If bad format string.
Wraps a path into an OBJECTREF:File. Useful for functions that expect file objects specifically.
Path to file.
A file path to inspect.
If nothing was provided.
A file object that represents the path.
Checks if a file exists.
Path to file.
A file path to inspect.
True if the file exists, false otherwise.
If the OS is preventing the search.
Checks if a file is a directory path.
Path to file.
A file path to inspect.
True if the file is a directory, false otherwise.
If the OS is preventing the read.
Returns the path used to open the file.
A file path to inspect.
A file path to inspect.
If [file] is null.
The file's path.
Returns the name of a file.
A file path to inspect.
A file path to inspect.
If [file] is null.
The file's name only.
Returns the name of a file, without extension.
A file path to inspect.
A file path to inspect.
Use "."
The file extension separator string.
If [file] is null.
The file's name without its extension.
Returns a file's extension.
A file path to inspect.
A file path to inspect.
If [file] is null.
The file's extension only. Empty string if no extension.
Returns a file's length in bytes.
A file path to inspect.
A file path to inspect.
If [file] is null.
The file's length.
If the file could not be found.
If the OS is preventing the read.
Returns a file's modified date in milliseconds since Epoch (Jan. 1, 1970 UTC).
A file path to inspect.
A file path to inspect.
If [file] is null.
The file's modified date in milliseconds since Epoch.
If the file could not be found.
If the OS is preventing the read.
Returns a file's parent path.
A file path to inspect.
A file path to inspect.
If [file] is null.
The file's parent path (if parameter was string).
The file's parent path (if parameter was file).
If the OS is preventing the search.
Returns the absolute path of a file.
A file path to inspect.
A file path to inspect.
If [file] is null.
The file's absolute path (if parameter was string).
The file's absolute path (if parameter was file).
If the OS is preventing the search.
Returns the canonical path of a file.
A file path to inspect.
A file path to inspect.
If [file] is null.
The file's canonical path (if parameter was string).
The file's canonical path (if parameter was file).
If the OS is preventing the search.
If an error occurred during search.
Returns all files in a directory (and optionally, whose name fits a RegEx pattern). If recursive traversal is used, no directories will be added to the resultant list, just the files.
A file path to inspect.
A file path to inspect.
If true, scan recursively.
Include everything.
The pattern to match each file against.
If not a directory or [path] is null.
A list of file paths in the directory (if parameter was string).
A list of file paths in the directory (if parameter was file).
If the OS is preventing the search.
If the input RegEx pattern is malformed.
Attempts to delete a file.
The file to delete.
The file to delete.
If [path] is null.
True if the file existed and was deleted, false otherwise.
If the OS is preventing the delete.
Attempts to rename/move a file.
The file to rename.
The file to rename.
The new path.
The new path.
If [path] or [newname] is null.
True if renamed/moved, false if not.
If the OS is preventing the rename/move.
Attempts to create a directory using an abstract pathname.
The directory to create.
The directory to create.
True if and only if the directory did not exist and was created, false if not.
If the OS is preventing the creation.
Attempts to create a directory using an abstract pathname and all of the directories in between, if they also don't exist. NOTE: A failure may still involve some directories being created!
The directory or directories to create.
The directory or directories to create.
True if and only if one or more directories did not exist before and were then created, and false if not.
If the OS is preventing the creation.
Attempts to create a directory using an abstract pathname and all of the directories in between, if they also don't exist, OR verify that the directory path that was specified already exists. NOTE: A failure due to path creation may still involve some directories being created!
The directory or directories to create.
The directory or directories to create.
True if ALL of the directories did not exist and were created or if the path is a directory and already exists, and false otherwise.
If the OS is preventing the creation.
Returns an open handle to a file. The file, if opened, is registered as a resource, and will be closed when the script terminates.
Path to file. Relative paths are relative to working directory.
Path to file. Relative paths are relative to working directory.
Use "r", read-only mode.
Mode string.
"r" = readonly,
"rw" = read/write/create buffered
"rwd" = read/write/create/synchronous data
"rws" = read/write/create/synchronous data/metadata
If successfully open/created (NOTE: This is also a DataInput/DataOutput).
If [mode] is an unexpected value.
If the OS denied opening the file for the required permissions.
If [path] is null or the file could not be opened/found for some reason.
Returns an open file's length in bytes.
An open file handle.
The file's current length in bytes.
If a file handle was not provided.
If a read error occurs.
Sets an open file's length in bytes. A [length] less than current will truncate the file, and a greater [length] will expand the file with undefined contents.
An open file handle.
The new length of the file.
rafile.
If a file handle was not provided.
If a read/write error occurs.
Returns an open file's current cursor position.
An open file handle.
The file's current cursor position.
If a file handle was not provided.
If a read error occurs.
Sets an open file's current cursor position.
An open file handle.
The new position.
The file's current cursor position.
If a file handle was not provided.
If the position could not be set ( < 0 ).
Opens a Zip file. The file, if opened, is registered as a resource, and will be closed when the script terminates.
Path to zip file. Relative paths are relative to working directory.
Path to zip file. Relative paths are relative to working directory.
An open Zip file.
If the OS denied opening the file for the required permissions.
If [path] is null or the file is not a Zip file, or it does could not be opened/found for some reason.
Returns a list of all of the entries in an open Zip File.
The open zip file.
The entry name.
If an entry by that name could not be found.
A map of entry info.
If an open zip file was not provided, or [entry] is null.
If a read error occurs, or the zip is not open.
Returns a list of all of the entries in an open Zip File.
The open zip file.
A list of maps of entry info.
If an open zip file was not provided.
If a read error occurs, or the zip is not open.
Returns a list of all of the entries in an open Zip File. The value that this produces can be used in an each(...) loop. The keys are entry names, and values are maps of entry info (a la ZFENTRY). If you need to scan through a Zip with many entries, this may be a less memory-intense way to do it.
The open zip file.
An iterator for each entry - Key: name:STRING, value: MAP{name:STRING, dir:BOOLEAN, size:INTEGER, time:INTEGER, comment:STRING, compressedsize:INTEGER, crc:INTEGER, creationtime:INTEGER, lastaccesstime:INTEGER, lastmodifiedtime:INTEGER}.
If an open zip file was not provided.
If a read error occurs, or the zip is not open.
Opens a data input stream for reading from a zip file entry (and registers this resource as an open resource).
The open zip file.
The entry name.
A map of zip entry info containing at least the name of the entry.
An open data input stream to read from.
If an open zip file was not provided, or [entry] is null or [entry].name is null.
If [entry] could not be found in the zip.
If a read error occurs, or the zip is not open.
Wraps a data input stream for reading a GZIP stream (and registers this resource as an open resource, but only if the underlying stream is registered - it is deregistered before registering this one).
A valid open input stream.
An open data input stream to read from.
If an open input stream was not provided.
If the provided input stream is not a GZIPped stream of data.
If a read error occurs, or the provided stream is not open.
Wraps a data output stream for writing a GZIP stream (and registers this resource as an open resource, but only if the underlying stream is registered - it is deregistered before registering this one).
A valid open output stream.
An open data output stream to write to.
If an open output stream was not provided.
If a write error occurs, or the provided stream is not open.
Skips reading [length] amount of bytes from a readable data input, from the file's current cursor position. The stream's position will be advanced.
A readable data input.
An input stream.
Use 0.
The amount of bytes to skip.
The amount of bytes actually skipped.
If a file handle was not provided.
If a read error occurs.
Flushes an output stream or other flushable stream - anything buffered is written immediately.
An open, flushable stream (usually an output stream).
flushable.
If the provided object is not flushable.
If an I/O error occurs.
Reads from a data input and writes the data read from it to the data output until the end of the input is reached.
A readable data input.
A writeable data output.
Use 8192 (8 KB).
The size of the intermediate buffer (in bytes) to use for transfer.
Unlimited.
The maximum amount of bytes to transfer.
The actual amount of bytes moved.
If a valid stream was not provided for [input] or [output].
If a read or write error occurs.
Reads [length] amount of bytes from a readable data input, from the file or stream's current position. The position will be advanced.
A readable data input.
The buffer object to read into.
Use current buffer cursor position (buffer cursor will be advanced).
The offset into the buffer object to put the bytes (buffer cursor will NOT be advanced).
Use length(buffer) - offset.
The maximum amount of bytes to read.
The actual amount of bytes read, or -1 if end-of-file was reached at time of read.
If a file handle was not provided.
If a read error occurs.
Writes [length] amount of bytes to a writable data output, to the file or stream position using the bytes in a buffer. The position will be advanced.
A writeable data output.
The buffer object to read from.
Use current buffer cursor position (buffer cursor will be advanced).
The offset into the buffer object to get the bytes to write (buffer cursor will NOT be advanced).
Use length(buffer) - offset.
The maximum amount of bytes to write.
The actual amount of bytes written.
If a file handle was not provided.
If a write error occurs.
Opens a data input stream for reading from STDIN (resource is not registered).
An open input stream for reading STDIN.
If STDIN was not provided to the script's environment.
Opens a data output stream for writing to STDOUT (resource is not registered).
An open output stream for writing to STDOUT.
If STDOUT was not provided to the script's environment.
Opens a data output stream for writing to STDERR (resource is not registered).
An open output stream for writing to STDERR.
If STDERR was not provided to the script's environment.
Opens a data input stream for reading from a file (and registers this resource as an open resource).
A path to a file.
A path to a file.
An open data input stream to read from.
If [file] is null.
If [file] could not be found.
If the OS denied opening the file for reading.
Opens a data output stream for writing to a file (and registers this resource as an open resource).
A path to a file.
A path to a file.
If true, appends to the file instead of overwriting it.
An open data output stream to write to.
If [file] is null.
If [file] is null, a directory, or the file could not be made.
If the OS denied opening the file for reading.
Opens a data input stream for reading from a buffer from its current cursor position (cursor advances with reading). This is NOT registered as a closeable resource.
The buffer to use.
An open data input stream to read from.
If [buffer] is null or not a buffer.
Opens a data output stream for writing from a buffer from its current cursor position (cursor advances with writing). This is NOT registered as a closeable resource.
The buffer to use.
An open data output stream to write to.
If [buffer] is null or not a buffer.
Creates a "character stream" reader around an input stream (and registers this resource as an open resource, but only if the underlying stream is registered - it is deregistered before registering this one). Closing this Reader will also close the underlying stream.
A valid open input stream.
Use platform encoding.
A charset name.
If [instream] is null.
The Reader to use for reading characters from.
If [instream] is not a data input stream object type.
If [encoding] is not a valid charset name.
Creates a "character stream" writer around an output stream (and registers this resource as an open resource, but only if the underlying stream is registered - it is deregistered before registering this one). Closing this Writer will also close the underlying stream.
A valid open output stream.
Use platform encoding.
A charset name.
If [outstream] is null.
The Writer to use for writing characters to.
If [outstream] is not a data output stream object type.
If [encoding] is not a valid charset name.
Creates a "character stream" reader around a string (not registered as an open resource).
The string to read from (value is converted to a string).
The Reader to use for reading characters from.
Creates a "character stream" writer for writing into a string (not registered as an open resource). The string can then be fetched by calling TOSTRING() on this Writer.
The Writer to use for writing characters to.
Reads characters from a reader and returns a string of all of the read characters.
A valid open Reader.
Use 1.
The maximum amount of characters to read.
If the Reader is at End-Of-Stream at the time of read.
The read characters.
If a valid Reader was not provided.
If a read error occurs.
Reads characters from a reader until an end-of-line (or stream) is reached and returns a string of all of the read characters (minus the newline).
A valid open Reader.
If the Reader is at End-Of-Stream at the time of read.
The read characters (without the newline).
If a valid Reader was not provided.
If a read error occurs.
Creates an iterator that reads lines from a Reader until it reaches the end of the stream. The value that this produces can be used in an each(...) loop. The keys are line numbers (starts at 1), and values are the lines read (without newline). If an error occurs at any point, the value is an Error.
A valid open Reader.
The stream iterator.
If a valid Reader was not provided.
If a read error occurs.
Writes characters to a writer.
A valid open Writer.
The string of characters to write (if not a string, it is converted to one).
writer.
If a valid Writer was not provided.
If a write error occurs.
Writes characters to a writer.
A valid open Writer.
The string of characters to write (if not a string, it is converted to one).
writer.
If a valid Writer was not provided.
If a write error occurs.
Reads a byte from a readable data input. The source's position, if any, will be advanced.
A readable data input.
The read byte (0 - 255), or -1 if at the end of the stream.
If a file handle was not provided.
If a read error occurs.
Reads a short (2 bytes) from a readable data input. The source's position, if any, will be advanced.
A readable data input.
Use native.
True - big endian, false - little endian.
The read short (-32768 - 32767).
If a file handle was not provided.
If not enough bytes for the value, or end-of-stream was reached at the time of read.
If a read error occurs.
Reads an unsigned short (2 bytes) from a readable data input. The source's position, if any, will be advanced.
A readable data input.
Use native.
True - big endian, false - little endian.
The read short (0 - 65535).
If a file handle was not provided.
If not enough bytes for the value, or end-of-stream was reached at the time of read.
If a read error occurs.
Reads an integer (4 bytes) from a readable data input. The source's position, if any, will be advanced.
A readable data input.
Use native.
True - big endian, false - little endian.
The read integer (-2^31 - 2^31-1).
If a file handle was not provided.
If not enough bytes for the value, or end-of-stream was reached at the time of read.
If a read error occurs.
Reads an unsigned integer (4 bytes) from a readable data input. The source's position, if any, will be advanced.
A readable data input.
Use native.
True - big endian, false - little endian.
The read integer (0 - 2^32-1).
If a file handle was not provided.
If not enough bytes for the value, or end-of-stream was reached at the time of read.
If a read error occurs.
Reads a 32-bit float (4 bytes) from a readable data input. The source's position, if any, will be advanced.
A readable data input.
Use native.
True - big endian, false - little endian.
The read float.
If a file handle was not provided.
If not enough bytes for the value, or end-of-stream was reached at the time of read.
If a read error occurs.
Reads a long integer (8 bytes) from a readable data input. The source's position, if any, will be advanced.
A readable data input.
Use native.
True - big endian, false - little endian.
The read integer (-2^63 - 2^63-1).
If a file handle was not provided.
If not enough bytes for the value, or end-of-stream was reached at the time of read.
If a read error occurs.
Reads a 64-bit float (8 bytes) from a readable data input. The source's position, if any, will be advanced.
A readable data input.
Use native.
True - big endian, false - little endian.
The read double.
If a file handle was not provided.
If not enough bytes for the value, or end-of-stream was reached at the time of read.
If a read error occurs.
Reads a set of bytes from a readable data input, and converts it into a string. The source's position, if any, will be advanced.
A readable data input.
The number of bytes to read.
Use platform encoding.
A charset name.
The read string.
If a file handle was not provided.
If an unknown encoding was provided.
If not enough bytes for the value, or end-of-stream was reached at the time of read.
If a read error occurs.
Writes a byte to a writeable data output. The destination's position, if any, will be advanced.
A writeable data output.
The byte to write (first 8 bits used).
output.
If a file handle was not provided.
If a write error occurs.
Writes a short (2 bytes) to a writeable data output. The destination's position, if any, will be advanced.
A writeable data output.
The short to write (-32768 - 32767).
Use native.
True - big endian, false - little endian.
output.
If a file handle was not provided.
If a write error occurs.
Writes an unsigned short (2 bytes) to a writeable data output. The destination's position, if any, will be advanced.
A writeable data output.
The short to write (0 - 65535).
Use native.
True - big endian, false - little endian.
output.
If a file handle was not provided.
If a write error occurs.
Writes an integer (4 bytes) to a writeable data output. The destination's position, if any, will be advanced.
A writeable data output.
The integer to write (-2^31 - 2^31-1).
Use native.
True - big endian, false - little endian.
output.
If a file handle was not provided.
If a write error occurs.
Writes an unsigned integer (4 bytes) to a writeable data output. The destination's position, if any, will be advanced.
A writeable data output.
The integer to write (0 - 2^32-1).
Use native.
True - big endian, false - little endian.
output.
If a file handle was not provided.
If a write error occurs.
Writes a 32-bit floating-point number to a writeable data output. The destination's position, if any, will be advanced.
A writeable data output.
The float to write.
Use native.
True - big endian, false - little endian.
output.
If a file handle was not provided.
If a write error occurs.
Writes a long integer (8 bytes) to a writeable data output. The destination's position, if any, will be advanced.
A writeable data output.
The integer to write (-2^63 - 2^63-1).
Use native.
True - big endian, false - little endian.
output.
If a file handle was not provided.
If a write error occurs.
Writes a 64-bit floating-point number to a writeable data output. The destination's position, if any, will be advanced.
A writeable data output.
The double to write.
Use native.
True - big endian, false - little endian.
output.
If a file handle was not provided.
If a write error occurs.
Writes a string to a writeable data output, converting it into a set of bytes. The destination's position, if any, will be advanced.
A writeable data output.
Write nothing.
The string to write.
Use platform encoding.
A charset name.
output.
If a file handle was not provided.
If an unknown encoding was provided.
If a write error occurs.
Starts a message digest calculator.
The name of the algorithm to use.
A digest calculator for the hash.
If [algorithm] is not supported by the host.
Updates a message digest calculator with a set of bytes to digest.
The digest calculator to use.
The buffer to read from (starting from the buffer's cursor).
The file read from (until end-of-file).
The input stream to read from (until end-of-stream).
Use full length.
The amount of bytes to read, maximum.
digest.
If [data] is not one of the required types.
If [data] is a file, and it does not exist.
If the OS is preventing opening a file for reading, or the file is a directory.
If a read error occurs.
Returns a buffer containing the bytes of the digest, resetting the calculator for reuse.
The digest calculator to use.
A buffer containing the resultant hash digest.
Takes a buffer or input stream and outputs a buffer containing bytes in the desired hash digest. This is meant to be a pure convenience function - use the other digest functions for greater hash calculation control. Input streams are not closed after this completes.
The buffer to read (until the end is reached).
The file read from (until end-of-file).
The input stream to read from (until end-of-stream).
The name of the algorithm to use.
A buffer containing the resultant hash digest.
If [data] is not one of the required types.
If [data] is a file, and it does not exist.
If [algorithm] is not supported by the host.
If the OS is preventing opening a file for reading, or the file is a directory.
If a read error occurs.
Takes a buffer or input stream and outputs a buffer containing bytes using the MD5 hash digest. This is meant to be a pure convenience function - use the other digest functions for greater hash calculation control. Input streams are not closed after this completes.
The buffer to read fully (from index 0).
The file read from (until end-of-file).
The input stream to read from (until end-of-stream).
A buffer containing the resultant hash digest.
If [data] is not one of the required types.
If [data] is a file, and it does not exist.
If the OS is preventing opening a file for reading, or the file is a directory.
If a read error occurs.
Takes a buffer or input stream and outputs a buffer containing bytes using the SHA1 hash digest. This is meant to be a pure convenience function - use the other digest functions for greater hash calculation control. Input streams are not closed after this completes.
The buffer to read fully (from index 0).
The file read from (until end-of-file).
The input stream to read from (until end-of-stream).
A buffer containing the resultant hash digest.
If [data] is not one of the required types.
If [data] is a file, and it does not exist.
If the OS is preventing opening a file for reading, or the file is a directory.
If a read error occurs.
Takes a buffer or input stream and outputs a buffer containing bytes using the SHA256 hash digest. This is meant to be a pure convenience function - use the other digest functions for greater hash calculation control. Input streams are not closed after this completes.
The buffer to read fully (from index 0).
The file read from (until end-of-file).
The input stream to read from (until end-of-stream).
A buffer containing the resultant hash digest.
If [data] is not one of the required types.
If [data] is a file, and it does not exist.
If the OS is preventing opening a file for reading, or the file is a directory.
If a read error occurs.
Converts JSON data to a script value. The provided stream is read until a full JSON value is parsed. NOTE: While RookScript structures are compatible with the JSON spec, RookScript map key names are NOT case-sensitive, and may result in members of the same name being overwritten.
The JSON string to convert.
The file to read JSON from (assumes UTF-8 encoding).
The input stream to read JSON from (assumes UTF-8 encoding).
The reader to read JSON from.
The resultant value read.
If [json] is not a valid input type.
If [json] is a file and is not found.
If a JSON parse error occurs.
If [json] is a file and the OS is preventing the read.
If a read or write error occurs.
Converts a script value to JSON and writes it to a provided output. Objects will be reflection-exported as JS objects, and buffers as arrays of unsigned byte values. You can optionally export JSON with indentation for prettifying.
The file to write the JSON to (encoding is UTF-8, file is overwritten, and then closed).
The output stream to write the JSON to (encoding is UTF-8).
The Writer to write the JSON to.
The value to export as JSON. Objects will be reflection-exported as maps, and buffers as arrays of unsigned byte values.
No indentation.
The indentation string for exporting members.
output.
If [output] is a file and the OS is preventing the creation/write.
If a write error occurs.
Converts a script value to JSON and returns it as a string. Objects will be reflection-exported as maps, and buffers as arrays of unsigned byte values.
The value to export as JSON.
No indentation.
The indentation string for exporting members.
The resultant string.
If a write error occurs.
Returns a map of JVM properties. Best to read this once and re-query the returned map.
Get all properties as a map.
Get a single property as a string value.
Get all provided properties as a map.
If no corresponding property, if [key] is a string.
The corresponding property, if [key] is a string.
The corresponding map of properties, if [key] is null or a list.
If a property cannot be queried.
Gets one or more system environment variables.
Get all variables as a map.
Get a single variable as a string value.
Get all provided variables as a map.
The corresponding value, if [variable] is a string.
The corresponding map of values, if [variable] is null or a list.
If a value cannot be queried.
Spawns a process instance. A set of daemon threads are created that assist the streams on the process. The process, if created successfully, is registered as an open resource, and is closeable like any other resource (closing it will terminate it, if running). The script may end before the process does, so you may want to wait for its end via EXECRESULT(). All input/output streams are not closed, unless OBJECTREF:Files are used. If a file is used for output, it is overwritten. If you wish to keep a process running after the script terminates, call DONOTCLOSE with the process to avoid its cleanup.
Process name or path to execute.
Argument list to pass to the process.
Map of key-value pairs for environment values.
Current working directory.
Path to working directory.
Path to working directory.
Consume all output.
The file to write the process output to (closed on process end, native encoding).
The output stream to write the process output to (encoding is native).
Consume all output.
The file to write the process error output to (closed on process end, native encoding).
The output stream to write the process error output to (encoding is native).
No input, first read is end-of-stream.
The file to read process input from (assumes native encoding).
The input stream to read process input from (assumes native encoding).
An encapsulated, spawned process.
A type of a parameter is unexpected.
If a stream is a file and it is an invalid file.
If a stream is denied access or the process can't be instantiated due to OS denial.
If an I/O error occurs.
Waits for a process to complete and returns its result.
The process instance.
Wait indefinitely.
The amount of time to wait for a result, in milliseconds. If 0 or less, wait forever.
The process return result.
A type of a parameter is unexpected.
If the wait timed out.
Creates a new, blank image of the specified width and height (32-bit ARGB format).
Width in pixels.
Height in pixels.
The new image.
If width or height is 0 or less.
Creates a new image by reading it from a file or stream. The data must be in a format recognized by Java ImageIO.
The path to a file.
The path to the file.
The open stream to read.
A URL to an image to read.
The image loaded from the source.
If the data could not be interpreted.
If the stream could not be read.
Writes an image out to a file or stream. The target data type must be in a format recognized by Java ImageIO.
The image to write.
The path to a file.
The path to a target file.
The open stream to write to.
Detect from file extension.
The informal type name.
If the destination is null.
The file path, if [destination] is a string.
The file, if [destination] is a File.
The stream, if [destination] is an OutputStream.
If the first parameter is not a BufferedImage.
If the [type] is not a valid type, nor inferred by output.
If the stream could not be written to.
Creates a new image from an existing image, such that the new image is a copy of the provided image.
The image to copy.
A new image that is a copy of [image].
If the first parameter is not a BufferedImage.
Creates a new image that is a resized version of a source image.
The image to inspect.
New width in pixels.
New height in pixels.
Use Nearest Neighbor ('nearest').
A resize mode: 'nearest', 'linear', 'bilinear', 'bicubic'.
A new image that is [image] with the resized dimensions.
If the first parameter is not a BufferedImage.
If the provided [mode] is an unsupported mode.
If width or height is 0 or less.
Creates a new image that is a resized version of a source image using scalar values.
The image to inspect.
Scalar value, X-axis.
Scalar value, Y-axis.
Use Nearest Neighbor ('nearest').
A resize mode: 'nearest', 'linear', 'bilinear', 'bicubic'.
A new image that is [image] with the scaled dimensions.
If the first parameter is not a BufferedImage.
If the fourth parameter is an unsupported mode.
If width or height will be 0 or less.
Creates a new image that is a cropped area of a source image.
The image to inspect.
X-axis offset in pixels (from left side of image).
Y-axis offset in pixels (from top of image).
Width of crop area in pixels.
Height of crop area in pixels.
A new image that is [image] with the cropped dimensions.
If the first parameter is not a BufferedImage.
If width or height is 0 or less.
Creates a new image by flipping a source image horizontally.
The image to flip.
A new image that is [image], flipped horizontally.
If the first parameter is not a BufferedImage.
Creates a new image by flipping a source image vertically.
The image to flip.
A new image that is [image], flipped vertically.
If the first parameter is not a BufferedImage.
Creates a new image by transposing a source image's X and Y axes.
The image to transpose.
A new image that is [image], transposed.
If the first parameter is not a BufferedImage.
Fills an image with the provided color.
The image to fill.
The color, formatted as a 32-bit ARGB value.
[image]
If the first parameter is not a BufferedImage.
Paints an image into another image, changing the target image.
The image to paint into.
The image to paint.
Use 0.
X-axis offset in pixels (from left side of image).
Use 0.
Y-axis offset in pixels (from top of image).
Use source image width.
Width in pixels.
Use source image height.
Height in pixels.
Use alpha compositing ('alpha').
A blending mode: 'replace', 'alpha', 'add', 'subtract', 'multiply', 'desaturate'.
Use 1.0.
The pre-alpha scalar (image alpha is also applied). NOTE: 'replace' does not use this value.
Use Nearest Neighbor ('nearest').
A resize mode: 'nearest', 'linear', 'bilinear', 'bicubic'.
[image]
If the first or second parameter is not a BufferedImage.
If the provided [mode] is an unsupported mode.
If the provided [blend] is not a valid blend.
If width or height is 0 or less.
Paints an image into another image, changing the target image. To contrast with IMAGEPAINT(), this is a convenience function that does not accept resizing parameters.
The image to paint into.
The image to paint.
Use 0.
X-axis offset in pixels (from left side of image).
Use 0.
Y-axis offset in pixels (from top of image).
Use alpha compositing ('alpha').
A blending mode: 'replace', 'alpha', 'add', 'subtract', 'multiply', 'desaturate'.
Use 1.0.
The pre-alpha scalar (image alpha is also applied). NOTE: 'replace' does not use this value.
[image]
If the first or second parameter is not a BufferedImage.
If the provided [blend] is not a valid blend.
Sets an image's pixel data.
The image to use.
Use 0.
Image X-coordinate (from left side of image).
Use 0.
Image Y-coordinate (from top of image).
The color, formatted as a 32-bit ARGB value.
[image].
If the first parameter is not a BufferedImage.
If X or Y is out of bounds.
Gets an image's pixel data.
The image to use.
Use 0.
Image X-coordinate (from left side of image).
Use 0.
Image Y-coordinate (from top of image).
The image pixel data, 32-bit ARGB.
If the first parameter is not a BufferedImage.
If X or Y is out of bounds.
Gets the width of an image in pixels.
The image to inspect.
The image width.
If the first parameter is not a BufferedImage.
Gets the height of an image in pixels.
The image to inspect.
The image height.
If the first parameter is not a BufferedImage.
Opens a file using the current OS-assigned program.
The path to the file to open.
The path to the file to open.
If [file] is null.
True if called, false if not.
If the file is not found.
If opening a file is unsupported.
If the program cannot be started or a default program was not found.
If the OS denies acces to the file or the program that opens that file.
Browses to a provided URI using the default browser.
The URI to browse to.
If [uri] is null.
True if browsed, false if not.
If the URI is malformed.
If browsing to a URI is unsupported.
If the program cannot be started or a default program was not found.
If the OS denies acces to the file or the program that opens that file.
Checks if a file exists and is a Wad file.
Path to WAD file.
Path to WAD file.
Returns true.
True if so, false if not.
If the OS denied permission to read the file.
If there was an error reading the file.
Opens a WAD File. Registered as an open resource.
Path to WAD file.
Path to WAD file.
An open Wad.
If [file] is null.
If [file] could not be found.
If [file] is not a WAD file.
If the OS denied permission to read the file.
If there was an error reading the file.
Creates a new, empty, open WAD file. Overwrites existing files! Registered as an open resource.
Path to WAD file.
Path to WAD file.
A newly created WAD file.
If [file] is null.
If the OS denied permission to create the file.
If there was an error creating the file.
Opens a WAD into an in-memory WAD buffer (not a resource - does not require closing).
Make empty buffer.
Path to WAD file.
Path to WAD file.
An open input stream.
A loaded buffer.
If [file] could not be found.
If [file] is not a WAD file.
If the OS denied permission to read the file.
If there was an error reading the file.
Sets a Wad's major type.
The WAD to change.
The new WAD type - "iwad" or "pwad" .
[wad], on success.
If [type] is not "iwad" or "pwad".
If [wad] is not a WAD.
If a write error occurs.
Fetches a Wad's info.
The open WAD to inspect.
The fetched WAD information as a map.
If [wad] is not a Wad file.
Fetches a Wad's entry info.
The open WAD to use.
Fetch nothing.
The entry index (0-based).
The entry name (first found). Also use [startFromSearch].
Start from entry 0.
Start from entry index (0-based).
Start from entry name (first found).
If not found.
The fetched entry information as a map.
If [wad] is not a Wad file.
Fetches the index of an entry in the Wad.
The open WAD to use.
Fetch nothing.
The entry name (first found). Also use [startFromSearch].
Start from entry 0.
Start from entry index (0-based).
Start from entry name (first found).
If not found.
The index of the found entry.
If [wad] is not a Wad file.
Retrieves a contiguous set of entries from a WAD, starting from a desired index.
The open WAD to use.
Use 0.
The starting entry index.
Use [wad's entry count] - [start].
The maximum amount of entries to return.
The entry info returned.
If [wad] is not a Wad file.
Creates an iterator that iterates through all of the entries in a WAD. The value that this produces can be used in an each(...) loop. The keys are entry indices, and values are maps of entry info (a la WADENTRY). If you need to scan through a Wad with many entries, this may be a less memory-intense way to do it.
The open WAD to iterate through.
An iterator for each entry - Key: index:INTEGER, value: MAP{name:STRING, offset:INTEGER, size:INTEGER}.
If [wad] is not a Wad file.
Gets WAD data using an entry descriptor, returning it as buffers of data.
The open WAD to use.
Fetch nothing.
The entry index.
The entry name (first found). Also use [startFromSearch].
The entry descriptor.
Start from entry 0.
Start from entry index (0-based).
Start from entry name (first found).
If not found.
The entry data.
If [wad] is not a Wad file.
If [entry] is a map and "offset" or "size" are missing, or not an accepted value type.
If a read error occurs.
Gets an input stream for WAD data using an entry descriptor.
The open WAD to use.
Fetch nothing.
The entry index.
The entry name (first found). Also use [startFromSearch].
The entry descriptor.
Start from entry 0.
Start from entry index (0-based).
Start from entry name (first found).
If not found.
The entry data as an open input stream.
If [wad] is not a Wad file.
If [entry] is a map and "offset" or "size" are missing, or not an accepted value type.
If a read error occurs.
Adds an entry to a Wad.
The open WAD to use.
Use "-".
The new entry name (name is coerced into a valid name).
Synonymous with empty buffer - no data. Writes a marker.
The data to add (as UTF-8).
The data to add (read from current cursor position to the end).
The file contents to add.
The data to add.
The data to add.
The data to add.
Add to the end.
Insert at index.
[wad], if successful.
If [wad] is not a Wad file.
If [data] is not an accepted value type.
If an [index] was provided and it is less than 0 or greater than the current entry count.
If a read or write error occurs.
Removes a WAD's entry by index. Does not remove content.
The open WAD to use.
The entry index to remove.
[wad], if successful.
If [wad] is not a Wad file.
If the index is less than 0 or greater than or equal to the current entry count.
If a write error occurs.
Deletes a WAD's entry by index. Removes content!
The open WAD to use.
The entry index to delete.
[wad], if successful.
If [wad] is not a Wad file.
If the index is less than 0 or greater than or equal to the current entry count.
If a write error occurs.
Imports data into one Wad from another.
The open WAD to import into.
The open source Wad to import from.
Assume all entries from the source.
The list of entries to import from the source, in the order provided.
Add to the end.
Insert at index.
[wad], if successful.
If [wad] or [srcWad] are not Wad files.
If one of the entries in the entry list is malformed.
If the index is less than 0 or greater than or equal to the current entry count.
If a write error occurs.
Opens a Doom PK3/PKE. The ZF* functions can work with this - a Doom PK3/PKE is a Zip file! The file, if opened, is registered as a resource, and will be closed when the script terminates.
Path to PK3/PKE file. Relative paths are relative to working directory.
Path to PK3/PKE file. Relative paths are relative to working directory.
An open PK3/PKE file.
If the OS denied opening the file for the required permissions.
If [path] is null or the file is not a PK3/PKE file, or it does could not be opened/found for some reason.
Returns a list of all of the entries in an open PK3/PKE file. This is a rebrand of ZFENTRY - same function.
The open zip/PK3/PKE file.
The entry name.
If an entry by that name could not be found.
A map of entry info.
If an open zip file was not provided, or [entry] is null.
If a read error occurs, or the zip is not open.
Returns a list of all entries that start with a type of key. The name is treated case-insensitively.
An open PK3 file.
The starting prefix for the entries.
A list of maps containg Zip entry info.
If an open PK3 file was not provided, or [entry] is null.
If a read error occurs, or the PK3 is not open.
Opens a data input stream for reading from a zip file entry (and registers this resource as an open resource). This is a rebrand of ZFEOPEN - same function.
The open zip/PK3/PKE file.
The entry name.
A map of zip entry info containing the name of the entry.
An open data input stream to read from.
If an open zip file was not provided, or [entry] is null or [entry].name is null.
If [entry] could not be found in the zip.
If a read error occurs, or the zip is not open.
Reads a PK3/PKE entry as though it were a WAD file and returns an in-memory Wad buffer (not a resource - does not require closing).
The open zip/PK3/PKE file.
The entry name.
A map of zip entry info containing the name of the entry.
An open data input stream to read from.
If an open zip file was not provided, or [entry] is null or [entry].name is null.
If [entry] could not be found in the zip.
If [entry] is not a WAD file.
If a read error occurs, or the zip is not open.
Fetches all map headers in a WAD. This algorithm scans for known map data entries (e.g. THINGS, VERTEXES, etc.). If it finds one, the previous entry is the probably the header.
The open WAD to use.
The header names of all found maps. Can be empty.
If [wad] is not a Wad file.
Fetches all entries pertaining to a single map in a WAD.
The open WAD to use.
The map header entry name.
The entries that make up the map, including the header, or an empty list if it couldn't be found.
If [wad] is not a Wad file.
Returns the amount of contiguous entries that make up a map.
The open WAD to use.
The map header entry name.
The amount of entries from the header entry that comprises the whole map (including the header).
If [wad] is not a Wad file.
Inspects a single map in a Wad and returns its format type.
An open Wad.
The entry index of the map's header.
The name of the map entry to read.
If the map could not be found.
The map type (one of: "doom", "hexen", "udmf").
If [wad] is not a valid open Wad file.
Loads a Doom Map fully into memory for inspection as a MapView. The map in the Wad can be in Doom or Hexen or UDMF format.
An open Wad.
The entry index of the map's header.
The name of the map entry to read.
An open map.
If [wad] is not a valid open Wad file.
If a map could not be read from the data.
If [wad] could not be read or the map data could not be read.
Returns a map of info about a MapView.
The map view to use.
Information on the provided map.
If [mapview] is not a valid MapView.
Fetches a thing from a MapView and returns it as a map.
The map view to use.
The index of the thing to retrieve.
If true, interpret this thing as a Strife thing (different flags).
If [index] is less than 0 or greater than or equal to the amount of things in the MapView.
A map with Thing data.
If [mapview] is not a valid MapView.
Creates an iterator that iterates through each thing in the provided MapView. The value that this produces can be used in an each(...) loop. The key is the index (starts at 0), and values are maps (see THING()).
The map view to use.
If true, interpret each thing as a Strife thing (different flags).
The iterator returned.
If [mapview] is not a valid MapView.
Fetches a vertex from a MapView and returns it as a map.
The map view to use.
The index of the vertex to retrieve.
If [index] is less than 0 or greater than or equal to the amount of vertices in the MapView.
A map with Vertex data.
If [mapview] is not a valid MapView.
Creates an iterator that iterates through each vertex in the provided MapView. The value that this produces can be used in an each(...) loop. The key is the index (starts at 0), and values are maps (see VERTEX()).
The map view to use.
The iterator returned.
If [mapview] is not a valid MapView.
Fetches a linedef from a MapView and returns it as a map.
The map view to use.
The index of the linedef to retrieve.
If [index] is less than 0 or greater than or equal to the amount of linedef in the MapView.
A map with Linedef data.
If [mapview] is not a valid MapView.
Creates an iterator that iterates through each linedef in the provided MapView. The value that this produces can be used in an each(...) loop. The key is the index (starts at 0), and values are maps (see LINEDEF()).
The map view to use.
The iterator returned.
If [mapview] is not a valid MapView.
Fetches a sidedef from a MapView and returns it as a map.
The map view to use.
The index of the sidedef to retrieve.
If [index] is less than 0 or greater than or equal to the amount of sidedef in the MapView.
A map with Sidedef data.
If [mapview] is not a valid MapView.
Creates an iterator that iterates through each sidedef in the provided MapView. The value that this produces can be used in an each(...) loop. The key is the index (starts at 0), and values are maps (see SIDEDEF()).
The map view to use.
The iterator returned.
If [mapview] is not a valid MapView.
Fetches a sector from a MapView and returns it as a map.
The map view to use.
The index of the sector to retrieve.
If [index] is less than 0 or greater than or equal to the amount of sector in the MapView.
A map with Sector data.
If [mapview] is not a valid MapView.
Creates an iterator that iterates through each sector in the provided MapView. The value that this produces can be used in an each(...) loop. The key is the index (starts at 0), and values are maps (see SECTOR()).
The map view to use.
The iterator returned.
If [mapview] is not a valid MapView.
Creates an iterator for iterating through map elements as though they were a contiguous UDMF map. The value that this produces can be used in an each(...) loop. The key is a map with {type:STRING, index:INTEGER}, and values are also maps containing info of either one of the map geometry types or a UDMF global attribute (if "type" on the key map is "attribute").
The UDMF data.
The data in the UDMF Map entry (TEXTMAP).
A MapView to iterate through.
An input stream for reading a UDMF Map entry (TEXTMAP).
An open reader for reading a UDMF Map entry (TEXTMAP).
If true, interpret the things as Strife things (different flags). Only necessary for MapViews.
The iterator returned.
If [input] is not a MapView or an input stream to a UDMF map lump.
If a read error occurs.
Writes a UDMF element out to a Writer stream. Note that depending on the value type, some UDMF data may be truncated or rounded.
An open writer to write the UDMF data to.
The UDMF element type ("attribute", "thing", "linedef", "sidedef", "sector", "vertex").
The UDMF data as a map. If attribute, all keys and values are written as global attributes, else it writes the map like a UDMF structure.
[writer].
If [writer] is not a Writer, or [data] is not a map type.
If [type] is not a valid type name.
If a write error occurs.
Reads a single Doom-formatted Thing from an input stream of some kind (10 bytes) and returns the information as a map (like THING()).
A readable input stream (also DataInputStream).
If true, interpret the thing as a Strife thing (different flags).
A map with Thing data.
If [input] is not a valid input stream.
If a read error occurs.
Writes a single Doom-formatted Thing to an output stream of some kind (10 bytes). Input map requires the fields that would be returned by READTHING().
A readable output stream (also DataOutputStream).
The map of thing data/fields. If any field is missing or null, a default value is used.
If true, interpret the thing map as a Strife thing (different flags).
[output].
If [output] is not a valid output stream, or [data] is not a map.
If the [data] has a field that does not fit a required range or format.
If a write error occurs.
Reads a single Hexen/ZDoom-formatted Thing from an input stream of some kind (20 bytes) and returns the information as a map (like THING()).
A readable input stream (also DataInputStream).
A map with Thing data.
If [input] is not a valid input stream.
If a read error occurs.
Writes a single Hexen/ZDoom-formatted Thing to an output stream of some kind (10 bytes). Input map requires the fields that would be returned by READHEXENTHING().
A readable output stream (also DataOutputStream).
The map of thing data/fields. If any field is missing or null, a default value is used.
[output].
If [output] is not a valid output stream, or [data] is not a map.
If the [data] has a field that does not fit a required range or format.
If a write error occurs.
Reads a single Vertex from an input stream of some kind (4 bytes) and returns the information as a map (like VERTEX()).
A readable input stream (also DataInputStream).
A map with Vertex data.
If [input] is not a valid input stream.
If a read error occurs.
Writes a single Vertex to an output stream of some kind (4 bytes). Input map requires the fields that would be returned by READVERTEX().
A readable output stream (also DataOutputStream).
The map of thing data/fields. If any field is missing or null, a default value is used.
[output].
If [output] is not a valid output stream, or [data] is not a map.
If the [data] has a field that does not fit a required range or format.
If a write error occurs.
Reads a single Doom-formatted Linedef from an input stream of some kind (14 bytes) and returns the information as a map (like LINEDEF()).
A readable input stream (also DataInputStream).
A map with Linedef data.
If [input] is not a valid input stream.
If a read error occurs.
Writes a single Doom-formatted Linedef to an output stream of some kind (14 bytes). Input map requires the fields that would be returned by READLINEDEF().
A readable output stream (also DataOutputStream).
The map of thing data/fields. If any field is missing or null, a default value is used.
[output].
If [output] is not a valid output stream, or [data] is not a map.
If the [data] has a field that does not fit a required range or format.
If a write error occurs.
Reads a single Hexen/ZDoom-formatted Linedef from an input stream of some kind (16 bytes) and returns the information as a map (like LINEDEF()).
A readable input stream (also DataInputStream).
A map with Linedef data.
If [input] is not a valid input stream.
If a read error occurs.
Writes a single Hexen/ZDoom-formatted Linedef to an output stream of some kind (16 bytes). Input map requires the fields that would be returned by READHEXENLINEDEF().
A readable output stream (also DataOutputStream).
The map of thing data/fields. If any field is missing or null, a default value is used.
[output].
If [output] is not a valid output stream, or [data] is not a map.
If the [data] has a field that does not fit a required range or format.
If a write error occurs.
Reads a single Sidedef from an input stream of some kind (30 bytes) and returns the information as a map (like SIDEDEF()).
A readable input stream (also DataInputStream).
A map with Sidedef data.
If [input] is not a valid input stream.
If a read error occurs.
Writes a single Sidedef to an output stream of some kind (30 bytes). Input map requires the fields that would be returned by READSIDEDEF().
A readable output stream (also DataOutputStream).
The map of thing data/fields. If any field is missing or null, a default value is used.
[output].
If [output] is not a valid output stream, or [data] is not a map.
If the [data] has a field that does not fit a required range or format.
If a write error occurs.
Reads a single Sector from an input stream of some kind (26 bytes) and returns the information as a map (like SECTOR()).
A readable input stream (also DataInputStream).
A map with Sector data.
If [input] is not a valid input stream.
If a read error occurs.
Writes a single Sector to an output stream of some kind (26 bytes). Input map requires the fields that would be returned by READSECTOR().
A readable output stream (also DataOutputStream).
The map of thing data/fields. If any field is missing or null, a default value is used.
[output].
If [output] is not a valid output stream, or [data] is not a map.
If the [data] has a field that does not fit a required range or format.
If a write error occurs.
Imports a DEUTEX-style texture file, adding a TEXTUREX and PNAMES entry to a Wad.
An open Wad file.
Path to texture definition file.
Input stream for reading texture definition info (assumes UTF-8 encoding).
The reader to read the texture definition info from.
Use "TEXTURE1".
The target entry name.
If true, search for the existing entry and add to it (and PNAMES).
If true, use Strife texture set format on write (if append is true, use existing format).
[wad].
If [wad] is not a Wad, or [input] is not a valid input type.
If [input] is a file and it can't be found.
If the texture data cannot be parsed.
If [input] is a file and the OS is preventing the read.
If a read or write error occurs.
Exports a DEUTEX-style texture file from a TEXTUREx entry (and corresponding PNAMES entry).
An open Wad file.
The file to write the texture definition info to (encoding is UTF-8, file is overwritten, and then closed).
The output stream to write the texture definition info to (encoding is UTF-8).
The Writer to write the texture definition info to.
The texture entry name (PNAMES is automatically picked up).
Use default.
The header line to write first.
[wad].
If [wad] is not a Wad, or [output] is not a valid output type.
If [output] is a file and is a directory.
If the texture entry does not exist or the entry "PNAMES" does not exist, or the entries have bad data.
If [output] is a file and the OS is preventing the read.
If a read or write error occurs.
Imports a SWANTBLS-style (SWitch and ANimated TaBLeS) file, adding a Boom Engine SWITCHES and ANIMATED entry to a Wad.
An open Wad file.
Path to table file.
Input stream for reading Switch/Animated info (assumes UTF-8 encoding).
The reader to read the Switch/Animated info from.
If true, search for the existing entries and add to them (SWITCHES and ANIMATED).
[wad].
If [wad] is not a Wad, or [input] is not a valid input type.
If [input] is a file and it can't be found.
If the table data cannot be parsed.
If [input] is a file and the OS is preventing the read.
If a read or write error occurs.
Exports a SWANTBLS-style (SWitch and ANimated TaBLeS) file, from Boom Engine SWITCHES and ANIMATED entries.
An open Wad file.
The file to write the info to (encoding is UTF-8, file is overwritten, and then closed).
The output stream to write the info to (encoding is UTF-8).
The Writer to write the info to.
Use default.
The header line to write first.
[wad].
If [wad] is not a Wad, or [output] is not a valid output type.
If [output] is a file and is a directory.
If [output] is a file and the OS is preventing the read.
If a read or write error occurs.
Recursively deletes all files and directories inside a target directory.
Path to directory.
Path to directory.
If true, also delete the provided directory as well.
If [path] is null.
True if the directory existed and was cleaned, false otherwise.
If the OS is preventing the read.
Copies a file from one path to another, optionally creating directories for it. If the destination file exists, it is overwritten.
Path to source file.
Path to source file.
Path to destination file.
Path to destination file.
If true, create the directories for the destination, if not made.
If either file is null.
The created destination file.
If the source file does not exist.
If a read or write error occurs.
If the OS is preventing the read or write.
Copies a series of files from one directory to another, replicating the tree in the destination. If a destination file exists, it is overwritten.
Path to source directory (base path).
Path to source directory (base path).
Path to destination directory.
Path to destination directory.
If true, scan recursively.
Include everything.
The pattern to match each file path against for inclusion. If matched, include.
If either file is null.
The list of copied/created files (destination).
If the source or destination directory does not exist.
If the input RegEx pattern is malformed.
If a read or write error occurs.
If the OS is preventing the read or write.
Copies a text-based file, replacing the contents of the file with replace key delimited tokens with other text data. If the destination file exists, it is overwritten.
Path to source file.
Path to source file.
Path to destination file.
Path to destination file.
The mapping of key to text value, string to string.
If true, create the directories for the destination, if not made.
Use default: "%"
The token delimiter start string.
Use default: "%"
The token delimiter ending string.
If either file is null.
The created destination file.
If the source file does not exist.
If a read or write error occurs.
If the OS is preventing the read or write.
Compresses a series of files into an archive, NOT preserving directory trees. If the destination file exists, it is overwritten.
Path to target zip file.
Path to target zip file.
Paths to files to add.
Paths to files to add.
Default: False.
True to append to an existing Zip file, false to overwrite.
Default: True.
True to compress, false to not compress.
If [zipfile] is null.
The path to the created file, if [zipfile] is a STRING.
The path to the created file, if [zipfile] is an OBJECTREF:File.
If a source file cannot be opened.
If a read or write error occurs.
If the OS is preventing the read or write.
Compresses a series of files into an archive from a directory, preserving directory trees. Always recurses directory structure. If the destination file exists, it is overwritten, unless [append] is true.
Path to source directory (base path).
Path to source directory (base path).
Path to source directory.
No prefix.
The string to prefix all new entries with.
Default: False.
True to append to an existing Zip file, false to overwrite.
Include everything.
The pattern to match each file path against for inclusion. If matched, include.
Default: True.
True to compress, false to not compress.
If [zipfile] is null.
The path to the created file, if [zipfile] is a STRING.
The path to the created file, if [zipfile] is an OBJECTREF:File.
If a source file cannot be opened.
If a read or write error occurs.
If the OS is preventing the read or write.
Fetches a file from a URL and writes it to a destination file.
URL path.
URL path.
Path to destination file.
Path to destination file.
If true, create the directories for the destination, if not made.
Use 5000 ms.
Timeout in milliseconds.
If the URL or the destination file is null.
The downloaded file.
If the provided URL is malformed.
If the connection timed out.
If the connection could not be opened.
If the OS is preventing the read or write.
Unzips a Zip archive to a target directory, preserving directory structure.
Zip file path.
Zip file path.
Path to destination directory.
Path to destination directory.
All entries.
If provided, the list of entries to unzip.
If the zip file or the destination directory is null.
The list of created files.
If the provided destination is not a directory.
If the provided file is not a zip file.
If a read or write error occurs.
If the OS is preventing the read or write.
Hashes file information in a directory. No data content is hashed, just file paths, length, and modified date.
Directory path.
Directory path.
If true, scan recursively.
Use "SHA-1".
The name of the hashing algorithm to use.
If the provided directory is null.
A buffer containing the resultant hash digest.
If the provided path is not a directory.
If the OS is preventing file inspection.
Calls the DoomTools tool. Inherits STDOUT/STDERR of this script unless overridden (see options).
Map of options.
The normal return of this tool's process.
If the options map could not be applied.
Calls the DoomFetch tool. Inherits STDOUT/STDERR of this script unless overridden (see options). Make sure you are pointing at a persistent lock file and target directory to avoid re-downloading what is already downloaded.
Map of options.
The normal return of this tool's process.
If the options map could not be applied.
Calls the DoomMake tool. Inherits STDOUT/STDERR/STDIN of this script unless overridden (see options). It is important to note that the instance of DoomMake that runs has no inherent link to this instance.
Map of options.
The normal return of this tool's process.
If the options map could not be applied.
Calls the DecoHack tool. Inherits STDOUT/STDERR/STDIN of this script unless overridden (see options). If [useStdin] is true, then it will read from the [stdin] stream, either set or inherited. Also, do not use both [infile] and [infiles] as options. Use one or the other.
Map of options.
The normal return of this tool's process.
If the options map could not be applied.
Calls the DImgConv tool. Inherits STDOUT/STDERR of this script unless overridden (see options).
Map of options.
The normal return of this tool's process.
If the options map could not be applied.
Calls the DMXConvert tool. Inherits STDOUT/STDERR of this script unless overridden (see options).
Map of options.
The normal return of this tool's process.
If the options map could not be applied.
Calls the WadMerge tool. Inherits STDOUT/STDERR/STDIN of this script unless overridden (see options).
Map of options.
The normal return of this tool's process.
If the options map could not be applied.
Calls the WadScript tool. Inherits STDOUT/STDERR/STDIN of this script unless overridden (see options). It is important to note that the instance of WadScript that runs has no inherent link to this instance.
Map of options.
The normal return of this tool's process.
If the options map could not be applied.
Calls the WADTex tool. Inherits STDOUT/STDERR of this script unless overridden (see options).
Map of options.
The normal return of this tool's process.
If the options map could not be applied.
Calls the WSwAnTbl tool. Inherits STDOUT/STDERR of this script unless overridden (see options).
Map of options.
The normal return of this tool's process.
If the options map could not be applied.
Calls the WTEXport tool. Inherits STDOUT/STDERR/STDIN of this script unless overridden (see options).
Map of options.
The normal return of this tool's process.
If the options map could not be applied.
Calls the WTexScan tool. Inherits STDOUT/STDERR of this script unless overridden (see options).
Map of options.
The normal return of this tool's process.
If the options map could not be applied.