1
如何從同一個目錄中的其他文件運行一個函數?需要文件Lua
實施例:
file1的:
function sleep(n)
local t = os.clock()
while os.clock() - t <= n do
-- nothing
end
end
file2的:
dofile('/barboszalib.lua')
function DoSomething(target)
print(target + 3)
end
while true do
DoSomething(4)
barboszalib.sleep(5)
end
[SO Docs](https://stackoverflow.com/documentation/lua/1148/writing-and-using-modules#t=201707221630027879236) –