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) –