Run Lua code with ! prefix
Posted: Fri Feb 22, 2013 12:50 pm
Alias
Pattern:^!(.+)$
Code:
Pattern:^!(.+)$
Code:
- Code: Select all
-- USAGE:
-- !commnad
--
-- EXAMPLE:
-- !echo("Hello from Lua")
local f,e = loadstring("return "..matches[2])
if not f then
f,e = assert(loadstring(matches[2]))
end
local r = f()
if r then display(r) end