-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.lua
61 lines (52 loc) · 1.28 KB
/
main.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
local n_name, gbl = ...;
if n_name:lower():match('nerdpack') then
print('Your addon contains an invalid name, please redownload it.');
return;
end
gbl.domain = "nerdpack.xyz";
local version = 3;
if _G.WOW_PROJECT_ID == _G.WOW_PROJECT_CLASSIC then
gbl.domain = 'classic.' .. gbl.domain
end
local function errorhandler(err)
return geterrorhandler()(err)
end
local NEP_STREAM_WA = _G.NEP_STREAM_WA
function gbl.init(body)
local func, errorMessage = loadstring(
'local local_stream_name = "' .. n_name .. '";\n' ..
'local local_stream_version = ' .. version .. ';\n' ..
body,
n_name
);
if not func then
print('Error initializing')
errorhandler(errorMessage)
end
if NEP_STREAM_WA then
_G.NEP_STREAM_WA = nil
local custom_env = setmetatable({local_streamed_apis = NEP_STREAM_WA}, {__index=_G})
setfenv(func, custom_env)
end
local success, xerrorMessage = xpcall(func, errorhandler);
if not success then
print('Error initializing')
errorhandler(xerrorMessage)
end
end
local test
test = function()
if wmbapi then
gbl.MB.init()
elseif EWT then
gbl.EWT.init()
elseif __LB__ then
gbl.LB.init()
elseif _G.CallSecureFunction or NEP_STREAM_WA then
gbl.WowAdvanced.init()
else
C_Timer.After(0, test)
end
end
print('Searching for unlocker...')
C_Timer.After(0, test)