Originally Posted by akgis
thanks, but thats is abit out of my league...
Would you be so kind to exemplify in this how I can do it?
Code:
function Whatever()
(...)
|-->
| (...)
| end
|
|- - <my code>
what I have to do so <my code> gets in the middle of the function Whatever like the "arrows" indicate
|
You can only pre- or post-hook a function. You can not split the function!
What you can do is:
Lua Code:
function mainfunc(...)
--this is the function you want to alter/enhance
end
Lua Code:
--store the old (default) function before
local old_mainfunc = mainfunc
function mainfunc(...)
old_mainfunc(...) --if you want to run the old code first (this is better done via 'hooksecurefunc')
-- your code
old_mainfunc(...) --if you want to run the old code after your code is executed
end
Please post the function you want to alter and the code you want to use. Then we can get more into detail.