add lua sandbox, tabs, stuff

This commit is contained in:
unknown
2022-02-18 17:29:31 -05:00
parent 2593c55ee3
commit fa1f4894af
12 changed files with 436 additions and 36 deletions

View File

@ -0,0 +1,7 @@
{
"name": "expr",
"license": "MIT",
"version": 0.1,
"engine": 0.42,
"help": "exicutes mathmatical expresions"
}

View File

@ -0,0 +1,14 @@
function expr(pos, input, data)
local output
local func = computers.sandbox.loadstring("return " .. input, {env={}})
if func then output = func() end
if type(output) ~= "number" or output == nil then
return "Error: invalid or missing input"
end
return tostring(output)
end
return expr