跳转至

script


get_file

string script.get_file()

Returns the script's filename (excluding the extension)
Example Usage
local file = script.get_file()

get_unix

int script.get_unix()

Returns the unix timestamp (in seconds) at which the script was loaded
Example Usage
local unix = script.get_unix()

get_name

string script.get_name()

Returns the name of the script
Example Usage
local name = script.get_name()

Note

By default the name will be the script's filename (excluding the extension)


set_name

void script.set_name(string name)

Sets the name of the script
Example Usage
script.set_name("Example")

get_desc

string script.get_desc()

Returns the description of the script
Example Usage
local desc = script.get_desc()

set_desc

void script.set_desc(string desc)

Sets the description of the script
Example Usage
script.set_desc("Example")

on_shutdown

void script.on_shutdown(function routine)

Registers a function that will be called when the script shuts down
Example Usage
script.on_shutdown(function()
    -- do something on shutdown
end)

keep_alive

void script.keep_alive()

Marks the script as persistent so it will stay loaded after the main thread has finished executing
Example Usage
script.keep_alive()