22,981 questions
-6
votes
0
answers
50
views
LuaSocket socket.core not found when deploying Lua app to Railway with Nixpacks [closed]
I'm creating an API but facing a lot of trouble deploying it because I'm still new to server deployment. I've been using ChatGPT for help, but I'm not getting any results.
Help me fix this error.
...
Advice
0
votes
0
replies
66
views
How can I efficiently topologically sort simplices in 3D using an expensive occlusion comparator?
I have created a partial order occlusion relation with incomparabilities on points, line segments, and triangles in 3D which are incapable of partitioning one another, and which do not cyclically ...
3
votes
1
answer
128
views
3D triangle–triangle partitioning fails when several triangles intersect at a point (Lua)
Edit:
As requested in the comments, here is how to run this code.
Go to the GitHub page and download the folder it links to. Then, make a file called mwe.tex in that folder, and copy the TeX code from ...
4
votes
1
answer
86
views
How to evaluate arithmetic expression in pseudo‑SQL style (Lua 5.1)
In love2D I have a string that represents a mathematical expression, for example:
local expr1 = "[p35] div [p36]"
local expr2 = "((([p35]*100) div [p36]) mod 100)"
local params = {...
Advice
0
votes
3
replies
59
views
String manipulation: extract words under brackets
I'm not yet very familiar with the patterns in Lua's string.gsub function.
If I have a string like this:
Fishing Lure(+100 Fishing Skill)(1 hour)
and I want extract only the string "1 hour"...
-4
votes
2
answers
102
views
Question regarding using : and [] together, Lua
Take the following block of code
function pickrand()
local v = math.random(1,3)
if v==1 then return ‘px' elseif v==2 then return ‘py' elseif v==3 then return 'pb' end
end
prin = {
x = ...
Best practices
0
votes
0
replies
39
views
Lua: install via rockspec a github project, no realease, no version
I'd like to install with rockspec lua-ext but I'm not sure what is the cleanest way to do it via rockspec:
it has no release and luarocks install --local https://github.com/thenumbernine/lua-ext does ...
1
vote
1
answer
50
views
How can I use `chansend()` to update a terminal buffer asynchronously in Neovim?
I have a callback/generator which produces output, possibly after a delay. I'd like to send these outputs to the terminal buffer as they're produced. Here's a mockup:
local term_buf = vim.api....
3
votes
0
answers
65
views
Run multiple test files from master file
I am building a test suite for my Lua application with Busted. I am organizing tests into different files that I would like to run in a given sequence, e.g. low-level unit tests first, up to ...
3
votes
1
answer
74
views
Explicit formatting of Format date/time regardless of operating system setting
As an an example:
print(os.date("%b"))
This prints "Oct" when running on a computer having date time settings set to English.
When using other language it prints "okt" (...
5
votes
2
answers
98
views
Is the condition "and true or false" redundant in Lua?
Inside a wiktionary module pages there is a function is_title() defined as:
function export.is_title(val)
if not (val and type(val) == "table") then
return false
end
...
1
vote
0
answers
38
views
Fluent Bit v4.1.1 – ${tag[1]} variable not set when dynamically naming OpenSearch index
Issue:
I’m using Fluent Bit v4.1.1 to send Docker container logs to OpenSearch.
I want to dynamically extract the project name (e.g., test-project) from the log file path /logs/test-project/... using ...
0
votes
0
answers
77
views
Running bash script with Lua and Tup causes file permission issues
I am running a legacy C++ build env with Tup, Lua5.4 on Debian13. When I run tup, under any user (also root) there are strange file permission issues. When I debug and do and "ls -l" the ...
1
vote
0
answers
65
views
How to rotate a model?
I have a code for rotating the turret model, but the mesh rotates, but the turret model also has a gun, but it either freezes regardless of the mesh rotation or simply does not rotate
local Players = ...
1
vote
0
answers
96
views
How setup Neovim for Haxe programming language (LSP and Treesitter)
Hello people on the internet.
I made my own Neovim config https://github.com/Mr-Fox-h/fox-ide and it's a good config, but I want to write codes with Haxe programming language. I installed haxe and ...
0
votes
0
answers
94
views
Require is returning a nil value in GLua for a module
I'm trying to create a module through the best practice means rather than package.seeall. Below is the code I've used. I'm running into an error where once I run require("mylibrary"), m ...
0
votes
1
answer
54
views
Access parameters from rockspec
I have a rockspec that requires compiling some C sources. I am using the make backend to do that, and my Makefile has a way to switch compile and install flags depending on variables passed to it.
Now,...
2
votes
1
answer
75
views
luarocks init not injecting project tree into lua wrapper package.path
When I run luarocks init in a directory that has a rockspec file, the tree in lua_modules/share/lua/5.1 for my project isn't added to the project.path of the generated ./lua wrapper so modules ...
0
votes
0
answers
86
views
mkottman/AndroLua: building from sources
I have a Lua integration inside my Android Application (basically printing to Bluetooth printer routines). I already has built .so libraries of AndroLua and it works fine. Recently Google sent a note ...
0
votes
0
answers
84
views
How can I change the camera's CFrame while still having standard camera controls?
I'm trying to invert the depth of the camera (multiplying the camera's CFrame by (0,0,0, -1,0,0,0,1,0,0,0,1). To my knowledge, the only way I can implement this is by setting the camera type to ...
0
votes
0
answers
81
views
Error loading lsqlite3 module for love2D due to "symbol not being found"
Follow-up to this question
My current project folder includes the main.lua file, a .db file, , a sqlite.lua file from this somewhat old page, and a lsqlite3.so file copied from my homebrew folder. ...
1
vote
0
answers
94
views
how to avoid error loading lsqlite3 module for Love2D?
Important edit: it think that the issue might come from the fact that I'm using a Mac that uses an Arm64 processor. However, I'm not entirely sure since I don't know what that means.
I'm trying to use ...
0
votes
0
answers
53
views
Execution just stops after taking a screenshot
This is a minimal version of my init.lua hammerspoon config
https://gist.github.com/Touniouk/9b7f61f5d283a1514a386b1068ec8810
My goal is to
Take a screenshot of an app
Read some text on it
Click a ...
0
votes
0
answers
148
views
How do I create larger structs using tables in lua? (in the pico-8 game engine)
I am making a card game and im now revamping how individual card information is stored.
a single card would have the following values:
x, y, suit, number, state
this is to be stored in a deck array ...
1
vote
1
answer
157
views
Added biome.json with default config, formatting suddenly works - did vtsls switch to biome automatically?
I was trying to get semicolons added automatically using <leader>fm in NvChad. It wasn't working before, so I added a biome.json file to my project directory:
{
"javascript": {
&...
0
votes
0
answers
87
views
Ball bounces off walls but not off tiles in PICO-8
I’m working on a small PICO-8 project where multiple balls/pixels should bounce around the screen.
The wall collisions work fine, but when I try to make the balls bounce off map tiles (with flag 0 = ...
5
votes
1
answer
123
views
In Lua, why is this example (from Programming in Lua 1st edition) true?
I use SQL and R at work but I am brand new to Lua. (I'd like to learn it, among other new skills, so that I can eventually make mods for Baldur's Gate 3. Not sure that makes a difference but this is ...
1
vote
1
answer
97
views
How could I zoom into a point (mouse positon) on a grid canvas?
(I've seen some similar-ish questions to mine, but they do not really apply to my case.)
I am scripting on a custom canvas for a program plugin using Lua. Drawn onto the canvas is a grid of squares, ...
0
votes
1
answer
105
views
How to capture the plaintext chunk passed to loadstring in an obfuscated Lua (Luraph-like) stub (Lua 5.1/LuaJIT, no debug lib)
I’m working with an old, unsupported Lua addon (Lua 5.1/LuaJIT). Its entry script appears to be a Luraph-style bootstrap that eventually calls loadstring with a decompressed chunk. My goal is not to ...
0
votes
0
answers
150
views
Can't get Avante.nvim to accept suggestions with custom keybindings
I'm trying to configure Avante.nvim to work with GitHub Copilot, but I can't get the suggestion acceptance keybinding to work. The suggestions appear correctly in insert mode (in gray text), but none ...
3
votes
1
answer
98
views
How do variable binds/closures work in lua
I'm a bit confused on how 'binding' works in lua. The following function (neovim) defines a callback within vim.keymap.set() to be called later involving the bufnr from the outer scope. Now coming ...
3
votes
3
answers
153
views
Declaring a variable as 'local' when outside Lua functions
I understand the difference between the scope of local and global variables, but I am confused about the difference and effects of declaring a variable OUTSIDE of Lua functions (or LOVE2D core ...
3
votes
1
answer
136
views
How to run a functions everytime I enter Insert Mode in Nvim?
i am making a small plugin for myself and i just want to run a simple command whenever I enter Insert mode.
Currently i have tried the following
vim.api.nvim_create_autocmd({"InsertEnter"}, {...
0
votes
0
answers
41
views
Apache lua_mod setup: "lua: Unable to find function fetch_token_hook in <script directory>"
We're trying to run a lua script to hook into fixups phase of a request in an apache server app, but we keep getting the following:
"[Thu Aug 28 09:55:37.099004 2025] [lua:crit] [pid <<pid&...
3
votes
1
answer
98
views
Why is it not possible to extend a function call expression returning multiple values with another value on the right in Lua
Consider this test case.
function test()
return 1, 2, 3
end
-- OK: prints 4 1 2 3
print (4, test())
-- NOT OK: prints 1 4
print (test(), 4)
Why do values returned from a function in a function ...
1
vote
1
answer
85
views
Expression returning different values when using/not using math.floor()
I have an expression: ((12 / 10) - 1) * 10)
I need to floor the result to convert it into an int. When I do that with math.floor(), I get different results:
-- a. Unfloored value
print(((12 / 10) - 1) ...
0
votes
0
answers
112
views
Nmap running with very trivial script as argument not throwing expected string expected to be triggered depending on TCP port state (open/closed)
I failed trying to get to work a very simple Lua script inside a testy2closed.nse (Nmap Script Engine).
Tried on Mac and Linux, neither worked. Nor adding the script to the nmap scripts path (...
0
votes
0
answers
49
views
Zerobrane Path not finding files...how do I set it?
I'm using Zerobrane Studio (2.00; MobDebug 0.803) on Windows 11. When I try to run/debug some code, I get:
: module 'strict' not found:
no field package.preload['strict']
no file '.\strict.lua'...
0
votes
1
answer
63
views
luarocks install falls back to root manifest
I'm working on a Sentry SDK for Lua: https://github.com/getsentry/sentry-lua
I'm trying to install it via luarocks. This is the package on luarocks: https://luarocks.org/modules/sentry/sentry
Note ...
2
votes
3
answers
122
views
How to overlap patterns with gsub?
In a string like "30 x 40 x 900" or "3 x 4 x 90", I need to replace the space characters around the "x" - if present - by a special non-breaking character. I formulated:
...
0
votes
0
answers
67
views
Is it possible to have RPZ File to apply for specific IPs in POWERDNS RECURSOR via Lua Scripting?
I need to apply different RPZ files based on client IP address. I load all RPZ files at startup, then try to discard policies not meant for the requesting IP, but it's not working. Will be needing ...
1
vote
1
answer
351
views
How to create custom snippets using luasnip
I want to make my custom snippets in latex files. I am using luasnip and this is my config:
{
"hrsh7th/nvim-cmp",
config = function()
require("luasnip.loaders.from_vscode")....
4
votes
2
answers
138
views
Issue when executing a function from a class
I'm running into some confusion in trying to make a button that executes a function from another class I have.
Firstly, i have a "button" class that i made, in which one of the parameters is ...
2
votes
1
answer
106
views
Why doesn't divsion by zero return an error (using pcall) in Lua?
The following code should result in an error message (runtime error):
local status, result = pcall(function()
return 10 / 0
end)
if not status then
print("Error during division:", ...
2
votes
1
answer
105
views
neovim 'vim.opt.list' not taking effect
I am using neovim on Linux.
NVIM v0.11.3
Build type: Release
LuaJIT 2.1.1741730670
In my options.lua I have vim.opt.list = false and vim.opt.listchars = { tab = '»'}
I have a keymap set to toggle ...
0
votes
1
answer
264
views
Is it possible to override APISIX default response using a custom plugin?
Apache APISIX by default gives inconsistent responses when returning errors. Here are some examples:
404 Not Found:
{"error_msg":"404 Route Not Found"}
502 Bad Gateway:
<html&...
3
votes
0
answers
150
views
How to Give badge when dialogue is finished [closed]
In my game i want it so that when you talk to npc it gives a badge but I want it to only give the badge at the end of the conversation
Npc name: Npc
so theres a dialogue in his head
after the player ...
0
votes
0
answers
79
views
Is there a way to synchronize love.system.setClipboardText() with browser's clipboard
So I just hosted my first game in web using love.js but the text area where one can paste or copy from only works if the in game text is copied, meaning I cannot paste text copied text from another ...
3
votes
1
answer
101
views
Love2d flickering edge on player movement
I created a simple code using Love2d that display a map created with Tiled (pixel art style), and draw a square as a player who can freely move across the map. However there is some jitter or ...
0
votes
0
answers
102
views
Roblox studio, Tool equipped
I'm trying to make it so I can save the player and character in variables in Roblox Studios, to do that I'm trying to use a Tool.Equipped event so I can get the parent once the tool is equipped (...