Last active
April 14, 2023 03:07
-
-
Save NoobTaco/a287fa3c6b2f977a2ed3761281c6e4be to your computer and use it in GitHub Desktop.
WoW Version Check Code - LUA
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Version 1 | |
-- Get WoW Client version 1-Classic, 2-TBCc, 9-Retail | |
local wowver=floor((floor(select(4, GetBuildInfo()))/10000)) | |
print("Toc:", wowver) | |
if wowver == 1 then | |
print("This is Classic") | |
elseif wowver == 2 then | |
print("This is TBC") | |
elseif wowver == 9 then | |
print("This is Retail") | |
end | |
-- Version 2 Check Version of WoW Client | |
local function IsClassic() | |
return BackdropTemplateMixin == nil and WOW_PROJECT_ID == WOW_PROJECT_CLASSIC | |
end | |
local function IsTBC() | |
return BackdropTemplateMixin and WOW_PROJECT_ID == WOW_PROJECT_CLASSIC | |
end | |
local function IsRetail() | |
return WOW_PROJECT_ID == WOW_PROJECT_MAINLINE | |
end | |
-- Call the function | |
if IsRetail() then | |
-- do something | |
end | |
if IsClassic() then | |
-- do something else | |
end | |
if IsTBC() then | |
-- do something else else | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment