Input and Output
Terminal Output
print
lua
print(content...)Outputs content to the command line without a newline.
Parameters
| Parameter | Type | Description |
|---|---|---|
| content... | Any | Content to output. Non-text types are automatically converted to text. Multiple contents can be written, separated by ,; they will be separated by tabs when output. |
println
lua
println(content...)Outputs content to the command line with a newline.
Parameters
| Parameter | Type | Description |
|---|---|---|
| content... | Any | Content to output. Non-text types are automatically converted to text. Multiple contents can be written, separated by ,; they will be separated by tabs when output. |
File
FileExists
lua
exists = FileExists(path)Checks if a file exists and is readable.
Parameters
| Parameter | Type | Description |
|---|---|---|
| path | String | File path |
Return Value
| Return Value | Type | Description |
|---|---|---|
| exists | Bool | Whether the file exists |
FileSize
lua
size = FileSize(path)Gets the size of a file.
Parameters
| Parameter | Type | Description |
|---|---|---|
| path | String | File path |
Return Value
| Return Value | Type | Description |
|---|---|---|
| size | Integer | File size (in bytes) |
ASCII File Output
PrintToFile
lua
PrintToFile(path, content...)Writes content to the end of an ASCII file (appends, no newline added by default).
Parameters
| Parameter | Type | Description |
|---|---|---|
| path | String | File path |
| content... | Any | Content to write. Non-text types are automatically converted to text. Multiple contents can be written, separated by ,; they will be separated by tabs when written. |
WriteToFile
lua
WriteToFile(path, content...)Overwrites an ASCII file and adds a newline after the content.
Parameters
| Parameter | Type | Description |
|---|---|---|
| path | String | File path |
| content... | Any | Content to write. Non-text types are automatically converted to text. Multiple contents can be written, separated by ,; they will be separated by tabs when written. |
WriteLineToFile
lua
WriteLineToFile(path, content...)Overwrites an ASCII file (no additional newline added by default).
Parameters
| Parameter | Type | Description |
|---|---|---|
| path | String | File path |
| content... | Any | Content to write. Non-text types are automatically converted to text. Multiple contents can be written, separated by ,; they will be separated by tabs when written. |
ReadFromFile
lua
content = ReadFromFile(path)Reads the content of an ASCII file.
Parameters
| Parameter | Type | Description |
|---|---|---|
| path | String | File path |
Return Value
| Return Value | Type | Description |
|---|---|---|
| content | String | Text content of the file |
