Page 1 of 1

Run Lua code with ! prefix

PostPosted: Fri Feb 22, 2013 12:50 pm
by Constin
Alias

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

Re: Run Lua code with ! prefix

PostPosted: Sun Mar 03, 2013 4:17 am
by Akaya
This is now a default script that appears on every new profile. The only difference is that you use the alias lua <whatever> instead of !