Skip to main content
Filter by
Sorted by
Tagged with
Best practices
0 votes
1 replies
17 views

I want to learn, writng code in lua for fxcm(marketscope) so im looking for a resource to learn it step by step. I have a strategy that takes too long, manually so im intended to turn it to the code ...
Pedram Mehdipour's user avatar
Best practices
1 vote
9 replies
104 views

Let's say I named a function DoSomethingAsync. Now, without running it. Do you think it yields, or runs immediately, but returns something later, and allows the caller to continue running more stuff ...
karl-police's user avatar
  • 1,063
4 votes
1 answer
71 views

Below code is from nmap tableaux.lua script file which is located at /usr/share/nmap/nselib local tcopy_local function tcopy(t) local tc = {} for k, v in pairs(t) do if type(v) == "table&...
Yilmaz's user avatar
  • 51.2k
2 votes
1 answer
52 views

I’m using lazy.nvim to load nvim-tree. I extended nvim-tree to read a project-local .fdignore file and use it to hide files/directories. This works on startup, but changes to .fdignore are not ...
alkali's user avatar
  • 21
1 vote
0 answers
40 views

In macos, I have the following in my ~/.config/nvim/init.lua: vim.api.nvim_create_autocmd("BufReadPost", { callback = function() local mark = vim.api.nvim_buf_get_mark(0, '"') ...
Romstar's user avatar
  • 1,303
0 votes
0 answers
47 views

I am totally new to Lua. The main idea is to use my logitech mouse but not the buggy and resource-eating Logi Options+ application. I try to implement these actions : Btn 4 click : Mission Control ...
Prabowo Murti's user avatar
1 vote
0 answers
176 views

Take a look at the following code: local contents = assert(io.open("foo.html", "r")):read("*a") print(string.len(contents)) string.find(contents, ".+\"url\"...
Andreas's user avatar
  • 10.8k
3 votes
1 answer
124 views

I'm currently trying to implement Karatsuba Sqrt for my BigInteger module in luau, though I'm having trouble with its accuracy and I don't know what I'm doing wrong. Karatsuba function: local function ...
fosterchild's user avatar
Advice
1 vote
4 replies
179 views

I have been looking at frameworks for game development and I have found that pygame (a python game development libary) and love2d (a lua game development libary) seem the eisiest to learn. I also know ...
The python duck's user avatar
4 votes
1 answer
82 views

i have hints working for lua, but not for go. i've already tried a bunch of stuff like several go configs, though it seems like it is a server problem, because Settings: {} is what i get in ...
Bari's user avatar
  • 31
1 vote
0 answers
80 views

I found out the mini.ai html tag selection is very bad but treesitter was so good at it so I decided to change it to treesiter without loosing the good things in mini.ai so I did this config and so ...
user27392773's user avatar
1 vote
1 answer
931 views

I am a newbie Neovim user and I am configuring Neovim by Lazy in init.lua. However, I had a problem when installing Tree-sitter plugin by Lazy.nvim. In file init.lua, I use below command to install ...
Leatuyr Bertyk's user avatar
1 vote
0 answers
63 views

I am trying to run jdtls lsp on the latest nvim 0.12 with minimal setup without using any plugin for my nvim version: NVIM v0.12.0-dev-5299967 Build type: Debug LuaJIT 2.1.1764270282 However, when i ...
prajul's user avatar
  • 1,224
3 votes
1 answer
61 views

I am creating a game about fighting other people in arenas, and when 2 people are in the arena, anyone that tries to enter becomes a spectator, for some reason, the part you touch to enter the arena ...
Destroyerofdocuments's user avatar
Best practices
0 votes
7 replies
149 views

Let tableA = {"a","b","c"}. print( table.unpack(tableA) ) will print : a b c - the multiples values of table.unpack(tableA) are displayed, print( table.unpack(tableA) , &...
user1771398's user avatar
2 votes
0 answers
77 views

I have an NvChad configuration for NeoVim, and I was trying to configure a LuaSnip plugin, but for some reason my Lua snippets are working correctly, but the json ones do not, and I want to figure out ...
dvb1r's user avatar
  • 21
4 votes
1 answer
112 views

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 = {...
darkfrei's user avatar
  • 638
Advice
0 votes
3 replies
82 views

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"...
user3204810's user avatar
-4 votes
2 answers
116 views

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 = ...
Lesbiswan's user avatar
Best practices
0 votes
0 replies
46 views

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 ...
tobiasBora's user avatar
  • 2,664
1 vote
1 answer
94 views

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....
wurli's user avatar
  • 2,848
3 votes
0 answers
71 views

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 ...
user3758232's user avatar
3 votes
1 answer
77 views

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" (...
Per Ljung's user avatar
5 votes
2 answers
108 views

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 ...
monblu's user avatar
  • 547
1 vote
0 answers
55 views

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 ...
Teneson125's user avatar
0 votes
0 answers
80 views

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 ...
Coen Damen's user avatar
  • 2,109
1 vote
0 answers
77 views

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 = ...
kkikmee's user avatar
  • 11
1 vote
0 answers
150 views

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 ...
Mr-Fox-h's user avatar
0 votes
0 answers
103 views

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 ...
Patrick Gheorghe's user avatar
0 votes
1 answer
62 views

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,...
user3758232's user avatar
2 votes
1 answer
100 views

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 ...
Snap's user avatar
  • 878
0 votes
0 answers
105 views

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 ...
Alexey Ignatyev's user avatar
0 votes
0 answers
110 views

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 ...
max.html's user avatar
0 votes
0 answers
89 views

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. ...
Sirin's user avatar
  • 93
1 vote
0 answers
115 views

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 ...
Sirin's user avatar
  • 93
0 votes
0 answers
55 views

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 ...
Touniouk's user avatar
  • 397
1 vote
1 answer
243 views

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": { &...
Mykola Zotko's user avatar
  • 18.2k
0 votes
0 answers
96 views

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 = ...
Kars's user avatar
  • 1
5 votes
1 answer
128 views

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 ...
A.P.'s user avatar
  • 53
1 vote
1 answer
101 views

(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, ...
CrJo17119921's user avatar
0 votes
1 answer
182 views

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 ...
Эрик Мкртчян's user avatar
0 votes
0 answers
256 views

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 ...
martins's user avatar
  • 10.1k
3 votes
1 answer
104 views

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 ...
glades's user avatar
  • 5,446
3 votes
3 answers
196 views

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 ...
Garth Elliott's user avatar
2 votes
1 answer
223 views

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"}, {...
Jayant Choudhary's user avatar
0 votes
0 answers
43 views

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&...
WannabeGamedev's user avatar
3 votes
1 answer
105 views

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 ...
GreenScape's user avatar
  • 8,004
1 vote
1 answer
89 views

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) ...
CrJo17119921's user avatar
0 votes
0 answers
135 views

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 (...
nostromo's user avatar
  • 455
0 votes
0 answers
54 views

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'...
Chelmite's user avatar
  • 390

1
2 3 4 5
460