Skip to content

Instantly share code, notes, and snippets.

@NoobTaco
Last active April 14, 2023 03:07
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NoobTaco/a287fa3c6b2f977a2ed3761281c6e4be to your computer and use it in GitHub Desktop.
Save NoobTaco/a287fa3c6b2f977a2ed3761281c6e4be to your computer and use it in GitHub Desktop.
WoW Version Check Code - LUA
-- 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