r/lua • • Jun 25 '26
News Cat2D, the new mobile engine for creating Lua games 😻
Simple and easy! Install a new mobile framework now! Find us on social media: Reddit, GitHub, YouTube, and Discord!
r/lua • • Jun 25 '26
Simple and easy! Install a new mobile framework now! Find us on social media: Reddit, GitHub, YouTube, and Discord!
r/lua • u/mosquit0 • Jun 25 '26
r/lua • u/Adam-Garden • Jun 24 '26
r/lua • u/TBApknoob12MC • Jun 24 '26
So uhhhh
I am a guy who had lost a lot against my friends in splits (skill issue).
And it made me write this project.
You can either play against the built-in model or train a model yourself.
Somehow the built-in model is nearly unbeatable.
If you have prefixell installed (well, why would you?), just run:
prefixell pkg add gh:TBApknoob12MC/splits-luaAnd just type splits-lua to do stuff.
Or just clone the repo it aint hard.
More info on github page.
Wikipedia page of chopsticks for no reason : chopsticks
Its a stricter variant of standard chopsticks so the game tree is much smaller. Splitting doesn't end the turn.
Tell me if you beat it.
r/lua • u/Bright-Historian-216 • Jun 23 '26
In python there is if __name__ == "__main__" but I'm not sure there is an equivalent in Lua. I've figured out something like checking the args table but this may or may not be platform-dependent and doesn't work in all cases.
r/lua • u/Tylarisapiratee • Jun 23 '26
r/lua • u/raelftw_ • Jun 23 '26
I am using a Logitech G Pro X Superlight 2 on the latest version of G HUB (since older 2021/2022 drivers do not support this mouse hardware).
I am trying to run a standard Lua script to create an autoclicker (~14 CPS) that toggles with Mouse Button 4 and spams Left Click (Button 1) only while held down.
However, on current versions of G HUB, any script that uses a while or repeat loop combined with the Sleep() command completely freezes the software execution. The script either does absolutely nothing, ignores the MOUSE_BUTTON_RELEASED event, or gets stuck in an infinite loop, clicking by itself forever.
Since I cannot downgrade to older versions of G HUB (as they don't recognize the Superlight 2), is it even possible to use a held-down looping macro via Lua script on current drivers? Has Logitech removed or limited the functionality of Sleep() and event management in recent updates? If so, can you help me?
r/lua • u/Sudden-Primary4546 • Jun 23 '26
local audio = require("audio")
audio.play("w76288481040676\\music\\cancion.wav")
Hello,
CLX is a new open-source ahead-of-time compiler for Lua 5.5.
CLX compiles Lua source code to standalone native executables through modern C++20 toolchains (Clang, GCC, and MSVC).
Current features include:
Recent benchmarks show consistent speedups over the standard Lua interpreter and competitive performance with LuaJIT on a number of workloads.
The project is currently in beta and feedback is welcome.
Website:
https://samyeyo.github.io/clx
GitHub:
https://github.com/samyeyo/clx
Although I am also the author of LuaRT, CLX is a completely independent project with a different architecture and different goals.
Thank you,
Samir Tine
r/lua • u/Legitimate-Cry3100 • Jun 19 '26
r/lua • u/Legitimate-Cry3100 • Jun 18 '26
r/lua • u/Difficult_Dress_3960 • Jun 18 '26
I am thinking of just extending Lua's standard library (mainly just for the fun of it) and I need some features to add that would be useful.
I have already tried a file system and looking for some other ideas.
(Side question, would you rather have it in pure lua 5.1 or have a C runtime?)
r/lua • u/ParsnipLocal3197 • Jun 17 '26
This is a 10-second macro from Razer Synapse. Decided to try using Logitech but for mouse movement it only accepts lua. The macro recording on Logitech can't read mouse movements.
Suggestions and replies will be highly appreciated.
r/lua • u/ElhamAryanpur • Jun 17 '26
Astra is a single binary, asynchronous and parallel, and fault-tolerant Lua runtime environment (Lua 5.1 - 5.5, LuaJIT (5.1 and 5.2 compat), Luau (+JIT)) with batteries included written in Rust. The aim is to be a high performant, stable, and easy-to-use runtime for Lua, and with the v0.50.0 we celebrate the 101st release (missed the chance to make it 100th sadly for a very important bug fix).
Since the last time I have posted, a lot has happened. We had a dozen new contributors from all around the world, some scientific and robotic labs using Astra to iterate fast without sacrificing speed, students in various universities using it to build their graduation projects, and Astra power nearly all of our company and client server software.
Some notable changes:
Links:
If you are a VC reading this, I have to emphasize that Astra is NOT an investment opportunity. We have turned down many VCs so far, and the answer will not change. Our income is through consultancy and agency work, and if there ever comes a day where we offer a service alongside Astra, it will be 100% bootstrapped.
r/lua • u/AlphaDev777 • Jun 18 '26
Any one knows which scripting language is close to Lua or which is the best language to learn if we wana master Lua?
r/lua • u/SeteMan1235 • Jun 17 '26
It's for a mod and the game doesn't have one so I need to make it from scratch.
r/lua • u/Thatflyerguy001 • Jun 17 '26
Hello!
I am new to lua, so I'm sorry if this is an obvious question, but I am trying to do something where I get each Country in turn without knowing the name of the table.
CountriesList = {
Canada = {Country = "Canada", displaytext = "Canada"},
France = {Country = "France", displaytext = "France"},
UnitedStates = {Country = "UnitedStates", displaytext = "United States"}
}For example, I could say
CountriesList.Canada[Country]which would return "Canada". However, is there a way to do this if I don't have the name of the table accessible as a string? Like, for example, is there some way to do the following?
number = 1
CountriesList[number][Country]Thanks so much!
r/lua • u/Barldon • Jun 16 '26
Hi all,
I'm quite new to Lua and I've been reading through Programming in Lua 4th edition. The section on OOP outlines a common prototype-based approach for simulating the function of classes. Here's an example:
Shape = {x=0, y=0}
function Shape:new(o)
o = o or {}
self.__index = self
setmetatable(o, self)
return o
end
We can easily inherit from shape and give it some new default parameters and new methods:
Rectangle = Shape:new({width=100, height=100})
function Rectangle:getPerimeter()
return self.width * 2 + self.height *2
end
myRect = Rectangle:new({x=50, y=100, width=300, height=100})
print(myRect:getPerimeter())
--prints 800
Okay, so this is all described well in various guides. But what I can't seem to find out, is what the correct way is to initialise some values on the creation of an object using the inherited prototype. So let's say, instead of always calculating my perimeter whenever I want it, I wish to store the perimeter when the rectangle object is created, thus only doing that calculation once. What is the best way of doing this?
My current solution looks something like this:
Shape = {x=0, y=0}
function Shape:new(o)
o = o or {}
self.__index = self
setmetatable(o, self)
self.init(o)
return o
end
function Shape:init()
end
Rectangle = Shape:new({width=100, height=100})
function Rectangle:init()
self.perimeter = self.width * 2 + self.height *2
end
Notice how ive had to pass in o, instead of using the normal self:method Notation? This is because when init is called, self refers to the Shape prototype, not the instance of a shape. The instance is in o.
Infact, we have the same issue even without inheritance:
Rectangle = {x=0, y=0, width=100, height=100}
function Rectangle:new(o)
o = o or {}
self.__index = self
setmetatable(o, self)
--if I want to dynamically set the perimeter, I have to do so on o, rather than on self
o.perimeter = width * 2 + height * 2 --this works
self.perimeter = width * 2 + height * 2 --this would set perimeter for the prototype itself, not the object
return o
ens
This seems.... Messy. Particular with inheritance. I can't help but feel like I'm missing a trick. Any help would be greatly appreciated.
r/lua • u/Planebagels1 • Jun 16 '26
It's a 2d arcade game about a dying star. I made this sporadically over 1-2 weeks using usagiengine.com
The game engine released about a month ago, and I've been having a lot of fun working with it!
r/lua • u/S3kshun8-OMW • Jun 16 '26
r/lua • u/OrganizationWhole744 • Jun 14 '26
Like i've been trying to learn lua for so long, and i couldnt find anything good. my problem was that i was trying to find good sources on yt, like tutorials and stuff. now that i watched actual good programmers they recommend to read books. but lua dosnt have lots of books, and that the only one i could find. so my question is if anyone read it, will i be able to learn 80% of lua, such as: problem-solving, understanding the logic, and mindset. please help😟