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): Previous 1 2 3 4 5 Next
rektbyfaith
Administrator
0
04-21-2022, 01:39 PM
#11
Archived author: Foe • Posted: 2022-04-21T13:39:23.558000+00:00
Original source

a local function is tied to the local scope of the script
rektbyfaith
04-21-2022, 01:39 PM #11

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

a local function is tied to the local scope of the script

rektbyfaith
Administrator
0
04-21-2022, 01:40 PM
#12
Archived author: Grandold • Posted: 2022-04-21T13:40:00.164000+00:00
Original source

okay, was just thinking if requiring it would make it kinda into the same scope but would be too easy I guess
rektbyfaith
04-21-2022, 01:40 PM #12

Archived author: Grandold • Posted: 2022-04-21T13:40:00.164000+00:00
Original source

okay, was just thinking if requiring it would make it kinda into the same scope but would be too easy I guess

rektbyfaith
Administrator
0
04-21-2022, 01:40 PM
#13
Archived author: Foe • Posted: 2022-04-21T13:40:04.241000+00:00
Original source

In that case you would have to have a global function that exposes the local function globally
rektbyfaith
04-21-2022, 01:40 PM #13

Archived author: Foe • Posted: 2022-04-21T13:40:04.241000+00:00
Original source

In that case you would have to have a global function that exposes the local function globally

rektbyfaith
Administrator
0
04-21-2022, 01:40 PM
#14
Archived author: Foe • Posted: 2022-04-21T13:40:10.355000+00:00
Original source

Nah
rektbyfaith
04-21-2022, 01:40 PM #14

Archived author: Foe • Posted: 2022-04-21T13:40:10.355000+00:00
Original source

Nah

rektbyfaith
Administrator
0
04-21-2022, 01:40 PM
#15
Archived author: Foe • Posted: 2022-04-21T13:40:27.407000+00:00
Original source

require just makes sure that the required script is loaded before the script requiring it
rektbyfaith
04-21-2022, 01:40 PM #15

Archived author: Foe • Posted: 2022-04-21T13:40:27.407000+00:00
Original source

require just makes sure that the required script is loaded before the script requiring it

rektbyfaith
Administrator
0
04-21-2022, 01:40 PM
#16
Archived author: Grandold • Posted: 2022-04-21T13:40:48.110000+00:00
Original source

okay, thanks a lot both of u! ^^
rektbyfaith
04-21-2022, 01:40 PM #16

Archived author: Grandold • Posted: 2022-04-21T13:40:48.110000+00:00
Original source

okay, thanks a lot both of u! ^^

rektbyfaith
Administrator
0
04-21-2022, 01:41 PM
#17
Archived author: Foe • Posted: 2022-04-21T13:41:12.276000+00:00
Original source

https://www.lua.org/cgi-bin/demo

```Lua
function FunctionA(arg1, arg2)
print(arg1, arg2)
end

local function functionXYZ()
print("extra")
-- do stuff
end

local origFunctionA = FunctionA;

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

FunctionA("foo", "bar")```
rektbyfaith
04-21-2022, 01:41 PM #17

Archived author: Foe • Posted: 2022-04-21T13:41:12.276000+00:00
Original source

https://www.lua.org/cgi-bin/demo

```Lua
function FunctionA(arg1, arg2)
print(arg1, arg2)
end

local function functionXYZ()
print("extra")
-- do stuff
end

local origFunctionA = FunctionA;

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

FunctionA("foo", "bar")```

rektbyfaith
Administrator
0
04-21-2022, 01:41 PM
#18
Archived author: Foe • Posted: 2022-04-21T13:41:18.708000+00:00
Original source

Easy way to see how it works
rektbyfaith
04-21-2022, 01:41 PM #18

Archived author: Foe • Posted: 2022-04-21T13:41:18.708000+00:00
Original source

Easy way to see how it works

rektbyfaith
Administrator
0
04-21-2022, 01:41 PM
#19
Archived author: Grandold • Posted: 2022-04-21T13:41:51.296000+00:00
Original source

aaa thanks again, was actually thinking if there is some online tool to test script execution
rektbyfaith
04-21-2022, 01:41 PM #19

Archived author: Grandold • Posted: 2022-04-21T13:41:51.296000+00:00
Original source

aaa thanks again, was actually thinking if there is some online tool to test script execution

rektbyfaith
Administrator
0
04-21-2022, 01:44 PM
#20
Archived author: Grandold • Posted: 2022-04-21T13:44:36.595000+00:00
Original source

(...) part in function calls just pushes all the parameters given into the one being called with that too?
rektbyfaith
04-21-2022, 01:44 PM #20

Archived author: Grandold • Posted: 2022-04-21T13:44:36.595000+00:00
Original source

(...) part in function calls just pushes all the parameters given into the one being called with that too?

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