介绍
在本章中,我们将讨论Lua中的脚本编写,帮助完成此工作所需的工具以及一些您可能会发现有用的技术。
继承开发环境
具有代码突出显示功能的代码编辑器足以在Lua中编写脚本。代码突出显示会根据单词和字符的表示使用不同的颜色。这使您可以轻松地注意到错误和不一致之处。
例如:
function ctf.post(team,msg)
if not ctf.team(team) then
return false
end
if not ctf.team(team).log then
ctf.team(team).log = {}
end
table.insert(ctf.team(team).log,1,msg)
ctf.save()
return true
end
原贴网页链接
在本章中,我们将讨论Lua中的脚本编写,帮助完成此工作所需的工具以及一些您可能会发现有用的技术。
继承开发环境
具有代码突出显示功能的代码编辑器足以在Lua中编写脚本。代码突出显示会根据单词和字符的表示使用不同的颜色。这使您可以轻松地注意到错误和不一致之处。
例如:
function ctf.post(team,msg)
if not ctf.team(team) then
return false
end
if not ctf.team(team).log then
ctf.team(team).log = {}
end
table.insert(ctf.team(team).log,1,msg)
ctf.save()
return true
end
原贴网页链接