🪝Hooking
These are all of the functions revolving hooking that Wave supports.
Clone Function
<function> clonefunction(<function> a1)Clones function
a1.
Alternative:
clonefunc
Get Callback Value
<any> getcallbackvalue(<function fn>)Retrieves the current value or reference of
fnthat has been set or hooked.
Hook Function
<function> hookfunction(<function> old, <function> new) Hooks function
old, replacing it with the functionnew. Theoldfunction is returned, you must use this function in order to call the original function.
Alternative:
replaceclosure,hookfunc,replacefunction,replacefunc,detourfunction,replaceclosure,detour_function
Hook Metamethod
<function> hookmetamethod(<Object> object, <string> metamethod, <function> a1) Hooks the
metamethodpassed inobject's metatable witha1.
Is Hooked
<bool> ishooked(<function fn>)Checks if
fnhas been hooked (i.e., replaced or wrapped by a hook).
Alternative:
isfunctionhooked
Is Our Call Stack
<bool> isourcallstack(<int level>)Checks if
leveloriginates from the executor’s environment.
New C Closure
<function> newcclosure(<function> a1) Pushes a new C Closure that invokes the function
a1upon call.
New Lua Closure
<function> newlclosure(<function fn>)Pushes a new L Closure that invokes the function
fnupon call.
Protect Closure
<void> protectclosure(<function fn>)Prevents
fnfrom being hooked or modified by external code.
Alternative:
protectfunction
Restore Closure
<void> restoreclosure(<function fn>)Restores
fnback to its original, unmodified closure.
Alternative:
restorefunction,restorefunc
Last updated