xrforge-v2/src/cmd/createplugin.lua

49 lines
926 B
Lua
Raw Normal View History

return function(app,argv)
print( [[
--
-- 1. put the code below in a file ('xrforge.myplugin.lua' e.g.)
-- 2. make sure to require it at the top of xrforge.lua (require('xrforge.myplugin') e.g.)
-- 3. profit!
--
app.on('scan_experience', function(exp)
print_r(exp)
end)
app.on('scan_experience_file', function(exp)
print_r(exp)
end)
app.on('set', function(k,v)
print("content was updated")
end)
-- plugin UI
local plugin = {
name = "MyPlugin",
info = "description / usage of your plugin goes here (html supported)",
opts = {
{
key='app.opts.plugin_myplugin_foo',
title='foo title',
info='Enable or disable foo',
default="yes",
values={yes="yes",no="no",maybe="maaaaybe"}
},
{
key='app.opts.plugin_myplugin_bar',
title='foo title',
info='Name your bar',
default="bar",
values=""
}
}
}
return plugin
]] )
os.exit()
end