Questions tagged as 'lua-table'

1
answer

String (g) Match

Well, I'm trying to transform a string into a table. I tried this way: toset = "nb = 10, gb = 20, sb = 0, sfb = 0, ub = 0;" toget = "nb = (.-), gb = (.-), sb = (.-), sfb = (.-), ub = (.-);" t = toset:gmatch(toget) for a,b,c,d,e in pairs(t) do...
asked by 22.09.2014 / 00:57
1
answer

How to list the variables inside a table in Lua?

For example: minion = { hp = 1000, x = 10, y = 25 } Is there any function that I can know how many variables exist within this table?     
asked by 08.08.2015 / 13:15
1
answer

Referencing a table with a string in Lua

I need to use a table in Lua, but I can only reference it through a string, for example: tabelaA = { "qualquer coisa" } variavelA = "tabelaA" print(variavelA) resultado: "qualquer coisa" Keeping in mind that I can not reference this table...
asked by 04.06.2016 / 07:05
1
answer

Create reading of a moon bool function

Well I'm learning the moon and I'm having a question, I'm trying to create the reading of a bool function on the moon. I have a function that disables or activates as I mark true or false. This function is called useappenabled , but...
asked by 05.10.2015 / 21:33
1
answer

Read table in Lua through C ++

I have a table in Lua like this: myTable={ one = {a=1, b=2, c=3}, two = {a=4, b=2, c=1} } The file has already been loaded, how do I read the table data through C ++?     
asked by 21.03.2015 / 08:06
1
answer

How to iterate with a Table in Lua? [duplicate]

How to iterate with a Table in Lua ? Example: dados = { nome = 'Wallace', idade = 25 }     
asked by 10.12.2015 / 16:07
1
answer

What would be the correct way to check if a value exists in the table in Lua?

if not name in Namez do table.insert(Namez,name) end What would be the correct way to check if a name is not in the table?     
asked by 27.10.2018 / 17:02
1
answer

Convert String to Tables

local items = {} local t = "7 2182, 4 2554, 5 9908" I wanted to convert using this string and let the table go like this: local items = {{7,2182},{4,2554},{5,9908}} Is there a way? using gsub maybe?     
asked by 12.03.2017 / 01:02
0
answers

change table to your call in. moon?

I have this table below tabela = { ["Maquina"] = { {name = "susu", level = 600}, {name = "camel", level = 600}, {name = "juju", level = 600}, }, ["bruno"] = { {name = "fada", level = 600}, {n...
asked by 25.09.2016 / 22:40
1
answer

Get string table

I'm trying to get a table as a string. EX: tabela = {1, b=2, {c=3}} print(getTableString(tabela)) If this function existed, and it worked, it would return: -> tabela = {1, b=2, {c=3}} Is there any way to do this?     
asked by 22.11.2014 / 05:13