Difference between revisions of "Lua:encodeFunction"

From Cheat Engine
Jump to navigation Jump to search
(Undo revision 7035 by Tuzi521 (talk))
(Tag: Undo)
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
[[Category:Lua]]
 
[[Category:Lua]]
'''function''' encodeFunction(''function'') ''':''' 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]]

Latest revision as of 16:00, 10 February 2021

function encodeFunction(function, protect OPTIONAL) : string

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

Function Parameters[edit]

Parameter Type Description
function function The function to encode

Examples[edit]

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[edit]

Related Functions[edit]