Returns the script's filename (excluding the extension)
function script.get_file(): string
-- example usage
local file = script.get_file()
Returns the unix timestamp (in seconds) at which the script was loaded
function script.get_unix(): int
-- example usage
local unix = script.get_unix()
Returns the name of the script
function script.get_name(): string
-- example usage
local name = script.get_name()
By default, the name will be the script's filename (excluding the extension)
Sets the name of the script
function script.set_name(name: string): void
-- example usage
script.set_name("Example")
Returns the description of the script
function script.get_desc(): string
-- example usage
local desc = script.get_desc()
Sets the description of the script
function script.set_desc(desc: string): void
-- example usage
script.set_desc("Example")
Registers a function that will be called when the script shuts down
function script.on_shutdown(routine: function): void
-- example usage
script.on_shutdown(function()
-- do something on shutdown
end)
Marks the script as persistent so it will stay loaded after the main thread has finished executing
function script.keep_alive(): void
-- example usage
script.keep_alive()