Forums WoW Modding Support Archives Azerothcore Discord Archives [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?

[DiscordArchive] if its global, how would i then make some other function run after executing it?

Pages (5): 1 2 3 4 5 Next
rektbyfaith
Administrator
0
04-21-2022, 01:32 PM
#1
Archived author: Grandold • Posted: 2022-04-21T13:32:31.601000+00:00
Original source

if its global, how would i then make some other function run after executing it?
rektbyfaith
04-21-2022, 01:32 PM #1

Archived author: Grandold • Posted: 2022-04-21T13:32:31.601000+00:00
Original source

if its global, how would i then make some other function run after executing it?

rektbyfaith
Administrator
0
04-21-2022, 01:32 PM
#2
Archived author: Grandold • Posted: 2022-04-21T13:32:42.668000+00:00
Original source

just trying to get the basic idea
rektbyfaith
04-21-2022, 01:32 PM #2

Archived author: Grandold • Posted: 2022-04-21T13:32:42.668000+00:00
Original source

just trying to get the basic idea

rektbyfaith
Administrator
0
04-21-2022, 01:32 PM
#3
Archived author: Foe • Posted: 2022-04-21T13:32:57.960000+00:00
Original source

Let me get on the pc instead of phone lol
rektbyfaith
04-21-2022, 01:32 PM #3

Archived author: Foe • Posted: 2022-04-21T13:32:57.960000+00:00
Original source

Let me get on the pc instead of phone lol

rektbyfaith
Administrator
0
04-21-2022, 01:33 PM
#4
Archived author: Grandold • Posted: 2022-04-21T13:33:03.257000+00:00
Original source

x)
rektbyfaith
04-21-2022, 01:33 PM #4

Archived author: Grandold • Posted: 2022-04-21T13:33:03.257000+00:00
Original source

x)

rektbyfaith
Administrator
0
04-21-2022, 01:36 PM
#5
Archived author: Foe • Posted: 2022-04-21T13:36:49.573000+00:00
Original source

```Lua
local function functionXYZ()
-- do stuff
end

local origFunctionA = FunctionA;

FunctionA = function(...)
origFunctionA(...);
functionXYZ()
end```
rektbyfaith
04-21-2022, 01:36 PM #5

Archived author: Foe • Posted: 2022-04-21T13:36:49.573000+00:00
Original source

```Lua
local function functionXYZ()
-- do stuff
end

local origFunctionA = FunctionA;

FunctionA = function(...)
origFunctionA(...);
functionXYZ()
end```

rektbyfaith
Administrator
0
04-21-2022, 01:37 PM
#6
Archived author: Foe • Posted: 2022-04-21T13:37:35.771000+00:00
Original source

you create a local copy of the global function, then you overwrite the global function with your own function definition. You then call the local copy of the old global function, then run your own code
rektbyfaith
04-21-2022, 01:37 PM #6

Archived author: Foe • Posted: 2022-04-21T13:37:35.771000+00:00
Original source

you create a local copy of the global function, then you overwrite the global function with your own function definition. You then call the local copy of the old global function, then run your own code

rektbyfaith
Administrator
0
04-21-2022, 01:37 PM
#7
Archived author: Grandold • Posted: 2022-04-21T13:37:40.190000+00:00
Original source

aaahhh ye ofc, didnt realize it would be that simple lol
rektbyfaith
04-21-2022, 01:37 PM #7

Archived author: Grandold • Posted: 2022-04-21T13:37:40.190000+00:00
Original source

aaahhh ye ofc, didnt realize it would be that simple lol

rektbyfaith
Administrator
0
04-21-2022, 01:38 PM
#8
Archived author: Foe • Posted: 2022-04-21T13:38:13.839000+00:00
Original source

Load order is important however
rektbyfaith
04-21-2022, 01:38 PM #8

Archived author: Foe • Posted: 2022-04-21T13:38:13.839000+00:00
Original source

Load order is important however

rektbyfaith
Administrator
0
04-21-2022, 01:39 PM
#9
Archived author: Grandold • Posted: 2022-04-21T13:39:02.890000+00:00
Original source

what if the functionA() was local? would I still be able to require it in moduleB.lua and use it then in same way?
rektbyfaith
04-21-2022, 01:39 PM #9

Archived author: Grandold • Posted: 2022-04-21T13:39:02.890000+00:00
Original source

what if the functionA() was local? would I still be able to require it in moduleB.lua and use it then in same way?

rektbyfaith
Administrator
0
04-21-2022, 01:39 PM
#10
Archived author: Foe • Posted: 2022-04-21T13:39:14.971000+00:00
Original source

No
rektbyfaith
04-21-2022, 01:39 PM #10

Archived author: Foe • Posted: 2022-04-21T13:39:14.971000+00:00
Original source

No

Pages (5): 1 2 3 4 5 Next
Recently Browsing
 1 Guest(s)
Recently Browsing
 1 Guest(s)