Difference between revisions of "Lua:encodeFunction"

From Cheat Engine
Jump to navigation Jump to search
(Created page with 'Category:Lua '''function''' encodeFunction(''function'', ''protect'' OPTIONAL) ''':''' string Converts a given function into an encoded string that you can pass to [[Lua:fin…')
 
(One intermediate revision by the same user not shown)
Line 2: Line 2:
 
'''function''' encodeFunction(''function'', ''protect'' OPTIONAL) ''':''' string
 
'''function''' encodeFunction(''function'', ''protect'' OPTIONAL) ''':''' string
  
Converts a given function into an encoded string that you can pass to [[Lua:findTableFile|decodeFunction]].
+
Converts a given function into an encoded string that you can pass to [[Lua:decodeFunction|decodeFunction]].
  
 
===Function Parameters===
 
===Function Parameters===
Line 30: Line 30:
  
 
=== Related Functions ===
 
=== Related Functions ===
* [[Lua:findTableFile|decodeFunction]]
+
* [[Lua:decodeFunction|decodeFunction]]

Revision as of 02:55, 18 April 2018

function encodeFunction(function, protect OPTIONAL) : string

Converts a given function into an encoded string that you can pass to decodeFunction.

Function Parameters

Parameter Type Description
function function The function to encode

Examples

local function myCoolFunction(str) print(str) end
print(encodeFunction(myCoolFunction))
local function myCoolFunction(str) print(str) end
local encodedFunc = encodeFunction(myCoolFunction)
local decodedFunc = decodeFunction(encodedFunc)
decodedFunc('I have the power!')

See also

Related Functions