mirror of
https://github.com/dragonfireclient/hydra-dragonfire.git
synced 2024-11-21 18:34:00 -05:00
1.2 KiB
1.2 KiB
Hydra API documentation
Lua version
Hydra uses gopher-lua, Lua 5.1
Globals
arg
: table containing command line argumentshydra
: contains minetest protocol API, see hydra.mdvec2
,vec3
,box
: vector library, see vector.md
Additional packages
require()
can be used to import these modules.
escapes
: contains utility functions to deal with minetest escape sequences, see escapes.mdclient
: a function to create a client from command line arguments in the form<server> <username> <password>
. This is trivial but so commonly used that this function was added to avoid repetition in scripts.base64
: contains thebase64.encode(data)
function to base64 encode a string as well asbase64.decode(data)
to decode
Standard library additions
Source code: luax.
table.indexof(list, val)
table.copy(t, seen)
table.insert_all(t, other)
table.key_value_swap(t)
table.shuffle(t, from, to, random)
string.split(str, delim, include_empty, max_splits, sep_is_pattern)
string.trim(str)
math.hypot(x, y)
math.sign(x, tolerance)
math.factorial(x)
math.round(x)
math.clamp(min, max, v)