This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- check "http://lua-users.org/wiki/SimpleLuaClasses" for this file | |
-- class.lua | |
-- Compatible with Lua 5.1 (not 5.0). | |
function class(base, init) | |
local c = {} -- a new class instance | |
if not init and type(base) == 'function' then | |
init = base | |
base = nil |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- By Saml1er, for research :P | |
Testaz = { } | |
function Testaz:new (o,a,b) | |
setmetatable(o, self) | |
self.__index = self | |
self.str = tostring (a + b) | |
return o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local user_script = loadstring('print("hello")') | |
local env = {print=print} | |
setfenv(user_script, env) | |
pcall(user_script) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function prettyround(number) | |
return string.format('%.2f', number) | |
end |
NewerOlder