![](/img/trans.png)
[英]Google Algorithm to encode polyline in lua5.1
我需要創建 lua 腳本來使用谷歌地圖折線編碼算法對折線坐標進行編碼。 這必須用於 lua5.1,因為它打算在配備 lua5.1 的 Redis 中運行。 以下代碼基於 google golang 等價物。 https://github.com/googlemaps/google-maps-ser ...
[英]Google Algorithm to encode polyline in lua5.1
我需要創建 lua 腳本來使用谷歌地圖折線編碼算法對折線坐標進行編碼。 這必須用於 lua5.1,因為它打算在配備 lua5.1 的 Redis 中運行。 以下代碼基於 google golang 等價物。 https://github.com/googlemaps/google-maps-ser ...
[英]Avoid loading the same script twice with rFSM library in LUA
問題描述 以下代碼是復制我遇到的問題的最小示例。 使用了 rFSM 庫,可以在這里找到: https ://github.com/kmarkus/rFSM 有三個 lua 腳本。 “main”,稱為runscript.lua ,它初始化並運行需要運行的狀態機 (SM),稱為mainTask.lu ...
[英]Lua 5.1 discover function signature
我正在嘗試重新記錄名為“收獲大規模遭遇”的游戲的 mod 庫 我能夠找到他們的文檔: http://www.oxeyegames.com/wiki/index.php/Harvest_Library 重新記錄他們記錄的所有內容不是問題,我還找到了一種方法來發現他們沒有記錄的鈎子。 但我無法找到 ...
[英]Where should .dll files be placed when using lua5.1?
我正在使用 lua5.1,我有一個需要使用的 devicecomm.dll 庫。 但是,我不確定這個庫應該放在哪里。 在 Mac 上我知道該位置應該在 /usr/local/lib/lua/5.1 下有誰知道與此等效的位置,但對於 Windows? 另外,添加這個庫時我需要更新我的任何環境變量嗎? ...
[英]How to create a multi-dimensional Lua table with Lua C Api...?
嗨,我想要 lua C api 創建 Z0AE9478A1DB9D1E2C48EFA49EAC1C7C6 提前致謝.... ...
[英]Pre-process ... input - bad argument #2 to 'format' (no value)
我有一個場景,我想將輸入輸入到 printf 實現並預處理 arguments。 我的目標是獲取輸入,如有必要,處理變量 arguments ( ... ),並將其輸入 string.format。 我遇到的問題是數據在傳遞時會“丟失”。 我發現...中的 nil 值沒有傳入。例如,如果正常運行通 ...
[英]LUA 5.1 how do i get the calling variable from a function?
function newpos(xScale, xOffset, yScale, yOFfset) print(f.Position) end local f = {} f.Position = 1 f.Size = newpos(1, 0, 1, 0) f.Filled = true f ...
[英]FiveM 'then' expected near '='
你好,當我啟動服務器並想開始做非法工作時,這會出現brx-drugs/client/client.lua:50: 'then' expected near '=' 這也是一段代碼 我不認為問題出在配置文件上,而且我無法繞過它,因為我是新開發人員 ...
[英]lua 5.1 translate utf8 russian characters to unicode?
您好,我想知道是否可以將Привет翻譯成 lua 5.1 中的\П\р\и\в\е\т 。 這個游戲沒有utf8庫,也沒有unicode庫。 我在 github 上尋找了一個為我做這件事的圖書館,但我找不到適合這個的圖書館 ...
[英]Why ChunkSpy .function part has four parameters?
使用 ChunkSpy 時,我發現一件事讓我很困惑。 讓我們看看下面的例子 既然這里是0 upvalues, 0 params, 2 stacks ,為什么.function 0 0 2 2 在另一個例子中,我們可以看到 所以我猜第一個參數是upvalues,但是第二個有什么用呢? ...
[英]How to create table entries with unique id and access them using that id..?
嗨,我需要在 lua 中創建一個表,每個條目(記錄)都可以用唯一的 id 表示 像這樣我想插入和訪問請幫助我解決這個謎語 ...
[英]Is using lua's error(.., level) an anti pattern?
Lua 5.1 的 API 提供了一個error()函數,它接受一個字符串(錯誤信息)和一個“級別”。 我的理解是這個level ,可以讓您向上移動調用堆棧,因此您可以提供更好的錯誤報告,尤其是在將模塊作為 API 交付時。 例如,假設用戶使用x = nil調用api_function(x) ...
[英]Roblox: How would I make it so this script works correctly?
我目前正在為我的游戲編寫腳本,但我遇到了一個問題。 我的腳本不會正確執行,只是將邊緣放置在地圖之外! 如果有人可以對此進行調試,那就太好了。 腳本助手鏈接 --Services local TS = game:GetService("TweenService") local RS = game:G ...
[英]Run a string as lua code to call a function with only the function name
我正在為處理輸入事件的輔助函數制作動態回調表。 我想讓a(testString)在functionTable[1](testString)執行時執行,或者允許直接從字符串運行它。 我該怎么做? (對於 Lua 5.1) ...
[英]How do you “sandbox” functions?
目前,我正在 Lua 中編寫沙箱。 到目前為止它工作正常,但我可以使用getfenv來獲取 function 以在沙箱外獲取 scope。 對於我的沙盒,我用可信函數和庫填充了一個空表。 但是,使用諸如print之類的函數,您可以使用getfenv來獲取 scope 中的全局變量。 例如:asd ...
[英]Resetting package.loaded after a test in Lua
我正在 Lua 中開發單元測試,這些測試的主要部分正在更改 package.loaded。 這從 至 以及我修改在測試開始之前加載的 package.loaded 條目的情況。 我想在每次測試后重置package.loaded 。 但我很難過。 我嘗試了包裝require,解決了一些問題,但是並沒 ...
[英]Include empty matches when using string.gmatch to split a string in lua 5.1
我有一個逗號分隔的輸入字符串,需要支持空條目。 因此,像a,b,c,,d這樣的字符串應該生成一個包含 5 個條目的表,其中第 4 個是空值。 一個簡化的例子 此代碼輸出 9 在 Lua 5.1 中,雖然只有 5 個條目。 我可以將正則表達式中的*更改為+ - 然后它報告 4 個條目a,b,c,d但不 ...
[英]How to make lua search modules that are in the same folder with the module in which require is called first?
說我有一個項目文件夾,例如: 其中main.lua : and in a.lua I just use the string "b" , trying to tell lua - find a file whose name is b.lua in the same folder of a.lu ...
[英]Why was Lua's newproxy deprecated and removed?
所以在 Lua 5.1 中, newproxy被棄用了。 在 5.2 中,它被刪除了。 但為什么? 我現在應該使用什么來構建用戶數據? 我正在嘗試實現偽類以獲得樂趣,並且用戶數據更容易。 它們使實現不變性和限制寫入某些鍵變得更加容易。 ...
[英]How can I use reflection (at runtime) in Lua?
我試圖在Lua中使用Busted(出於業務原因,我沒有寫過,或者由於這個原因我現在不允許重構)對單元代碼進行單元測試,並且在該類的模塊或依賴注入中沒有概念。 因此,我想用我制作的可跟蹤的local log = require("path.to.module.logger"):new()記錄器替 ...