Lua:encodeFunctionEx
Jump to navigation
Jump to search
<> Reference
function encodeFunctionEx(string, pathtodll) : string
Converts a Lua script string into an encoded function string.
This is similar to encodeFunction, but it uses a script string instead of a function object and allows specifying which Lua DLL should be used.
Function Parameters
| Parameter | Type | Description |
|---|---|---|
| string | String | The Lua script that should be encoded. |
| pathtodll | String (optional) | The path to the Lua DLL that should be used for encoding. |
Returns
String — The encoded function string.
Architecture Compatibility
The Lua DLL must match the architecture of the current Cheat Engine process.
| Current Process | Allowed Lua DLL | Result |
|---|---|---|
| 32-bit Cheat Engine | 32-bit Lua DLL | Compatible. |
| 64-bit Cheat Engine | 64-bit Lua DLL | Compatible. |
| 32-bit Cheat Engine | 64-bit Lua DLL | Not compatible. |
| 64-bit Cheat Engine | 32-bit Lua DLL | Not compatible. |
Examples
local encoded = encodeFunctionEx([[
print("Hello from an encoded script")
]])
local decoded = decodeFunction(encoded)
decoded()
local script = [[
return function(value)
return value * 2
end
]]
local encoded = encodeFunctionEx(script)
local decoded = decodeFunction(encoded)
local fn = decoded()
print(fn(21))
local luaDllPath = "C:\\\\Cheat Engine\\\\lua53-64.dll"
local encoded = encodeFunctionEx([[
print("Encoded with a specific Lua DLL")
]], luaDllPath)
local decoded = decodeFunction(encoded)
decoded()
See Also
Main Pages