User talk:Jason Gregory: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Creating Tutorial for compiling Scripts)
 
 
Line 8: Line 8:
-- http://lua-users.org/wiki/LuaCompilerInLua
-- http://lua-users.org/wiki/LuaCompilerInLua


-- compile the input file(s)
local chunk = {}
for _, file in ipairs(arg) do
  chunk[#chunk + 1] = assert(loadfile(file))
end


if #chunk == 1 then
Rest Coming soon :D
  chunk = chunk[1]
else
  -- combine multiple input files into a single chunk
  for i, func in ipairs(chunk) do
    chunk[i] = ("%sloadstring%q(...);"):format(
      i==#chunk and "return " or " ",
      string.dump(func))
  end
  chunk = assert(loadstring(table.concat(chunk)))
end
 
local out = assert(io.open("luac.lua.out", "wb"))
out:write(string.dump(chunk))
out:close()
 
 
Coming soon :D

Latest revision as of 22:08, 2 January 2010

Compiling a Existing Lua File

First, Files Compiled by the Lua Compiler are not 100% Secure. That means your Scripts can still decompiled by others...

How to do

-- http://lua-users.org/wiki/LuaCompilerInLua


Rest Coming soon :D