1,在游戏目录中新创建一个txt文件
2,编辑文件内容,如下(根据自己需求):
#unlock
#setquest 13606
#setlevel 29
#additems 1001 1
3,解析文件内容发送服务端,逻辑如下(Lua):
local GMFilePath = "GMFile/"
function splist(str,reps)
local result = {}
string.gsub(str, '[^' .. reps ..']+', function(w)
if w == nil then
w= "nil";
end
table.insert(result, w) end
)
return result
end
function GMSys_MultiCommond(fileName)
local str = ResouceUtility.Instance:getBuff(GMFilePath..fileName) --文件内容
local lineStr = splist(str, '\n\r')
for i, value in pairs(lineStr) do
local cmd = {
content = value
}
end
NetManagerBridge.Send2GateMessage("pb.TChatToNode",cmd)
end