Originally Posted by Mayron
Also in your "frame:SetScript("OnEvent", function(self, event, ...)" part of the script, the "frame" comes up as a nil variable when I run it in wow. Is that because I am meant to rename the "frame" to any other frame that preferably is not already using an OnEvent script and which is always showing such as the "block" frame that does not disappear until the very end? Either that or some how defining "frame" as an actual variable then.
|
Yes, or use "local frame = CreateFrame("Frame")" and paste that above it.
Edit: It is also saying that this line:
Code:
if _G[addon].db:GetCurrentProfile() == "MayronUI" then
that "db" is a nil value with a lua error for some reason
|
That would probably be because "OtherAddon" or "AnotherAddon" (noted in the loop as the variable "addon") does not exist in the global environment (_G), or because it does not have a db property, or because it has a db property but the db property is not a AceDB profile database.
One way to solve it:
lua Code:
local addon
for _, addonName in pairs(addons) do
addon = _G[addonName]
print(addon and addonName .. " was detected." or addonName .. " was not detected.")
if addon and addon.db and addon.db.GetCurrentProfile and addon.db.GetCurrentProfile() == "MayronUI" then
setupMode = "bonus"
-- Some debug here, always test!
print(addonName .. " database was detected.")
break
end