Thread Tools Display Modes
09-02-14, 07:53 AM   #1
morpheusxeno
A Flamescale Wyrmkin
 
morpheusxeno's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 126
Somethings wrong with this?

Code:
elseif (event == "GUILD_ROSTER_UPDATE" and IsInGuild() ~= nil) then 
		local bootNum = 0
		for i = 0, GetNumGuildMembers() do 
			local name, rank, rankIndex, level, classLocale, zone, note, officernote, online, status, class = GetGuildRosterInfo(i)
			
			-- check for blacklist
			local index = BlackList:GetIndexByName(name)
			if (index > 0) then
				local player = BlackList:GetPlayerByIndex(index)

				local alreadywarned = false
				for warnedname, timepassed in pairs(Already_Warned_For["GUILD_ROSTER"]) do
					if ((name == warnedname) and (GetTime() < timepassed+10)) then
						alreadywarned = true
					end
				end
				if (not alreadywarned) then
					Already_Warned_For["GUILD_ROSTER"][name]=GetTime()+300
					BlackList:AddSound()
					BlackList:UpdateDetails(index, nil, nil, level, class, nil)
					BlackList:AddErrorMessage(name .. " is on your Black List and is in your GUILD.", "red", 5)
                    if(player["reason"] ~= "") then
						BlackList:AddMessage(name .. " is on your Black List and is in your GUILD, reason:" .. player["reason"], "red")           
				    else
						BlackList:AddMessage(name .. " is on your Black List and in your GUILD", "red")           
					end

Not getting a lua error, but the info isnt being transmitted to other guild members
__________________
My mother-in-law fell down a wishing well. I was amazed; I never knew they worked...
  Reply With Quote
09-02-14, 09:08 AM   #2
Choonstertwo
A Chromatic Dragonspawn
 
Choonstertwo's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2011
Posts: 194
I can't see any obvious mistakes. Try adding some print statements to various places to help you see what's going on.

If you post all of your code, we may be able to help more.
  Reply With Quote
09-02-14, 06:02 PM   #3
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Also, this isn't related to whatever problem you're having, but:

Code:
if (... and IsInGuild() ~= nil) then
You should omit the explicit check against nil. In WoD all 1/nil returns are being changed to proper true/false booleans, and nil evaluates to a boolean false anyway, so a simpler implicit boolean check will not only be more readable and more efficient, but also work in both API environments:

Code:
if ... and IsInGuild() then
I'd also suggest moving the IsInGuild check inside the event check, so that if the event fires when you're not in a guild, your code won't waste time checking all the other events. Better yet, don't register the event at all if the player isn't in a guild.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote
09-03-14, 04:16 PM   #4
morpheusxeno
A Flamescale Wyrmkin
 
morpheusxeno's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 126
Thank you Phanx you too Choonstertwo.
__________________
My mother-in-law fell down a wishing well. I was amazed; I never knew they worked...
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Somethings wrong with this?

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off