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
Macro lua auto click G hub Logitech X Pro Superlight

Olá, a tempos venho vendo que aqui no comunidade, quando si ah uma duvida referente a scrip lua, os brabo estão aqui.
Então! eu tenho um scrip que uso e sem nenhum problema com ele, mas queria adicionar a função de auto click tambem para funcionar junto com todo o restante.

O quero adicionar o seguinte comando, o mouse ficar clicando o botao esquerdo continuamente enquanto estiver presionado e para ao soltar logitecamente.


Atualmente uso esse noscript;


local Spray_Randomize = math.random(29, 31)

local AK47_Pattern = {

{ x = 1, y = 1 }, { x = -1, y = -1 },

}



EnablePrimaryMouseButtonEvents(true)



function OnEvent(event, arg)

if event == "MOUSE_BUTTON_PRESSED" and arg == 1 then

if IsKeyLockOn("capslock") then

repeat

Sleep(9)

MoveMouseRelative(0, 6)

Sleep(9)

MoveMouseRelative(0 ,-6)

until not IsMouseButtonPressed(1)

end

end

end



https://redd.it/1kwyjzz
@r_lua
Astra v0.20 released - A Lua 5.1-5.4/JIT/Luau web server runtime

Astra is a Lua 5.1-5.4/JIT/Luau runtime written in Rust using mlua project. The runtime tries to be as easy to use and performant as possible, and focus mainly for web servers. Its aim is to be a single binary that you can drop anywhere to run your servers, with the speed and safety of Rust, but without having the complexity and build times. Almost all of the components is written in Rust using different popular crates.

Example usage:

-- Create a new server
local server = Astra.http.server:new()

-- Register a route
server:get("/", function()
return "hello from default Astra instance!"
end)

-- Configure the server
server.port = 3000

-- Run the server
server:run()

The runtime currently features HTTP1/2 server (axum), client (reqwest), SQL driver (sqlx), async tasks (tokio), crypto (sha2, sha3, base64), JSON (serde_json), cookies (tower), and many other smaller but useful things such as pretty printing, data validation, ...

In the v0.20 release, there has been a huge refactor in the code structure and API design, making it finally somewhat usable outside. There has also been some production testing internally at ArkForge and some other users in startups, although I would not personally recommend full production use of it as its quite young.

I am the main developer of it as well, feel free to AMA

https://redd.it/1kxhnb8
@r_lua
Can anyone tell me how to install lua and luarocks in user environment on Linux?

So the thing is i don't want to download this with sudo privilege. And building the package doesn't seem very straightforward to me. I am not able to make luarocks work.
I am beginner in Lua, I have worked with python package managers such as lua and apparently the setup of luarocks is not as straightforward as uv.
Can anyone walk me through the installation and project setup. I could move past installing a luarocks package and run it in the project. All in all I am not able to configure.

https://redd.it/1kxkm8m
@r_lua
Can Roblox Studio programming be talked about in this reddit?

Roblox Studio's main coding language is Lua (or, Luau) but it doesn't seem very appropriate to talk about here. Otherwise, is this OK?

https://redd.it/1kxwwcr
@r_lua
Beat Iphone app for learning lua

Ok guys I dont want crap about how a laptop would be better or websites or your 10 paragraphs in 1 message (Im not gonna read all that) I want an app like mimo but its teaches lua, that has a dashboard that is good. Dont go ahead and yap just give me an APP (not website) and explain why its good

https://redd.it/1kyezmu
@r_lua
Starting lua?

Can somebody recommend me to a brief introduction to lua? maybe roblox sided?
Im at the level of making flappy bird game in python with tkinter. Id be glad for any links and guides ty!
All opinions are helpful

https://redd.it/1kyybt6
@r_lua
Increment a button value by 1 on #13
https://redd.it/1kzeq92
@r_lua
Functions under the Hood (Lua 5.1/Luau)

Hi!

I'm mostly posting this to see if anyone understands what the difference is between two or three different things within Lua 5.1 or Luau somewhere in the stack or under the hood. I can't decide whether this is a Help flair or a Discussion flair, so do let me know if it's more fitted for the Discussion tag and I'll see what I can do about it.

Anyways, I understand that this subreddit is mostly based around Lua - I'm mostly doing all of this in Roblox Studio, so it's more of a Lua 5.1/Luau question, but...

Why is:
local f; f = function() end
different from
local function func()
end
when inspected using debug.info() (similar to Lua's debug.getinfo())?

For example, when I call debug.info(1, 'n') in local f; function() end, it returns: ""
but when I call it in local function func() end, it returns: "func" (the function name)

Does anyone understand what's different between the two? I understand local f; function() end is in a sense an anonymous function, but why does it matter that much under the hood?

If this is too roblox-inclined, tell me and I'll happily move this post over to r/robloxgamedev or elsewhere.

https://redd.it/1kzgnao
@r_lua
Need A bit help with Neovim plugin development

I am working on a project called model-cmp.nvim, which used python to run LLMs locally and allow text autocomplete in neovim using the model predictions. The development is taking longer than expected, the model efficiency development is taking too much time, though I can handle that part. While keeping the modelapi in one hand, it is very difficult to develop actual plugin. So I was wondering if someone would like to handle the plugin development process. The link for the plugin is https://github.com/PyDevC/model-cmp.nvim

https://redd.it/1l031vy
@r_lua
Recoil noscript need help is this going to work?

EnablePrimaryMouseButtonEvents(true)

-- Define all weapons and their recoil values (name = {x, y})
local weapons = {
{name = "R4C", recoil = {-1, 20}},
{name = "F2", recoil = {-1, 14}},
{name = "L8", recoil = {0, 10}},
{name = "AR33", recoil = {0, 11}},
{name = "G36C", recoil = {-1, 14}},
{name = "556XL", recoil = {-1, 11}},
{name = "6P41", recoil = {-1, 11}},
-- Add more weapons here
}

local weaponIndex = 1
local recoilEnabled = false

function OnEvent(event, arg)
-- Toggle recoil ON/OFF with Right Mouse Button (3)
if event == "MOUSEBUTTONPRESSED" and arg == 3 then
recoilEnabled = not recoilEnabled
if recoilEnabled then
OutputLogMessage("Recoil ON (%s)\n", weaponsweaponIndex.name)
else
OutputLogMessage("Recoil OFF\n")
end
end

-- Cycle weapons with Mouse Button 4 (arg == 4)
if event == "MOUSEBUTTONPRESSED" and arg == 4 then
weaponIndex = weaponIndex + 1
if weaponIndex > #weapons then
weaponIndex = 1
end
OutputLogMessage("Switched to: %s\n", weaponsweaponIndex.name)
end

-- Recoil control loop
if recoilEnabled and IsMouseButtonPressed(1) then
local recoil = weaponsweaponIndex.recoil
repeat
MoveMouseRelative(recoil1, recoil2)
Sleep(9)
until not IsMouseButtonPressed(1)
end
end

https://redd.it/1l0iljs
@r_lua
hello...

followed a tutorial on youtube from 4 years ago on how to install lua and it didn't work....
how the hell do i install lua????

https://redd.it/1l0lygx
@r_lua
Doxygen Lua documentation help

I'm making a Lua interpreter with the Lua C API and want to make a documentation for it. Everything seems fine, besides writing the functions inside the library: e. g.: This is a function that is for Doxygen:

nil os.delay(number seconds)

I want it to show it as is, but instead, Doxygen parses it like this:

nil os delay(number seconds)

Basically, Doxygen treats the library (os) as a type (nil os delay, this is not what I want), instead of leaving it as is (which is what i want: nil os.delay)

Here are some similar documentation pages I found that do what I want to achieve:

http://onelua.x10.mx/vita/docs/en/group__adhoc.html

https://jcnmsg.github.io/LuaDEV-R0-PSP/original/spanish/html/group___i_n_i.html

I have spent all day trying to fix this, including issuing it to the Doxygen repo, but I haven't found any solution so far.

https://redd.it/1l0pny1
@r_lua
Why do Lua tables need commas?

Wouldn't the grammar still be unambiguous if tables didn't need commas?

https://redd.it/1l0qppp
@r_lua
After Python, which language should I learn??

I’m currently learning Python, and want to learn a new language after to make games as a passion project.
After I learn Python, should I learn GDScript to make games on Godot, or should I learn Lua to make games on Roblox?
Which would be easier or harder to learn?
Which would benefit me the most?

https://redd.it/1l0tntr
@r_lua
After learning Pico8 what is best next (Picotron, Playdate, Love2D or jump to Godot).

Like the noscript says, I'm in love with the Lua language when I started making small games in Pico8, and now I want to make something much bigger, or maybe do the same games but outside Pico8, to learn more advanced things. What is your recommendation? Thanks

https://redd.it/1l146my
@r_lua
How do I get started on Lua?

im quite new to lua and im not too sure on how to get started, is there any advice you guys can give me to start coding?

https://redd.it/1l1ergq
@r_lua
LSPlua_ls Your workspace is set to C:\Users\waffle. Lua language server refused to load this directory.

How to solve this problem?

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