[DiscordArchive] if its global, how would i then make some other function run after executing it?
[DiscordArchive] if its global, how would i then make some other function run after executing it?
Archived author: Foe • Posted: 2022-04-21T13:44:40.857000+00:00
Original source
yep
Archived author: Foe • Posted: 2022-04-21T13:45:11.009000+00:00
Original source
you can intercept and modify the parameters if you want to as well
Archived author: Foe • Posted: 2022-04-21T13:46:30.222000+00:00
Original source
```Lua
function functionA(arg1, arg2)
print(arg1, arg2)
end
local function functionXYZ()
print("extra")
-- do stuff
end
local origFunctionA = functionA;
functionA = function(...)
local foo, bar = ...
bar = "baz"
origFunctionA(foo, bar);
functionXYZ()
end
functionA("foo", "bar")```
Archived author: Grandold • Posted: 2022-04-21T13:48:11.057000+00:00
Original source
Ahh nice, very interesting. Mostly was thinking if that way it would be easy to modify existing ACore eluna/lua modules by just extending the code exactly in this way, but I would guess most functions in those are declared as local though.
Archived author: Foe • Posted: 2022-04-21T13:48:29.938000+00:00
Original source
They should be
Archived author: Grandold • Posted: 2022-04-21T13:49:03.517000+00:00
Original source
yea back to the drawing board
Archived author: Foe • Posted: 2022-04-21T13:49:06.721000+00:00
Original source
But since it's Lua you can always edit the original ♂️
Archived author: Grandold • Posted: 2022-04-21T13:49:53.119000+00:00
Original source
yea it was just some weird idea that popped into my head, ofc I do have access to the files but sounded interesting
Archived author: Grandold • Posted: 2022-04-21T13:49:55.506000+00:00
Original source
and it was!
Archived author: Foe • Posted: 2022-04-21T13:50:52.885000+00:00
Original source
I generally use function overrides to hijack client functionality in custom client code