Announcing `evolved.lua` v1.0.0 - An Evolved ECS (Entity-Component-System) for Lua
https://github.com/BlackMATov/evolved.lua
https://redd.it/1krz5t0
@r_lua
https://github.com/BlackMATov/evolved.lua
https://redd.it/1krz5t0
@r_lua
GitHub
GitHub - BlackMATov/evolved.lua: Evolved ECS (Entity-Component-System) for Lua
Evolved ECS (Entity-Component-System) for Lua. Contribute to BlackMATov/evolved.lua development by creating an account on GitHub.
Erro em um código
Comecei a menos de uma semana a programar em lua, estou seguindo uma lista de exercícios e estou com um problema nele. Sempre que coloco um numero para ele somar, dá erro falando que o valor é nulo. Alguém consegue me ajudar?
CODIGO:
--[
Faça um Programa que peça dois números e imprima a soma.
--]
print("Digite um numero")
local
numb1 = tonumber(io.read())
print("Digite outro número")
local
numb2 = tonumber(io.read())
if
(numb1 == nil or numb2 == nil)
then
while
numb1 == nil or numb2 == nil
do
print("Por Favor, digite um numero valido")
print("Digite um numero")
numb1 = tonumber(io.read())
print("Digite outro número")
numb2 = tonumber(io.read())
end
local
soma = numb1 + numb2
print("A soma desses dois valores é " .. tostring(soma))
else
local
soma = numb1 + numb2
print("A soma entre esses dois é de " .. tostring(soma))
end
https://redd.it/1kry1gg
@r_lua
Comecei a menos de uma semana a programar em lua, estou seguindo uma lista de exercícios e estou com um problema nele. Sempre que coloco um numero para ele somar, dá erro falando que o valor é nulo. Alguém consegue me ajudar?
CODIGO:
--[
Faça um Programa que peça dois números e imprima a soma.
--]
print("Digite um numero")
local
numb1 = tonumber(io.read())
print("Digite outro número")
local
numb2 = tonumber(io.read())
if
(numb1 == nil or numb2 == nil)
then
while
numb1 == nil or numb2 == nil
do
print("Por Favor, digite um numero valido")
print("Digite um numero")
numb1 = tonumber(io.read())
print("Digite outro número")
numb2 = tonumber(io.read())
end
local
soma = numb1 + numb2
print("A soma desses dois valores é " .. tostring(soma))
else
local
soma = numb1 + numb2
print("A soma entre esses dois é de " .. tostring(soma))
end
https://redd.it/1kry1gg
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
How to make a MUD game
Dear Everyone!
As recently posted, I was thinking of making a simpler game with lua console im using LuaRT. I want to make a MUD game that is suitable and understandable for beginners. I know functions and arrays/dictionaries but I dont know how to structure it, when I think of it, I see lots of ifs and elseifs so how do i make the spagetti code good?? The theme is black market wizard type style so...... If anyone could help pls list:
*How do i layout??
*How do i next steps
*just general help!
/have a nice day/week! Kind regards, ok-truth(idk why im called this)
https://redd.it/1ks6x7u
@r_lua
Dear Everyone!
As recently posted, I was thinking of making a simpler game with lua console im using LuaRT. I want to make a MUD game that is suitable and understandable for beginners. I know functions and arrays/dictionaries but I dont know how to structure it, when I think of it, I see lots of ifs and elseifs so how do i make the spagetti code good?? The theme is black market wizard type style so...... If anyone could help pls list:
*How do i layout??
*How do i next steps
*just general help!
/have a nice day/week! Kind regards, ok-truth(idk why im called this)
https://redd.it/1ks6x7u
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
artc - Beautiful visuals through noscripting
Hello everyone. I recently wrote artc, a tool that allows you to render and export beautiful visuals via lua noscripts. The tool itself is written in C.
https://reddit.com/link/1ksp7uy/video/lymmilizrb2f1/player
Currently, the Lua API is quite minimal in what it provides the user and I would love some ideas to expand it!
https://redd.it/1ksp7uy
@r_lua
Hello everyone. I recently wrote artc, a tool that allows you to render and export beautiful visuals via lua noscripts. The tool itself is written in C.
https://reddit.com/link/1ksp7uy/video/lymmilizrb2f1/player
Currently, the Lua API is quite minimal in what it provides the user and I would love some ideas to expand it!
https://redd.it/1ksp7uy
@r_lua
GitHub
GitHub - KDesp73/artc: artc is a command-line tool for generating colorful, animated abstract artwork from Lua noscripts
artc is a command-line tool for generating colorful, animated abstract artwork from Lua noscripts - KDesp73/artc
Misunderstanding garbage collector: simple question
I am playing with garbage collection. If I populate an array a[i\] = math.random() with thousands of values, the memory isn't released when I do a={} or a=nil, if I run again the same loop after assigning a=nil, more memory will be used, what am I missing?
I am on the interpreter
https://redd.it/1kstgx3
@r_lua
I am playing with garbage collection. If I populate an array a[i\] = math.random() with thousands of values, the memory isn't released when I do a={} or a=nil, if I run again the same loop after assigning a=nil, more memory will be used, what am I missing?
I am on the interpreter
https://redd.it/1kstgx3
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
Can't set up Lua
Hi. I am trying to practice Lua and i downloaded Lua 5.1 as it was the recommended version. Latest tutorials are a lot different and show only four files after extraction. Old version shows many files after extraction and I can't make it work.
I have mingw installed and it is on the path. It also shows up when I use gcc --version. But I have no idea how to add Lua's file as command is not working as given in the guide. Version is exactly 5.1 and I want some help.
Make clean, make mingw aren't working even after I use with different case (capital and small letter) so I thought of asking here. I used command in the Lua-5.1 sub directory which is inside Lua-5.1 directory under temp main directory.
I am thinking of setting up at the hardware level so I can manually compile it using terminal in VSCodium.
I am setting up this for practice and do you think Lua is good language to make programming foundation strong?
What other things will I need for Lua?
https://redd.it/1ksuox2
@r_lua
Hi. I am trying to practice Lua and i downloaded Lua 5.1 as it was the recommended version. Latest tutorials are a lot different and show only four files after extraction. Old version shows many files after extraction and I can't make it work.
I have mingw installed and it is on the path. It also shows up when I use gcc --version. But I have no idea how to add Lua's file as command is not working as given in the guide. Version is exactly 5.1 and I want some help.
Make clean, make mingw aren't working even after I use with different case (capital and small letter) so I thought of asking here. I used command in the Lua-5.1 sub directory which is inside Lua-5.1 directory under temp main directory.
I am thinking of setting up at the hardware level so I can manually compile it using terminal in VSCodium.
I am setting up this for practice and do you think Lua is good language to make programming foundation strong?
What other things will I need for Lua?
https://redd.it/1ksuox2
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
Lua deobfuscation
please, deobfuscate this lua. I need this https://files.catbox.moe/6gtypf.lua
https://redd.it/1kt3dgq
@r_lua
please, deobfuscate this lua. I need this https://files.catbox.moe/6gtypf.lua
https://redd.it/1kt3dgq
@r_lua
Any thoughts on why Fennel isn’t more widely used?
So many nice features added to the Lua runtime such as locally scoped variables, macros, closures, keywords/symbols etc.
Is it because it’s a lisp dialect?
https://redd.it/1kt88qe
@r_lua
So many nice features added to the Lua runtime such as locally scoped variables, macros, closures, keywords/symbols etc.
Is it because it’s a lisp dialect?
https://redd.it/1kt88qe
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
Best Lua tutorial playlist?
I'm brand new to everything code. I started following "steve's teacher" but was wondering if he is the way to go? Is there someone who is the gold standard of tutorials?
https://redd.it/1ktpj3m
@r_lua
I'm brand new to everything code. I started following "steve's teacher" but was wondering if he is the way to go? Is there someone who is the gold standard of tutorials?
https://redd.it/1ktpj3m
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
Would appreciate feedback on code/structure/best practices
Hello!
I'm somewhat new to Lua and Love2d. To get started, I thought I would make a matching style game as it would require me to try out the basics while having a clear goal I think is achievable.
This has gotten quite messy, with all kinds of 'classes' that are being passed all over the place, to and through each other. I'm planning on rewriting a lot of this with things I picked up from Olivine-Labs, but it doesn't really cover how classes/structures should be set up/contained/interact with others.
All constructive feedback is greatly appreciated.
GitHub Repository
https://redd.it/1ku2qvd
@r_lua
Hello!
I'm somewhat new to Lua and Love2d. To get started, I thought I would make a matching style game as it would require me to try out the basics while having a clear goal I think is achievable.
This has gotten quite messy, with all kinds of 'classes' that are being passed all over the place, to and through each other. I'm planning on rewriting a lot of this with things I picked up from Olivine-Labs, but it doesn't really cover how classes/structures should be set up/contained/interact with others.
All constructive feedback is greatly appreciated.
GitHub Repository
https://redd.it/1ku2qvd
@r_lua
GitHub
GitHub - Olivine-Labs/lua-style-guide: Olivine Labs Lua Style Guide
Olivine Labs Lua Style Guide. Contribute to Olivine-Labs/lua-style-guide development by creating an account on GitHub.
Coder for gmod
Im looking for coder / developer for my gmod server dayz server i need to fix some problmes in the files good price for the 1 who can do it
https://redd.it/1kuhi9j
@r_lua
Im looking for coder / developer for my gmod server dayz server i need to fix some problmes in the files good price for the 1 who can do it
https://redd.it/1kuhi9j
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
pipe operators in lua are weirdly satisfying
been playing with pluto, some superset of lua
local { http, json } = require "*"
local top_lua_repos = http.request("https://api.github.com/search/repositories?q=language:lua&sort=stars")
|> json.decode
|> |data| -> data.items
|> |items| -> items:filter(|r| -> r.stargazers_count > 1000)
for i = 1, math.min(5, #top_lua_repos) do
local repo = top_lua_repos[i]
print($"{repo.name} ({repo.stargazers_count} stars)")
end
reads like "fetch → decode → filter → print" instead of a bunch of nested calls. also has string interpolation which is nice.
https://redd.it/1kukuo0
@r_lua
been playing with pluto, some superset of lua
local { http, json } = require "*"
local top_lua_repos = http.request("https://api.github.com/search/repositories?q=language:lua&sort=stars")
|> json.decode
|> |data| -> data.items
|> |items| -> items:filter(|r| -> r.stargazers_count > 1000)
for i = 1, math.min(5, #top_lua_repos) do
local repo = top_lua_repos[i]
print($"{repo.name} ({repo.stargazers_count} stars)")
end
reads like "fetch → decode → filter → print" instead of a bunch of nested calls. also has string interpolation which is nice.
https://redd.it/1kukuo0
@r_lua
Any interest in a library for real arraylists?
local list = require('list')
for k, v in ipairs(list(2, 1, nil, "hello", 5)) do
print(k .. " : " .. tostring(v))
end
Prints:
1 : 2
2 : 1
3 : nil
4 : hello
5 : 5
for reference:
for k, v in ipairs({2, 1, nil, "hello", 5}) do
print(k .. " : " .. tostring(v))
end
prints
1 : 2
2 : 1
Im working on it as an experiment, trying to judge if people would actually want it with this post to see how far with it I should go. Should it have all the niceties tables have and a whole iterator library? Or is this just to be an experiment that I use personally for fun? Throw some comments this way to let me know (or upvotes I guess but I want to hear your thoughts)
https://redd.it/1kuohq3
@r_lua
local list = require('list')
for k, v in ipairs(list(2, 1, nil, "hello", 5)) do
print(k .. " : " .. tostring(v))
end
Prints:
1 : 2
2 : 1
3 : nil
4 : hello
5 : 5
for reference:
for k, v in ipairs({2, 1, nil, "hello", 5}) do
print(k .. " : " .. tostring(v))
end
prints
1 : 2
2 : 1
Im working on it as an experiment, trying to judge if people would actually want it with this post to see how far with it I should go. Should it have all the niceties tables have and a whole iterator library? Or is this just to be an experiment that I use personally for fun? Throw some comments this way to let me know (or upvotes I guess but I want to hear your thoughts)
https://redd.it/1kuohq3
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
I need help finishing this plugin I've developed for Lightroom Classic. I will pay anyone that can help get it working. It's LUA
https://redd.it/1kusswl
@r_lua
https://redd.it/1kusswl
@r_lua
Is there a way to push custom debug information from the Lua/C-API?
I'd like to provide Lua with additional debug info when interacting with it from C. I want to push
I'm mainly targeting LuaJIT, but something compatible with all versions (PUC Lua 5.1 to 5.4 as well as LuaJIT) would be best.
https://redd.it/1kv07vu
@r_lua
I'd like to provide Lua with additional debug info when interacting with it from C. I want to push
__func__, __FILE__ and __LINE__ as the debug.getinfo() table fileds name, source/short_src and currentline, respectively. Is there an intended way to do this, would it require touching private APIs, or is it not possible at all?I'm mainly targeting LuaJIT, but something compatible with all versions (PUC Lua 5.1 to 5.4 as well as LuaJIT) would be best.
https://redd.it/1kv07vu
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
YueScript - A MoonScript dialect with lots of new features. Transpiles into Lua.
https://yuenoscript.org/doc/
https://redd.it/1kuznhw
@r_lua
https://yuenoscript.org/doc/
https://redd.it/1kuznhw
@r_lua
yuenoscript.org
Documentation
Majordome v6.04 released : Lightweight declarative automation engine and data logger
https://github.com/destroyedlolo/Majordome/releases/tag/v6.04
https://redd.it/1kv3zno
@r_lua
https://github.com/destroyedlolo/Majordome/releases/tag/v6.04
https://redd.it/1kv3zno
@r_lua
GitHub
Release v6.04 : complete data feeding (PostgreSQL support) + automated diagram generation · destroyedlolo/Majordome
v6.04 Release 📯
📌 I'm pleased to announce the release of Majordome v6.04, a lightweight and powerful event driven automation tool and low code smart data logger.
What's new
complete Postgr...
📌 I'm pleased to announce the release of Majordome v6.04, a lightweight and powerful event driven automation tool and low code smart data logger.
What's new
complete Postgr...
Grid and table question
I'm creating a 3d utility and ran into a dead end.
In the image the yellow bars represent one grid on the terrain. There is no set amount as to how many there are or can be. I'm trying to make a table aaccessible by these unset number or grid bars.
I originally tried something like -
grid = {}
for t=1, AmtOfBars, do ; grid[t\] = {} end
But when i try to add to the table like this -
table.insert ( grid[1\][1\], {
somedata = blah,
somedata2 = blah
})
I get runtime errors.
Any advice on how to set up this needed table > Thanks.
https://preview.redd.it/biec5ppsly2f1.png?width=2932&format=png&auto=webp&s=965a03bf7cb6ce0926430fcf9031f2de1f0a5f7e
https://redd.it/1kv7eh7
@r_lua
I'm creating a 3d utility and ran into a dead end.
In the image the yellow bars represent one grid on the terrain. There is no set amount as to how many there are or can be. I'm trying to make a table aaccessible by these unset number or grid bars.
I originally tried something like -
grid = {}
for t=1, AmtOfBars, do ; grid[t\] = {} end
But when i try to add to the table like this -
table.insert ( grid[1\][1\], {
somedata = blah,
somedata2 = blah
})
I get runtime errors.
Any advice on how to set up this needed table > Thanks.
https://preview.redd.it/biec5ppsly2f1.png?width=2932&format=png&auto=webp&s=965a03bf7cb6ce0926430fcf9031f2de1f0a5f7e
https://redd.it/1kv7eh7
@r_lua
Lua's scoping behavior can be quite surprising. Bug or by design?!!
Please correct me! I haven't really used
But this is what I'm really confused about:
The above code prints 4.
However, if
I mean I try to get it, it's the lexical scoping and that the reference to a remains accessible inside f(). Still, from a safety standpoint, this feels error-prone.
Technically, if
But it reads it and doesn't mutate globally (I guess that's should've been the panic )
To me, the current behavior feels more like a quirk than an intentional design.
I am familiar with
Rust will reject this code at compile time because you're trying to borrow a as mutable while it's still being used in the expression a + f(&mut a).
And I assume
https://redd.it/1kvemjb
@r_lua
Please correct me! I haven't really used
lua for a full project but I have played with it here and there! Alongside my nvim configuration.But this is what I'm really confused about:
local a = 1
function f()
a = a + 1
return a
end
print(a + f())
The above code prints 4.
However, if
a is not declared as local, it prints 3 (hmm).I mean I try to get it, it's the lexical scoping and that the reference to a remains accessible inside f(). Still, from a safety standpoint, this feels error-prone.
Technically, if
a is declared as local, and it's not within the scope of f(), the function should not be able to access or mutate. it should panic.But it reads it and doesn't mutate globally (I guess that's should've been the panic )
To me, the current behavior feels more like a quirk than an intentional design.
I am familiar with
rust so this is how I translated it :
fn main() {
let mut a = 1;
//I Know this one is as bad as a rust block can get, but it proves my point!
fn f(a: &mut i32) -> i32 {
*a += 1;
*a
}
println!("{}", a + f(&mut a)); // compiler error here!
}
Rust will reject this code at compile time because you're trying to borrow a as mutable while it's still being used in the expression a + f(&mut a).
And I assume
gcc would throw a similar complier error!https://redd.it/1kvemjb
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
New to lua
I can read Lua noscripts just fine, but something doesn't click with me. I've watched 20+ tutorials on it, yet what I don't get is every function. When do I use periods, colons, semicolons, parenthesis? When do I skip a line or add a variable?
https://redd.it/1kvh891
@r_lua
I can read Lua noscripts just fine, but something doesn't click with me. I've watched 20+ tutorials on it, yet what I don't get is every function. When do I use periods, colons, semicolons, parenthesis? When do I skip a line or add a variable?
https://redd.it/1kvh891
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community