Here is what I have so far:
Code:
local frame = CreateFrame("Frame")
local ignorezones = {1152, 1330, 1153, 1154, 1158, 1331, 1159, 1160}
frame:RegisterEvent("PLAYER_ENTERING_WORLD")
frame:RegisterEvent("ZONE_CHANGED_NEW_AREA")
frame:SetScript("OnEvent", function(self, event, ...)
local name, _, _, _, _, _, _, instanceMapID, _ = GetInstanceInfo()
if tContains(ignorezones, instanceMapID) then
message("Leaving General")
LeaveChannelByName("General");
else
message("jOIN General")
JoinChannelByName("General");
end
end)
I cannot get the addon to join the General channel for some reason. Even if I do a reload which should trigger the PLAYER_ENTERING_WORLD event.
What am I missing? A logic error? sigh