我从lua 5.1更新到5.3.2,我的一个脚本没有工作attempt to call a nil value (global 'loadstring')
因此,是否用新功能替换它?
在那里你可以找到函数https://www.lua.org/pil/8.html
在那里你可以测试它(不会工作)http://www.lua.org/cgi-bin/demo
一个简单的生产例子。
protocol.onConnect(function() end, function () end, ...)
Run Code Online (Sandbox Code Playgroud)
现在在 c 中,我想获取 args #1、#2 中的函数。
在字符串,数字,...我们可以使用 (lua_getstring,..) 来获取它们,但我至少没有找到如何获取函数。
int luaProtocolOnConnect(lua_State* L)
{
int base_func // func #1
int call_func // func #2
....
}
Run Code Online (Sandbox Code Playgroud) 我在寻找的是这样的代码.
local sometable = {
[1] = [2] = "abc",
}
Run Code Online (Sandbox Code Playgroud)
所以这肯定是设置2个键的错误方法.(返回错误)