Luawe the Wayfarer Engine's scripting language All pages

table

Lists and tables.

table.insert

table.insert(list, [place,] value)

Puts a value at the end of a list, or at a place in it (what follows moves up).

table.remove

table.remove(list, place?)

Takes the last item out of a list, or the one at a place (what follows moves down), and gives it back.

table.concat

table.concat(list, separator?, from?, to?)

A list's strings and numbers joined into one string, with the separator between.

table.sort

table.sort(list, before?)

Sorts a list in place: numbers or strings by themselves, anything with a function that says whether its first value comes before its second.

table.find

table.find(list, value, from?)

The place of a value in a list, or nil.

table.unpack

table.unpack(list, from?, to?)

A list's items as separate values.

table.pack

table.pack(...)

A list of its values, with n: how many there were.

table.clone

table.clone(table)

A copy of a table (the tables inside it are shared, not copied).

table.clear

table.clear(table)

Empties a table.

table.count

table.count(table)

How many values a table has, under any key.