對不起,我仍在學習關於lua。你能糾正我,爲什麼從文件中的數據不會逐行閱讀? 這是在文件points.txt我的示例性數據: lexxo:30:1
rey:40:2
lion:40:2
prince:50:3
royal:50:3
因此,當我從上面得到的是2D陣列(表) player = {{(name),(points),(which var point earned on inde
我有一些使用LuaFileSystem的代碼。然而,並非所有將運行的系統都安裝了LuaFileSystem。我想檢查它是否已安裝,並且只運行代碼。像這樣的東西(但是這個失敗並且狀態lfs是空值) local lfsExists, lfs = pcall(function() require "lfs" end)
if lfsExists then
local lastUpdateTim
如何匹配「words」混合括號分隔的字符串,因爲它們之間用空格分隔。 EG: split_words_and_parenthesis("1791 (AR6K Async) S 2 ") --> {"1791","AR6K Async","S","2"}
這裏是我的嘗試: 海峽= 「1791(AR6K異步)S2」 for val in str:gmatch("%S+") do
if s