Contents#

Types and methods. Parameter and result types refer to the stated X4 layer; unknown contracts are explicit.

Lua globals#

Call / event Returns
assert any, ...
collectgarbage number | boolean
dofile any, ...
error never
getmetatable table | any | nil
ipairs function, table, number
next (any, any) | nil
pairs function, table, nil
pcall boolean, any, ...
rawget any | nil
rawset table
require any
select number | any, ...
setmetatable table
tonumber number | nil
tostring string
type string
unpack any, ...
xpcall boolean, any, ...

debug#

Call / event Returns
debug.getupvalue (string, any) | nil
debug.setupvalue string | nil

ffi#

Call / event Returns
ffi.cast cdata
ffi.cdef none
ffi.copy none
ffi.new cdata
ffi.sizeof number | nil
ffi.string string

math#

Call / event Returns
math.abs number
math.asin number
math.atan2 number
math.ceil number
math.cos number
math.deg number
math.floor number
math.max number
math.min number
math.rad number
math.random number
math.sin number
math.sqrt number

package#

Call / event Returns
package.loadlib function | (nil, string, string)

string#

Call / event Returns
string.byte number, ...
string.char string
string.find (number, number, ...) | nil
string.format string
string.gmatch function
string.lower string
string.rep string
string.upper string

table#

Call / event Returns
table.concat string
table.insert none
table.remove any | nil
table.sort none
table.unpack any, ...