Lua

Lua related functions

class miney.Lua(mt: miney.minetest.Minetest)[source]

Lua specific functions.

dumps(data)str[source]

Convert python data type to a string with lua data type.

Parameters

data – Python data

Returns

Lua data

run(lua_code: str, timeout: float = 10.0)[source]

Run load code on the minetest server.

Parameters
  • lua_code – Lua code to run

  • timeout – How long to wait for a result

Returns

The return value. Multiple values as a list.

run_file(filename)[source]

Loads and runs Lua code from a file. This is useful for debugging, cause Minetest can throws errors with correct line numbers. It’s also easier usable with a Lua capable IDE.

Parameters

filename

Returns