From 59cd72191b89e15dfd901dde487c6eb13252c3ba Mon Sep 17 00:00:00 2001 From: Jeija Date: Tue, 22 Jan 2013 21:15:49 +0100 Subject: [PATCH] Add tostring, tonumber, string to luacontroller, prohibit 'function' --- mesecons_luacontroller/init.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mesecons_luacontroller/init.lua b/mesecons_luacontroller/init.lua index 76e08bd..344e0d3 100644 --- a/mesecons_luacontroller/init.lua +++ b/mesecons_luacontroller/init.lua @@ -139,7 +139,7 @@ end local code_prohibited = function(code) -- Clean code - local prohibited = {"while", "for", "repeat", "until"} + local prohibited = {"while", "for", "repeat", "until", "function"} for _, p in ipairs(prohibited) do if string.find(code, p) then return "Prohibited command: "..p @@ -188,6 +188,9 @@ local create_environment = function(pos, mem, event) interrupt = getinterrupt(pos), digiline_send = getdigiline_send(pos), mem = mem, + tostring = tostring, + tonumber = tonumber, + string = string, event = event} end