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

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

Powered by : @r_channels & @reddit2telegram
Download Telegram
Need to find a LUA dev

Hi! I need to find a lua dev to make a fast and really simple noscript if anyone can do it for free!

Discord: hassantaxi

https://redd.it/1ko92x7
@r_lua
project setup with busted

I would like proposals what like a project setup could/should look like.

I got zerobrane studio and want to use busted for testing. i want to be able to build an artefact without tests. luarock is out of question as I am targetting a specific game extension.

is there anything in zerobrane supporting this? or getting close to it? I can well setup shell noscripts, but a more integrated approach would be preferred.

https://redd.it/1koq15g
@r_lua
Lua for Pokemon Pinball

Would anyone know know how to write a Lua noscript to the makes the entire playfield visible in pokemon pinball RS?

https://redd.it/1kot5zn
@r_lua
CRC32 implementation help

I'm developing a Lua interpreter with the Lua C API and want to implement CRC32 hashing. It kind of works, however, when I try to calculate the CRC32 hash of "test" it returns -662733300 instead of 3632233996 as an integer and FFFFFFFFD87F7E0C instead of D87F7E0C as a hexadecimal value. As a result my CRC32 hash doesn't match with the one generated in my interpreter. This is my C code for the Lua function, I'm using zlib for the crc32 function in C:

static int luacrc32(luaState L) {
uLong crc = crc32(0L, Z_NULL, 0);
const char
str = luaLcheckstring(L, 1);
uInt len = strlen(str);
crc = crc32(crc, (const Bytef *)str, len);
lua
pushinteger(L, crc);
return 1;
}

https://redd.it/1kowq1s
@r_lua
Lua for gamedev and type system

i've been trying Löve and (first game framework that i have tried) and its sucks for me in some ways. Doing everything in keyboard is good less abstractions but it does not feel quite well cause of lsp problems (i assume) maybe it's just Lua being super dynamic, but I configured Lua LSP with LÖVE extensions and tested it on some sample projects I grabbed from GitHub. The code completion is kind of broken function arguments don’t show up, type info is missing, and it just doesn’t feel reliable. so i still want the game framework style development and i still want tightly integrated types.

Compared to Godot which have good integration good type system many tools but i wanna try new things and this type situation makes it rougher for me

Am I missing something obvious?

https://redd.it/1kozn33
@r_lua
Lua linux executable

Hi! I’ve been having trouble creating a portable executable that doesn’t require installation. Here’s my project and the AppDir folder.

Hasheito

├── conf.lua

├── Hasheito.love

├── icon.png

├── Logica.lua

├── lua_modules

│   ├── lua_modules.lua

│   └── sha2.lua

├── main.lua

└── suit

├── button.lua

├── checkbox.lua

├── core.lua

├── docs

│   ├── conf.py

│   ├── core.rst

│   ├── gettingstarted.rst

│   ├── index.rst

│   ├── layout.rst

│   ├── license.rst

│   ├── Makefile

│   ├── _static

│   │   ├── demo.gif

│   │   ├── different-ids.gif

│   │   ├── hello-world.gif

│   │   ├── keyboard.gif

│   │   ├── layout.gif

│   │   ├── mutable-state.gif

│   │   ├── options.gif

│   │   └── same-ids.gif

│   ├── themes.rst

│   └── widgets.rst

├── imagebutton.lua

├── init.lua

├── input.lua

├── label.lua

├── layout.lua

├── license.txt

├── README.md

├── slider.lua

├── suit-0.1-1.rockspec

└── theme.lua

Hasheito.AppDir/

├── AppRun

├── Hasheito.desktop

├── hasheito.png

└── usr

├── AppRun

├── bin

│   └── Hasheito

├── lib

│   ├── lfs.so

│   ├── libbrotlicommon.so.1

│   ├── libbrotlidec.so.1

│   ├── libfreetype.so.6

│   ├── liblove-11.5.so

│   ├── libluajit-5.1.so.2

│   ├── libmodplug.so.1

│   ├── libmpg123.so.0

│   ├── libogg.so.0

│   ├── libopenal.so.1

│   ├── libpng16.so.16

│   ├── libSDL2-2.0.so.0

│   ├── libtheoradec.so.1

│   ├── libvorbisfile.so.3

│   ├── libvorbis.so.0

│   └── libz.so.1

├── license.txt

├── love.desktop

├── love.noscript

└── share

└── lua

└── 5.1

├── lua_modules

│   ├── lua_modules.lua

│   └── sha2.lua

└── suit

├── button.lua

├── checkbox.lua

├── core.lua

├── docs

│   ├── conf.py

│   ├── core.rst

│   ├── gettingstarted.rst

│   ├── index.rst

│   ├── layout.rst

│   ├── license.rst

│   ├── Makefile

│   ├── _static

│   │   ├── demo.gif

│   │   ├── different-ids.gif

│   │   ├── hello-world.gif

│   │   ├── keyboard.gif

│   │   ├── layout.gif

│   │   ├── mutable-state.gif

│   │   ├── options.gif

│   │   └── same-ids.gif

│   ├── themes.rst

│   └── widgets.rst

├── imagebutton.lua

├── init.lua

├── input.lua

├── label.lua

├── layout.lua

├── license.txt

├── README.md

├── slider.lua

├── suit-0.1-1.rockspec

└── theme.lua

The last error was:

Error

//Logica.lua:3: module 'sha2' not found:

no field package.preload['sha2'\]

no 'sha2' in LOVE game directories.

no file 'sha2' in LOVE paths.

no file './sha2.lua'

no file '/usr/share/luajit-2.1/sha2.lua'

no file '/usr/local/share/lua/5.1/sha2.lua'

no file '/usr/local/share/lua/5.1/sha2/init.lua'

no file '/usr/share/lua/5.1/sha2.lua'

no file '/usr/share/lua/5.1/sha2/init.lua'

no file './lua_modules/sha2.lua'

no file './sha2.so'

no file '/usr/local/lib/lua/5.1/sha2.so'

no file '/usr/lib/lua/5.1/sha2.so'

no file '/usr/local/lib/lua/5.1/loadall.so'

Traceback



[love "callbacks.lua"\]:228: in function 'handler'

[C\]: in function 'require'

//Logica.lua:3: in main chunk

[C\]: in function 'require'

main.lua:3: in main chunk

[C\]: in function 'require'

[C\]: in function 'xpcall'

[C\]: in function 'xpcall'


I hope you can help me guys!

https://redd.it/1kp1f64
@r_lua
Animations broken and I can't figure out why
https://redd.it/1kp4mrh
@r_lua
Can lua be used to distribute malware?

Someone forked my repo on github, I was checking out their version. When you download, it's not my project at all, but lua.exe and a 300kb text file for it to interpret.

Don't wanna run it, can I test in online or something? Wondering if I should report the repo.

https://redd.it/1kq8a7h
@r_lua
Is there any 3D Game Engines that uses lua?

I know about an engine called Defold, but it is suitable for creating 2D graphics, 3D does not work very well in it, Defold unfortunately does not suit my needs

https://redd.it/1kqjc2s
@r_lua
New role

Just obtained a new SWE role where Lua is a major focus in procrastination within Oil & Gas . Can anyone help me with an exercise or give me resources to learn this language properly ?

https://redd.it/1kr4egc
@r_lua
Help with creating simple "Fantasy Console" with basic stuff

Dead Everyone,


I am using LuaRT and I want to make a Fantasy Console. It looks really cool and I want to make my own version of it! Pls help I am a beginner! TIC-80 LOOKS FANTASTIC as it is retro-themed and is rainbow!

https://redd.it/1krf08o
@r_lua
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
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
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
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
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
Lua deobfuscation

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
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