↓ Skip to main content

Run Lua code with ! prefix

·61 words·1 min

Alias

Pattern:^!(.+)$

Code:

-- 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

This is now a default script that appears on every new profile. The only difference is that you use the alias lua instead of !