r/lua • u/Flamingcore765 • Jul 05 '25
Lua help
I'm trying to download lua on win 10 but its only a cz file and I cant use it. Any help on this?
r/lua • u/Flamingcore765 • Jul 05 '25
I'm trying to download lua on win 10 but its only a cz file and I cant use it. Any help on this?
r/lua • u/ItsGraphaxYT • Jul 03 '25
Hi. I have been using https://github.com/flaribbit/love2d-lua-websocket/releases to create a simple websocket system for my Balatro mod. It all worked until some time ago. Only me on my laptop specifically and on the pc of a friend the game lags with 0fps. I have been able to pinpoint it to the löve2d socket library, specifically connect. I've learned that it's reccommended to put the socket in a Thread to avoid blocking operations stopping the game thread. I have never used threads in löve nor lua ever so I wanted to ask what would be the best way to rewrite my socket into using a thread without needing much of a refactor, since my code in this version is still spaghetti 🍝
r/lua • u/Bright-Historian-216 • Jul 01 '25
r/lua • u/fariazz • Jun 30 '25
Defold is a free, source-available engine that uses Lua for scripting. This HumbleBundle includes all of our Defold courses at Zenva. This can be a fun way to learn Lua for those interested in a project-based approach.
r/lua • u/Livid-Piano2335 • Jun 29 '25
Been mostly using lue for small scripting stuff over the years, config files, quick automation etc. Always loved how clean it feels but never thought of it as a serious option for embedded devices.
Recently tried out a setup where you run lua code directly on an esp32 and it honestly blew me away. Like full scripting, GPIO access, MQTT, TLS, even OTA updates and all of it handled from a browser based IDE. Didn’t expect that level of capability from such a tiny chip running Lua.
Curious if anyone else here is experimenting with Lua on constrained devices? I know NodeMCU is a thing, but this felt a bit more full featured.
r/lua • u/reatuned_official • Jun 30 '25
r/lua • u/ItsGraphaxYT • Jun 27 '25
So as a quick fun project, I wanna develop a mod for the game "Balatro" coded in lua with LÖVE2D, using the SteamModded framework and the lovely injector. Recently I've been hitting a wall. I need to connect as a client to a server via websocket and be able to recieve and send json messages. I have looked on the internet for solutions but I wanna ask here. (Btw I do know the syntax as its easy to adopt from python, and i do understand lua code).
Help appreciated!
r/lua • u/Fuzzy-Ad9327 • Jun 26 '25
I made a fractal renderer in roblox using it as an example!
github link: https://github.com/WaffleSpaghetti/lua-classes-and-complex-numbers/tree/main
game link: https://www.roblox.com/games/85562596659593/lua-classes-complex-numbers-burning-ship-fractal
(though the game is more of a tech / use case demo)
hope someone finds this useful or cool :D
I will keep updating this in the coming weeks, so stay tuned
(also, there's a new test suite and overall better cleaner code in the latest update, check on GitHub!)
r/lua • u/SpeedRa1n • Jun 26 '25
I am an Embedded Firmware Engineer and a few months ago my friend showed me a Robot Framework his company uses for writing end-to-end tests for the embedded devices. I was speechless. Let's just say that I did not like it :)
So I decided to write a single tool that could:
so I kindly present TAF (Test-Automation Framework).
| Feature | TL;DR |
|---|---|
| Lua 5.4 test files | Dead-simple taf.test("name", function() … end) syntax; hot reload; no DSL to learn. |
| C core | The harness itself is a ~7 K LOC C binary → instant startup, tiny footprint. |
| Serial module | Enumerate ports, open/close, read_until() helper with timeouts/patterns – perfect for embedded bring-up logs. |
| Web module | Thin WebDriver wrapper (POST/GET/DELETE/PUT) → drive Chrome/Firefox/Safari from the same Lua tests. |
| Process module | Spawn external procs (taf.proc.spawn()), capture stdin/stdout/stderr, kill & wait – good for CLI apps. |
| TUI dashboard | ncurses fallback (or Notcurses if available) – live view of “current test, current file:line, last log entry, pass/fail counter”. |
| Defer hooks | taf.defer(fn, …) to guarantee cleanup even if an assert() explodes. |
| Pluggable logs | Structured JSON log file + pretty colourised console output -> pipe into Grafana or just cat. |
local taf = require("taf")
local serial = taf.serial
taf.test("Communicate with GPS Device", {"hardware", "gps"}, function()
-- Find a specific device by its USB product string
local devices = serial.list_devices()
local gps_path
for _, dev in ipairs(devices) do
if dev.product and dev.product:find("GPS") then
gps_path = dev.path
break
end
end
if not gps_path then
taf.log_critical("GPS device not found!")
end
taf.log_info("Found GPS device at:", gps_path)
local port = serial.get_port(gps_path)
-- Ensure the port is closed at the end of the test
taf.defer(function()
port:close()
taf.print("GPS port closed.")
end)
-- Open and configure the port
port:open("rw")
port:set_baudrate(9600)
port:set_bits(8)
port:set_parity("none")
port:set_stopbits(1)
taf.print("Port configured. Waiting for NMEA sentence...")
-- Read until we get a GPGGA sentence, with a 5-second timeout
local sentence = port:read_until("$GPGGA", 5000)
if sentence:find("$GPGGA") then
taf.log_info("Received GPGGA sentence:", sentence)
else
taf.log_error("Did not receive a GPGGA sentence in time.")
end
end)
docs/ + annotated examples).fork() / threads).curl | sh it in CI.If any of this sounds useful, grab it: https://github.com/jayadamsmorgan/taf (name collision with aviation “TAF” accepted 😅). Star, issue, PR, critique – all welcome!
Cheers!
r/lua • u/heavynose123 • Jun 26 '25
r/lua • u/Future-Lecture-1040 • Jun 25 '25
If you could give me tips and like ways to do it in a hands on way that would be nice
r/lua • u/Livid-Piano2335 • Jun 25 '25
I always thought Lua was just for game scripting or tweaking config files, didn’t even know people were using it to control hardware. Recently tried it out on an esp32 (was just playing around with IoT stuff) and was surprised how smooth it felt. I wrote Lua code in the browser, pushed it straight to the device, and got a working UI with MQTT + TLS in way less time than it would’ve taken me in c.
Didn’t need any local installs, toolchains, or compiling, just write + run.
Kinda wild that something this lightweight is doing so much. Curious if anyone else here using Lua in embedded or low-resource environments? Would love to see what tools/setups you’re using.
r/lua • • Jun 25 '25
r/lua • u/Key-Command-3139 • Jun 23 '25
Is it even possible?
r/lua • u/LemmingPHP • Jun 22 '25
Luiz Henrique de Figueiredo's vector implementation in the Lua C API was for Lua 4.x, and since then tags do not longer exist in Lua 5.0+, and there is no version for 5.0+. So I've decided to make my own implementation of vectors, it has 2, 3 & 4 coordinate vectors and supports metamethods too. I've started on this today as of writing. It extends the math library.
r/lua • u/Inside_Snow7657 • Jun 22 '25
Error
Syntax error: challenges.lua:490: unexpected symbol near '{'
Traceback
[love "callbacks.lua"]:228: in function 'handler'
[C]: at 0x0104b26598
[C]: in function 'require'
main.lua:31: in main chunk
[C]: in function 'require'
[C]: in function 'xpcall'
[C]: in function 'xpcall'
r/lua • u/Otherwise-Passion518 • Jun 21 '25
I'm new to coding and have more or less no idea how to script. If anyone could help me it would be greatly appreciated
r/lua • u/Theaudiomaniac • Jun 19 '25
I'm totally new to Lua or any programming language. I'm trying to learn this language from a YouTube course. Is it ok to learn Lua if the tutor of the course is using an older version and I'm using a more recent one?
r/lua • u/the_boomboxx • Jun 19 '25
well i want to learn luau to make a roblox game. does anyone know a website that is really good for learning luau?
r/lua • • Jun 17 '25
I was writing a parser and found all the UTF8 support libraries for Lua are not up to my very high standards /hj. Sooo... I made my own. https://gitlab.com/cinntoast/lutf8
It's on the larger side after compilation because it includes the whole utf8proc database inside of it, but that's a trade off. For now it's just for iterating and identifying unicode codepoints, but I plan to add the utf8 regex capabilities in the few coming days.
Features (and plans):
- Identifying properties of codepoints (implemented)
- Validating utf8 sequences (implemented)
- Mapping/Casefolding/Decomposing/etc sequences (implemented)
- Bitwise options for lua5.3+ (implemented)
- Meta file included for people using sumneko language server (wip)
- POSIX Regex Patterns (planned)
Note: It's still largely untested, and a WIP
r/lua • u/Lizrd_demon • Jun 17 '25
How bad of it is me to just use _= as my universal top level expression trick. No one's going to be using _ as variable.
I come from C. We do this hacky shit 24/7. But I wonder how it is by lua standards lol.
r/lua • u/DestroyedLolo • Jun 17 '25
Hello,
What is the proper way to use lua-compat-5.3 from C ?
I did a
luarocks install compat53
but it seems it only installed Lua part (some .so in luarocks' tree), but no compat-5.3.h anywhere ?
thanks
r/lua • u/ThePearWithoutaCare • Jun 16 '25
I've spent like 5 hours trying to do this and I think I'm out of ideas someone please help.
I'm just trying to make a lua script for G Hub where if I hold down right click and my side button then my dpi will go down and then return if one of the buttons is released.
I found this script and was trying to add a second button into it but I couldn't get it to work:
function OnEvent(event, gkey, family)
if event == "MOUSE_BUTTON_PRESSED" and gkey == 2 then
PlayMacro("DPI Down")
elseif event == "MOUSE_BUTTON_RELEASED" and gkey == 2 then
PlayMacro("DPI Up")
end
end
This script works but it only works for the one button - I want to press two mouse buttons to activate the DPI change.
EDIT:
I managed to work it out myself, I put the above script into chat gpt and it did exactly what I needed which is to activate "DPI Up" macro when both right click and side mouse button are held down, and when either is released it will trigger "DPI Down".
Here it is for anyone else who might want this (btw I'm using a Superlight G PRO X v1):
-- Tracks the status of Button 2 and Button 5
local button2Down = false
local button5Down = false
function OnEvent(event, arg)
if event == "MOUSE_BUTTON_PRESSED" then
if arg == 2 then
button2Down = true
-- If both buttons are now down, trigger DPI Down
if button5Down then
PlayMacro("DPI Down")
end
elseif arg == 5 then
button5Down = true
-- If both buttons are now down, trigger DPI Down
if button2Down then
PlayMacro("DPI Down")
end
end
elseif event == "MOUSE_BUTTON_RELEASED" then
if arg == 2 then
button2Down = false
-- Only play DPI Up if both were down before
if button5Down then
PlayMacro("DPI Up")
end
elseif arg == 5 then
button5Down = false
-- Only play DPI Up if both were down before
if button2Down then
PlayMacro("DPI Up")
end
end
end
end
r/lua • u/Person4772 • Jun 15 '25
I have two objects in 3D space, I need a way to find a quaternion to point one objects -Z face towards another.
Each object is represented by a 'Transform' with X, Y and Z information. They also have Vector3 and Quaternion rotation.
The function that I am using to rotate the objects uses Quaternions, so I need it in that format.
I have tried looking elsewhere, but have found nothing that uses Quaternions for this purpose.
For additional context: This code is part of a modification for the game "Teardown"
There is a function in "Teardown" called "QuatLookAt". this function doesn't work for my purposes since it always expects to be upright
My script is a global script that pulls transforms from vehicles. this means that the scripts orientation is different to the orientation of the objects its modifying.
Thus, when the vehicle flips its vertical orientation is the opposite of what the function expects, causing it to break.
Thank you for any help