-------------------------------------- -- 425 by plop -------------------------------------- -- convert lua 4 code into lua 5. -- not the best way but it instandly converts simple scripts. -- add "require("425/425.lua")" above all the other code -------------------------------------- -- 425 by plop -------------------------------------- -- convert lua 4 code into lua 5. -- not the best way but it instandly converts simple scripts. -- add "require("425/425.lua")" above all the other code -- in the lua 4 script. -------------------------------------- -- string stuff strfind = string.find strsub = string.sub gsub = string.gsub strchar = string.char strbyte = string.byte strlen = string.len strlower = string.lower strrep = string.rep strupper = string.upper format = string.format -- table stuff tinsert = table.insert tremove = table.remove concat = table.concat foreach = table.foreach foreachi = table.foreachi getn = table.getn sort = table.sort setn = table.setn -- math stuff abs = math.abs acos = math.acos asin = math.asin atan = math.atan atan2 = math.atan2 ceil = math.ceil cos = math.cos deg = math.deg exp = math.exp floor = math.floor log = math.log log10 = math.log10 max = math.max min = math.min mod = math.mod pow = math.pow rad = math.rad sin = math.sin sqrt = math.sqrt tan = math.tan frexp = math.frexp ldexp = math.ldexp random = math.random randomseed = math.randomseed pi = math.pi -- os stuff date = os.date execute = os.execute clock = os.clock remove = os.remove -- file stuff readfrom = function(arg) if arg then return io.open else return io.close end end openfile = readfrom read = function() return io.lines end write = io.write --seek = file:seek writeto = function(arg) if arg then return io.output else return io.close end end flush = io.flush call = function(func, arg) if type(func) == "function" then return func(unpack(arg)) -- primitive call else local h = metatable(func).__call if h then return h(func, unpack(arg)) else error("...") end end end appendto = function(file) return io.open(file, "a+") end