Basic functions I need in a few mods

ademant 6662298d76 small changes needed by api update 4 jaren geleden
README.md b0507dd1fa documentation 5 jaren geleden
depends.txt 3b6daff211 compat to 0.4.17 5 jaren geleden
functions.lua 6662298d76 small changes needed by api update 4 jaren geleden
init.lua 9bf387c4cd corrections 6 jaren geleden
license.txt 1e303387b9 update Readme / license txt 5 jaren geleden
mod.conf fd5299a847 initial commit with basic functions 6 jaren geleden

README.md

Minetest mod: Basic functions

Main repository:

https://notabug.org/ademant/basic_functions.git

Mirrors:

https://gitlab.com/ademant/basic_functions.git

https://github.com/ademant/basic_functions.git

Short description

Mod provide some functions, I need for several mods. Basically for import spreadsheet configurations.

short api:

function has_value(tab,val)

check if val is inside list tab

function import_csv(infile,def)

read configuration from infile
def.as_numeric: all values not stated in col_num, col_tab or with name "name" are interpreted as numeric
def.seperator: character to use as field delimiter in infile
def.col_num: turn this elements to numbers
def.groups_num: put this elements as numbers into matrix groups

function parse_tree(mat,ind,val)

split name of "ind" and store as nested matrix inside mat.
Example: armor_fleshy_1 will be stored in armor={fleshy={[1]=val}}

basic_functions.import_settingtype(infile)

infile - file to read configuration in style of settingtype.txt into minetest.settings, so it can be parsed by minetest.settings: methods