Syntax conventions, string.foo(bar) vs bar:foo()
I'm primarily a Python programmer but I've been learning Lua for various reasons and I am coming to appreciate its sleek nature the more I use it.
That said, I'm grappling with the different syntax options that Lua provides. In the Pythonic mantra, the line
If I were to stick with one, which to do? Again referencing the Pythonic way, we have
What are your thoughts? Am I just overthinking things and applying Pythonic logic where I shouldn't? How do Lua programmers typically write their code?
https://redd.it/1osu6zj
@r_lua
I'm primarily a Python programmer but I've been learning Lua for various reasons and I am coming to appreciate its sleek nature the more I use it.
That said, I'm grappling with the different syntax options that Lua provides. In the Pythonic mantra, the line
There should be one-- and preferably only one --obvious way to do it. comes to mind; while it is nice to have options I feel like I should choose one way or another and stick to it. Is this how Lua programmers typically operate? If I were to stick with one, which to do? Again referencing the Pythonic way, we have
Explicit is better than implicit. and Sparse is better than dense. and Readability counts., which to me would point to using string.foo(bar) instead of the : syntactic sugar, but it also isn't quite as compact.What are your thoughts? Am I just overthinking things and applying Pythonic logic where I shouldn't? How do Lua programmers typically write their code?
https://redd.it/1osu6zj
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
What’s a Lua feature you wish other noscripting languages had?
Lua’s simple but powerful what part do you miss elsewhere?
https://redd.it/1otfgqi
@r_lua
Lua’s simple but powerful what part do you miss elsewhere?
https://redd.it/1otfgqi
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
I coded the Collatz conjecture in Lua, please give feedback
I am a lua developer and to test my abilities I decided to code the Collatz conjecture, it's available on GitHub
It's a simple code but I am just testing my skills, if you find any way I could make the code better tell me.
Thanks
Here's the GitHub: https://github.com/Gs-pt/Collatz-conjecture?tab=readme-ov-file
https://redd.it/1othc9l
@r_lua
I am a lua developer and to test my abilities I decided to code the Collatz conjecture, it's available on GitHub
It's a simple code but I am just testing my skills, if you find any way I could make the code better tell me.
Thanks
Here's the GitHub: https://github.com/Gs-pt/Collatz-conjecture?tab=readme-ov-file
https://redd.it/1othc9l
@r_lua
GitHub
GitHub - Gs-pt/Collatz-conjecture: This is a collatz conjecture code made in lua. If you would like to donate please donate to:…
This is a collatz conjecture code made in lua. If you would like to donate please donate to: bc1qxyghk0a9z9nhdl5wzt5r8pu67hx2d2d9eksd5u - Gs-pt/Collatz-conjecture
Im new to all coding and i want to make a game of my own
How do you guys suggest that i learn the language?
https://redd.it/1otmnvz
@r_lua
How do you guys suggest that i learn the language?
https://redd.it/1otmnvz
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
Help please (scoping)
What is scoping and is it really essential to know when you noscript?
I really can’t understand it so I’m planning to learn it when I understand more things
Or do I have to understand it before I get into more stuff?
https://redd.it/1owixtg
@r_lua
What is scoping and is it really essential to know when you noscript?
I really can’t understand it so I’m planning to learn it when I understand more things
Or do I have to understand it before I get into more stuff?
https://redd.it/1owixtg
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
Need to edit a noscript so it only runs on Weekdays
I know absolutely nothing about noscripting. I was able to take a sample noscript and edit it to turn outlets on a network power strip on and off at certain times, but I don't know how to tell it to only run on weekdays. The noscript is
function outletonschedule()
for i,t,data in event.stream(event.localtime({hour=10,min=00})) do
outlet[1].on()
end
function outletoffschedule()
for i,t,data in event.stream(event.localtime({hour=17,min=00})) do
outlet1.off()
end
end
Reddit formatting is mangling it a bit, but those are two commands to turn outlet 1 on at 10a and off at 5p.
Can anyone show me how to edit the above to only run M-F?
Thank you
https://redd.it/1own2aq
@r_lua
I know absolutely nothing about noscripting. I was able to take a sample noscript and edit it to turn outlets on a network power strip on and off at certain times, but I don't know how to tell it to only run on weekdays. The noscript is
function outletonschedule()
for i,t,data in event.stream(event.localtime({hour=10,min=00})) do
outlet[1].on()
end
function outletoffschedule()
for i,t,data in event.stream(event.localtime({hour=17,min=00})) do
outlet1.off()
end
end
Reddit formatting is mangling it a bit, but those are two commands to turn outlet 1 on at 10a and off at 5p.
Can anyone show me how to edit the above to only run M-F?
Thank you
https://redd.it/1own2aq
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
Tengo un fallo en mi noscript
es una calculadora con un bucle while pero en vez de calcular arroja un montón de texto
https://redd.it/1owpcm4
@r_lua
es una calculadora con un bucle while pero en vez de calcular arroja un montón de texto
https://redd.it/1owpcm4
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
Love2d help
Im using love2d. How can i use love.filesystem.read to read only numbers and only certain lines (im trying to read from a .lua file)
https://redd.it/1oxvott
@r_lua
Im using love2d. How can i use love.filesystem.read to read only numbers and only certain lines (im trying to read from a .lua file)
https://redd.it/1oxvott
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
Lua Programming Gems book for a newer Lua programmer?
I'm still fairly new to Lua and have been working my way through the official book, remaking some of my Python programs and writing new noscripts to learn the language. I came across Lua Programming Gems from Feisty Duck and wanted to see what you guys thought of it. Would it be good for an otherwise experienced programmer learning Lua or should I hold off until I know the language better?
https://redd.it/1oz0w41
@r_lua
I'm still fairly new to Lua and have been working my way through the official book, remaking some of my Python programs and writing new noscripts to learn the language. I came across Lua Programming Gems from Feisty Duck and wanted to see what you guys thought of it. Would it be good for an otherwise experienced programmer learning Lua or should I hold off until I know the language better?
https://redd.it/1oz0w41
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
Would learning Lua effect my c++ learning journey
So i wanna learn Lua to use it on fantasy console and maybe make some Roblox games, I heard it was really easy but I'm afraid it could effect my c++ learning journey
What do you think
https://redd.it/1oz97mr
@r_lua
So i wanna learn Lua to use it on fantasy console and maybe make some Roblox games, I heard it was really easy but I'm afraid it could effect my c++ learning journey
What do you think
https://redd.it/1oz97mr
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
local variable in interactive mode
Why in the second line, the variable `a` becomes `nil`?
~ $ lua
Lua 5.4.7 Copyright (C) 1994-2024 Lua.org, PUC-Rio
> local a = 123; print(a)
123
> print(a)
nil
https://redd.it/1p00yzm
@r_lua
Why in the second line, the variable `a` becomes `nil`?
~ $ lua
Lua 5.4.7 Copyright (C) 1994-2024 Lua.org, PUC-Rio
> local a = 123; print(a)
123
> print(a)
nil
https://redd.it/1p00yzm
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
Is lua a good option for me?
Hi friends, i'm a Java/kotlin developer, most of the time i'm using Spring boot to make projects.
But recently i was searching for an easy 2 learn language for me to use It as a lab language, to learn web architecture without the opinative way from the Spring, and learn some other things like graphical programming, games and desktop programming(and a bit of DSA too).
My First ideia was lua because everyone say that Its a simple language and because Its from Brazil(my country).
I would appreciate any opinion.
https://redd.it/1p1d61d
@r_lua
Hi friends, i'm a Java/kotlin developer, most of the time i'm using Spring boot to make projects.
But recently i was searching for an easy 2 learn language for me to use It as a lab language, to learn web architecture without the opinative way from the Spring, and learn some other things like graphical programming, games and desktop programming(and a bit of DSA too).
My First ideia was lua because everyone say that Its a simple language and because Its from Brazil(my country).
I would appreciate any opinion.
https://redd.it/1p1d61d
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
Looking for someone that could do a Serious Sam 4/Serious Sam Siberian Mayhem dynamic bones mod which mainly consists of Lua noscripting.
There was a mod of it done in an earlier game that uses the same engine, here's the link to the mod, do let me know if it's possible to do it in the newer games too! https://steamcommunity.com/sharedfiles/filedetails/?id=1304802396
https://redd.it/1p1fppk
@r_lua
There was a mod of it done in an earlier game that uses the same engine, here's the link to the mod, do let me know if it's possible to do it in the newer games too! https://steamcommunity.com/sharedfiles/filedetails/?id=1304802396
https://redd.it/1p1fppk
@r_lua
Steamcommunity
Steam Workshop::[Resource] Dynamic Bones for Players/Puppets
How do I noscript for Roblox?
Can you guys help me please, I really wanted to make a noscript for Roblox but I don't know how to do it, in fact I don't understand anything about programming and I don't have a PC to do this, but if anyone knows how to make a noscript for Roblox on their cell phone, please teach me how to create one, I would like to take a course for that but it's very expensive and I can't afford one.
https://redd.it/1p1kutb
@r_lua
Can you guys help me please, I really wanted to make a noscript for Roblox but I don't know how to do it, in fact I don't understand anything about programming and I don't have a PC to do this, but if anyone knows how to make a noscript for Roblox on their cell phone, please teach me how to create one, I would like to take a course for that but it's very expensive and I can't afford one.
https://redd.it/1p1kutb
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
Localizing
Will localizing hot table lookups be faster?
https://redd.it/1p1w5rh
@r_lua
Will localizing hot table lookups be faster?
VM.Register = {}
local Register = VM.Register
https://redd.it/1p1w5rh
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
I need help compiling a program from GitHub.
I want to decompile several Lua files. I found a page, luadec.metaworm.site, which had a GitHub repository: https://github.com/metaworm/luac-parser-rs
, so I went there, and that led me to believe it could be compiled, so I tried it (I've never done it before). This program uses Rust; I downloaded everything, even the night version, and it doesn't work when compiling. I got these errors, and of course, I don't know anything about this:
let (mut input, out) = le_u8(input)?;
...
(input, out) = complete::le_u64(input)?;
p.as_ptr().sub_ptr(input.as_ptr())
The thing is, I want to remove the censorship from a game, and I need to create a file to batch decompile it.
https://redd.it/1p1z2vh
@r_lua
I want to decompile several Lua files. I found a page, luadec.metaworm.site, which had a GitHub repository: https://github.com/metaworm/luac-parser-rs
, so I went there, and that led me to believe it could be compiled, so I tried it (I've never done it before). This program uses Rust; I downloaded everything, even the night version, and it doesn't work when compiling. I got these errors, and of course, I don't know anything about this:
let (mut input, out) = le_u8(input)?;
...
(input, out) = complete::le_u64(input)?;
p.as_ptr().sub_ptr(input.as_ptr())
The thing is, I want to remove the censorship from a game, and I need to create a file to batch decompile it.
https://redd.it/1p1z2vh
@r_lua
GitHub
GitHub - metaworm/luac-parser-rs: lua bytecode parser written in Rust using nom, part of metaworm's lua decompiler, support lu…
lua bytecode parser written in Rust using nom, part of metaworm's lua decompiler, support lua51/lua52/lua53/lua54/luajit/luau https://luadec.metaworm.site/ - metaworm/luac-parser-rs
Looking for a better pure Lua library for handling large numbers
Hey everyone, I’m looking for a pure Lua library to handle really large numbers, something easier to use.
The old library I was using (int) sometimes loses precision when dividing large numbers, so I need something more reliable.
Anyone has recommendations or alternatives?
https://redd.it/1p26lcr
@r_lua
Hey everyone, I’m looking for a pure Lua library to handle really large numbers, something easier to use.
The old library I was using (int) sometimes loses precision when dividing large numbers, so I need something more reliable.
Anyone has recommendations or alternatives?
https://redd.it/1p26lcr
@r_lua
GitHub
GitHub - SupTan85/int: Enable large-number arithmetic in pure Lua.
Enable large-number arithmetic in pure Lua. Contribute to SupTan85/int development by creating an account on GitHub.
gibt es eine Lua/Luau lern website
i will Lua/Luau lernen damit ich roblox spiele für mich und meine freunde machen kann
https://redd.it/1p29fcc
@r_lua
i will Lua/Luau lernen damit ich roblox spiele für mich und meine freunde machen kann
https://redd.it/1p29fcc
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
Hello. Starting from scratch, new to Lua, and coding in general. Where should I start?
Basically what it says on the tin, I hope to reach the end goal of creating a boat mod for project zomboid build 42 (despite the great difficulties that will come with it as seen from those who had already done it in b41), and coding games on roblox as well, and since Lua is required for both, I am here. Advice appreciated!
https://redd.it/1p4cf6f
@r_lua
Basically what it says on the tin, I hope to reach the end goal of creating a boat mod for project zomboid build 42 (despite the great difficulties that will come with it as seen from those who had already done it in b41), and coding games on roblox as well, and since Lua is required for both, I am here. Advice appreciated!
https://redd.it/1p4cf6f
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
Roblox collection (2025 - 2006) (Steal a brainrot noscripted & Grow a garden)
also includes Azure Latch stand awakening aut and more..
https://codeberg.org/RobloxCollection/Roblox\_Game\_Collection
https://preview.redd.it/qjgqrbhmwx1g1.png?width=2250&format=png&auto=webp&s=df38ca1b56377c67d8bf6660bb29c64f35456f8f
https://preview.redd.it/c3ky87towx1g1.png?width=2264&format=png&auto=webp&s=a6d2b749418c1ebe26ae10ea9859c18e73e79018
https://preview.redd.it/vogsrpfrwx1g1.png?width=2264&format=png&auto=webp&s=9cc2e1b9174e72844fbcc99944aa2d0b2cf91985
https://preview.redd.it/l29v06zswx1g1.png?width=2250&format=png&auto=webp&s=f3f0a68e70291f47af12f9383b771a699e812bb9
Whats new:
2014_empty.rbxl
2025_Click_Tower.rbxl
2025_MMP_X.rbxl
2025_Squid_Game_Glass_Bridge.rbxl
2025_Steal_A_Dragon_Ball.rbxl
2008_Dark_Plateau.rbxl
2008_Lemur_Land_Mall.rbxl
2009_Heli_Wars_Winter_Mayhem.rbxl
2013_Castle_of_Birds.rbxl
2014_London_England.rbxl
2014_Mermaid_and_Fairies_Underwater.rbxl
2014_SS_Grandure.rbxl
https://redd.it/1p4njr6
@r_lua
also includes Azure Latch stand awakening aut and more..
https://codeberg.org/RobloxCollection/Roblox\_Game\_Collection
https://preview.redd.it/qjgqrbhmwx1g1.png?width=2250&format=png&auto=webp&s=df38ca1b56377c67d8bf6660bb29c64f35456f8f
https://preview.redd.it/c3ky87towx1g1.png?width=2264&format=png&auto=webp&s=a6d2b749418c1ebe26ae10ea9859c18e73e79018
https://preview.redd.it/vogsrpfrwx1g1.png?width=2264&format=png&auto=webp&s=9cc2e1b9174e72844fbcc99944aa2d0b2cf91985
https://preview.redd.it/l29v06zswx1g1.png?width=2250&format=png&auto=webp&s=f3f0a68e70291f47af12f9383b771a699e812bb9
Whats new:
2014_empty.rbxl
2025_Click_Tower.rbxl
2025_MMP_X.rbxl
2025_Squid_Game_Glass_Bridge.rbxl
2025_Steal_A_Dragon_Ball.rbxl
2008_Dark_Plateau.rbxl
2008_Lemur_Land_Mall.rbxl
2009_Heli_Wars_Winter_Mayhem.rbxl
2013_Castle_of_Birds.rbxl
2014_London_England.rbxl
2014_Mermaid_and_Fairies_Underwater.rbxl
2014_SS_Grandure.rbxl
https://redd.it/1p4njr6
@r_lua
Codeberg.org
Roblox_Game_Collection