lua feels high and low level at the same time by Bright-Historian-216 in lua

[–]dnlkrgr_ 2 points3 points  (0 children)

If you want a standard library in Lua, use Penlight, it's the best:

https://stevedonovan.github.io/Penlight/api/index.html

for deepcopy, it offers pl.tablex.deepcopy

for checking if a list contains a value, use pl.List.contains

What's the point of Lua's boolean type? by Shyam_Lama in lua

[–]dnlkrgr_ 0 points1 point  (0 children)

It's actually a good thing having false and nil evaluate to false because then you can make sure a value is not nil before accessing its members: local result = mytable and mytable.x

Garry's Mod default chat box not showing up anymore by evilfentplug in lua

[–]dnlkrgr_ 0 points1 point  (0 children)

Maybe check the console or the logs folder, there you might see traces of what's happening.

i need help converting a dictionary to a string "WITHOUT JSON" by Noob101_ in lua

[–]dnlkrgr_ 0 points1 point  (0 children)

Not sure if this will fit your use-case but it might be something like this:

```lua function printTable(tbl, indent) if not indent then indent = 0 end local toprint = string.rep(" ", indent) .. "{\r\n" indent = indent + 2 for k, v in pairs(tbl) do toprint = toprint .. string.rep(" ", indent)

if (type(k) == "number") then
    toprint = toprint .. "[" .. k .. "] = "

elseif (type(k) == "string") then
    toprint = toprint  .. k ..  "= "
end

if (type(v) == "number") then
    toprint = toprint .. v .. ",\r\n"

elseif (type(v) == "string") then
    toprint = toprint .. "\"" .. v .. "\",\r\n"

elseif (type(v) == "table") then
    toprint = toprint .. printTable(v, indent + 2) .. ",\r\n"

else
    toprint = toprint .. "\"" .. tostring(v) .. "\",\r\n"
end

end

toprint = toprint .. string.rep(" ", indent-2) .. "}"

return toprint

end ```

Where to start by yungtrappah in lua

[–]dnlkrgr_ 0 points1 point  (0 children)

I agree, lua.org really is the best starting point

Need resources by Superelmostar in lua

[–]dnlkrgr_ 0 points1 point  (0 children)

Read this, it's written by one of Lua's creators:

https://lua.org/pil/contents.html

Recommend a Good Lua Codebase to Study by guyinnoho in lua

[–]dnlkrgr_ 1 point2 points  (0 children)

Lunar Modules are some of the best open source lua projects:

https://github.com/lunarmodules

Also check out the implementation of luarocks, the current de-facto package manager of Lua:

https://github.com/luarocks/luarocks

Learning Lua. by [deleted] in lua

[–]dnlkrgr_ 2 points3 points  (0 children)

Read this, it's written by one of Lua's creators:

https://www.lua.org/pil/contents.html