Lua - Reddit – Telegram
Lua - Reddit
30 subscribers
279 photos
31 videos
4.23K links
News and discussion for the Lua programming language.

Subreddit: https://www.reddit.com/r/lua

Powered by : @r_channels & @reddit2telegram
Download Telegram
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?

https://redd.it/1ls54ev
@r_lua
Game engine

Hey! Im pretty new to lua coding from scratch (im coding balatro mods for 6-7 month, but want to make my own thing now) and i was looking for a game engine, something like godot but for lua, and i couldnt find any so far

https://redd.it/1lsq0ai
@r_lua
Getting Started with GTA V/FiveM Vehicle Mod Creation - Need Advice & Tutorials!

I’m running a FiveM server and want to dive into creating custom vehicle mods for GTA V/FiveM. I’m a beginner in this area and eager to learn the ropes. I’d love to hear from experienced modders about their process and any tips or basic tutorials you can share to help me get started. Specifically, I have a few questions:

1. Programming Languages: What programming or markup languages are commonly used for vehicle modding in GTA V/FiveM?
2. Essential Skills: What key skills or knowledge should I focus on to successfully create vehicle mods?
3. 3D Modeling Software: What are the best 3D modeling programs for creating or editing vehicle models?

Any personal experiences, beginner-friendly tutorials, or resources you can point me to would be greatly appreciated. Excited to join the modding community and start building some cool vehicles!

Thanks,

https://redd.it/1lvd58a
@r_lua
XLua vs Lua cysharp for game config files.

Can't understand what's the difference between XLua and Lua-CSharp. Which one will be more performant and gc-efficient for use in Unity? Specifically, I want to implement game configs with Lua. No complex logic, mostly numbers, strings, and some math. Something like Json on steroids.

I'm also wondering about performance: should I parse all the data from Lua into C# objects at application startup, or can I use objects directly from Lua noscripts in runtime? Accordingly, in the first option, it is better to use mostly static data and minimal logic in Lua?

https://redd.it/1lvf6gr
@r_lua
Caelum Framework - A new structured way of writing lua

Hi, today i wanted to share with you a framework that i built in these weeks in lua: Caelum-lua. This framework was created with the objective to have a way to write lua noscripts that was easy to understand, even for programmers like me that have never coded in lua, and to make them easy to integrate in engines or other types of applications .

In fact the framework originated from a need of having a noscripting language for my future application that was fast, easy to use and to embed in my application, and that would give me a way of showing informations from the noscripts in the application editor.

This made me go for lua, but it lacked of a consistent information about types of the values created and used in the noscript, so it was difficult for me to show them in an easy and consistent form in the ui.

After weeks of developing, searching, and asking ai questions about the best tips and tricks for writing lua, it was born, the Caelum Library.

On this day the library has reached a semi-functional and ready-to-use state, so I wanted to share it with you, so that more people can give me opinions, critics, ways of improving it and also general advices on the lua programming language that I am learning to love.


This is the link to the github repo: here

This is the link to the luarocks page: here


Let me know you thoughts and opinions on these and thanks for your attention.

https://redd.it/1lvtg4c
@r_lua
Who compiles this code for me and publishes it on Drive PLS

The code is:

-- Funciones para establecer colores
local function setColor(color)
local colors = {
reset = "\27[0m",
red = "\27[31m",
green = "\27[32m",
yellow = "\27[33m",
blue = "\27[34m",
magenta = "\27[35m",
cyan = "\27[36m",
white = "\27[37m",
idiot = "\27[1m",
}
return colors[color] or colors.reset
end

local function openFile(filename)
local file = io.open(filename, "r")
if file then
print(setColor("green") .. "Contenido_de_" .. filename .. ":" .. setColor("reset"))
print(file:read("*all"))
file:close()
else
print(setColor("red") .. "No se pudo abrir el archivo: " .. filename .. setColor("reset"))
end
end

local function createFile(filename)
local file = io.open(filename, "w")
if file then
print(setColor("blue") .. "Archivo " .. filename .. " creado. Escribe el contenido del archivo (escribe 'exit' para guardar y salir):" .. setColor("reset"))
while true do
local line = io.read()
if line == "exit" then break end
file:write(line .. "\n")
end
file:close()
print(setColor("green") .. "Archivo " .. filename .. " guardado." .. setColor("reset"))
else
print(setColor("red") .. "No se pudo crear el archivo: " .. filename .. setColor("reset"))
end
end

local function editFile(filename)
local file = io.open(filename, "abriendo") -- Abrir el archivo en modo de añadir
if file then
print(setColor("blue") .. "Editando " .. filename .. ". Escribe el contenido adicional (escribe 'exit' para guardar y salir):" .. setColor("reset"))
while true do
local line = io.read()
if line == "exit" then break end
file:write(line .. "\n")
end
file:close()
print(setColor("green") .. "Archivo " .. filename .. " actualizado." .. setColor("reset"))
else
print(setColor("red") .. "No se pudo abrir el archivo para editar: " .. filename .. setColor("reset"))
end
end

local function expodisk()
-- Esta función intentará abrir el explorador de archivos en la unidad de CD-ROM
os.execute("explorer.exe D:\\") -- Cambia D:\\ por la letra de tu unidad de CD-ROM
end

local function apexe(exeName)
local result = os.execute('start "" "' .. exeName .. '"')
if result then
print(setColor("green") .. "executing " .. exeName .. "..." .. setColor("reset"))
else
print(setColor("red") .. "error " .. exeName .. setColor("reset"))
end
end

local function commandPrompt()
while true do
io.write(setColor("yellow") .. "C25> " .. setColor("reset"))
local input = io.read()
local command, arg = input:match("^(%S+)%s*(.*)$")

if command == "open" then
openFile(arg)
elseif command == "create" then
createFile(arg)
elseif command == "edit" then
editFile(arg)
elseif command == "expodisk" then
expodisk()
elseif command == "apexe" then
apexe(arg)
elseif command == "exit" then
print(setColor("green") .. "exit." .. setColor("reset"))
break
elseif command == "gay" then
print(setColor("magenta") .. "Anulo Mufa." .. setColor("reset"))
break
elseif command == "hi" then
print(setColor("idiot") .. "hi bro" .. setColor("reset"))
elseif command == "whatisthecolorwhite" then
print(setColor("idiot") .. "the code of this color is idiot" .. setColor("reset"))
elseif command == "open_code" then
print(setColor("idiot") .. "open ExpoOS.lua" .. setColor("reset"))

elseif command == "bitch" then
print(setColor("magenta") .. "Bitch" .. setColor("reset"))
break
elseif command == "idiot" then
print(setColor("idiot") .. "Nazi" .. setColor("reset"))
break
elseif command == "black_men" then
print(setColor("magenta") .. "i'm not a men" .. setColor("reset"))
break
elseif command == "black_girl" then
print(setColor("magenta") .. "i'm not a girl" .. setColor("reset"))
break
elseif command == "black_ai" then
print(setColor("magenta") .. "..." .. setColor("reset"))
break
elseif command == "friends" then
print(setColor("idiot") .. "forever" .. setColor("reset"))
break
else
print(setColor("red") .. "Comando no reconocido: " .. command .. setColor("reset"))
end
end
end

commandPrompt().

https://redd.it/1lwhq7l
@r_lua
pls help with list and for loop (imapfilter)

Hi everybody,

I am trying to clean up my `imapfilter` lua config. Total beginner, this is how far I got, but I cannot solve the final issue. Can you please help me?

results = {}

my_accounts = {
"one",
"two"
}

my_contain_body = { "Werbung" }

my_contain_subject = { "Wichtig" }

my_contain_from = {
"contact@bigdatacloud.com",
"Temu",
"Discord"
}

for each in pairs(my_accounts) do
-- FROM
for value in pairs(my_contain_from) do
table.insert(results, string.format("%s.INBOX:contain_from('%s')", my_accounts[each], my_contain_from[value]))
end
-- BODY
for value in pairs(my_contain_body) do
table.insert(results, string.format("%s.INBOX:contain_body('%s')", my_accounts[each], my_contain_body[value]))
end
-- SUBJECT
for value in pairs(my_contain_subject) do
table.insert(results,
string.format("%s.INBOX:contain_subject('%s')", my_accounts[each], my_contain_subject[value]))
end
end

I am able to run

for each in pairs(results) do
print(results[each])
end

in my test file and receive lines such as `one.INBOX:contain_from('Temu')`.

The last line in my `config.lua` is this

results:delete_messages()

When I run `imapfilter`, I get this

imapfilter: /home/me/.imapfilter/config.lua:210: attempt to call a nil value (method 'delete_messages')
stack traceback:
[C]: in method 'delete_messages'
/home/me/.imapfilter/config.lua:210: in main chunk

Can you please tell me what I am doing wrong? I was hoping I could automate creating the list instead of having it like this (current configuration)

results = (
one.INBOX:contain_from("Temu") +
two.INBOX:contain_body("Temu") +
one.INBOX:contain_from("Discord") +
two.INBOX:contain_body("Discord") +
-- (...)
)

The results list seems to include anything and everything I want (I can print all the expected values), but the `delete_messages` function does not work.

Thank you in advance for your help :)

https://redd.it/1lx1ejx
@r_lua
Help with Lua noscript edititing.

https://preview.redd.it/yc2p479zl8cf1.png?width=509&format=png&auto=webp&s=2bfeeb66a8a226fd1d3e576b652940fcb9b8b224

How can I change this to the equal sign (=). I tried just changing the "capslock" to "equal" "equals" and also tried "=" but nothing seemed to work...



https://redd.it/1lx5dtr
@r_lua
guys, please help me. I'm a beginner developer on "Lua" and I don't know where to start. I will be glad to see your every comment.



https://redd.it/1lxcamg
@r_lua
How to Lua with Leadwerks 5

Hi guys, I spent all week putting together this super Lua lesson for game developers. It's focused on using Lua with our game engine Leadwerks 5, but most of the knowledge is general Lua programming. Please let me know if any parts of it are confusing, and if you have any ideas how it can be improved. I hope you enjoy the tutorial!
https://www.youtube.com/watch?v=eBcbB\_Pnj\_c

https://preview.redd.it/ksxp897debcf1.jpg?width=1920&format=pjpg&auto=webp&s=aad389f2a449b3bfb540f7fae9200249753b422f

https://redd.it/1lxj9lj
@r_lua
LUA Failure

I tried to create my own mod for Farming Simulator 25. Basically, I wanted to do some of the things Autodrive does, but I don't like the way it does it. I failed. I have a lot of code, but no error messages in my FS25 log.

I don't want to do a copy & paste or a screenshot, but I'd gladly share it here. I added a GNU license to it. so anyone can make it work can use it.

https://redd.it/1lybd68
@r_lua
why

you guys know lua dont really support continue because the creator want minimalistic, if something can be done clearly with existing constructs, lua prefers to not add new syntax.

then why the hell lua creator add repeat until when we can use while loop to mimic this statement?

https://redd.it/1lykrp6
@r_lua
what is the best way to learn lua?

I've been looking for ways to learn Lua for a while now but I cant seem to find any, does anyone have any ideas for me such as a book/website that worked for them. Thanks!

https://redd.it/1lyxs93
@r_lua
Lua learner de/ger

Hey everyone,
I’m 15 and just started learning Roblox Lua from absolute zero — I have no coding experience at all.

I decided to document my learning journey step by step on TikTok (the videos are in German), mainly to stay motivated and maybe help others who are starting out too.
My Channel is forcgz
If you’re also learning Lua, working on Roblox projects, or just curious, feel free to check it out. I’d really appreciate any support or tips from more experienced devs!

https://redd.it/1m0gg15
@r_lua
Error: Build error: Failed compiling module lpeglabel.dll

Can someone try installing that rock and see if it works or help me troubleshoot this? I'm stuck in dependency hell.

https://redd.it/1m0l2zw
@r_lua