Run Lua code with ! prefix

Run Lua code with ! prefix

Postby Constin » Fri Feb 22, 2013 12:50 pm

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
Constin
 
Posts: 16
Joined: Fri Jan 11, 2013 3:37 pm
Status: Offline

Re: Run Lua code with ! prefix

Postby Akaya » Sun Mar 03, 2013 4:17 am

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 !
User avatar
Akaya
40 Prime Poster
 
Posts: 78
Joined: Thu Jan 10, 2013 3:10 am
Status: Offline


Return to Mudlet - unlimited possibilities

Who is online

Users browsing this forum: No registered users and 6 guests

cron