Addon to Leave a Channel if in Garrison
OK, I am endeavoring to make my first addon. I have noticed that General chat in the garrison is becoming Barens Trade chat. Here is what is suppose to do in a nutshell.
Player enters world or changes zone (no code for the latter yet), checks to see if player is in their garrison. If yes, then leave General Chat, if not join General chat. If you are in General and not in your garrison, do nothing. Here is what I have so far: Code:
local frame = CreateFrame("Frame") |
I have no idea about the rest but I guess zoneName=="Lunarfall" Will not work since the Garrison zone name changes to <Your character's name>'s Garrison.
Phanx just added Garrison as zone into Broker Instance Difficulty Code:
local garrisonMaps = { |
you will need to register when you change zone in your event, as of now it only check when you enter the world
|
Quote:
You need to register "ZONE_CHANGED_NEW_AREA". JoinChannelByName("General") works for me. @Tony: GetZoneText() returns the location without it's owners name. ("Frostwall" für die Horde) |
I'd suggest using GetInstanceInfo with the instanceMapIDs Tonyleila posted. That way you're not relying on localized strings.
|
Here is what I have so far:
Code:
local frame = CreateFrame("Frame") What am I missing? A logic error? sigh |
I think you have missed "tcontains", which is a table, but not defined anywhere.
|
Quote:
Code:
local ignorezones = { [1152]=true, [1330]=true, [1153]=true, [1154]=true, [1158]=true, [1331]=true, [1159]=true, [1160]=true } Code:
if ignorezones[instanceMapID] then |
Quote:
Code:
/run hooksecurefunc("JoinChannelByName", function(...) print("JoinChannelByName:", ...) end) |
All times are GMT -6. The time now is 07:53 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI