Thread Tools Display Modes
08-25-10, 08:55 AM   #1
weasoug
A Flamescale Wyrmkin
 
weasoug's Avatar
AddOn Author - Click to view addons
Join Date: May 2010
Posts: 127
Post Guild Invite message help

Hi there all. i have aprob.

It all seems to be working ok but the print message is not comming up. i think its to do with inviter but im not sure.

Code:
GuildInvite = true
if GuildInvite then
local gi = CreateFrame("Frame")
gi:RegisterEvent("GUILD_INVITE_REQUEST")
gi:SetScript("OnEvent", function(self, event, inviter)
	if (not IsControlKeyDown()) then
		DeclineGuild()
                StaticPopup_Hide("GUILD_INVITE")
		print("You have recieved a Guild Invitaion from: "..inviter..". Press CTRL to allow the next request!");
		DoEmote("no",1);
     	end
   end)
end
thanks for your time
  Reply With Quote
08-25-10, 04:01 PM   #2
Nefrirr
A Cyclonian
 
Nefrirr's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 44
I tested your code with another event (ACTIONBAR_SLOT_CHANGED) and the message displays just fine with the first argument of the event (slot number) and the emote is also played.

I currently don't have the means to actually test your code with a guild invite, but a reason for the print message not to be displayed might be that inviter is possibly a nil value. Does it display the print message if you leave out the string concatenation with inviter?

Otherwise the code seems to be okay, inviter should also be the correct argument (frame, event, arg1) with the event signature (inviter, guildname). Don't see why it shouldn't work, but you can at least confirm that inviter is the culprit by just removing it from the code.
  Reply With Quote
08-26-10, 10:56 PM   #3
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,323
Originally Posted by Nefrirr View Post
I currently don't have the means to actually test your code with a guild invite, but a reason for the print message not to be displayed might be that inviter is possibly a nil value. Does it display the print message if you leave out the string concatenation with inviter?
Lua would throw an error if you try to concatenate a string with nil.

Check if you have "Show Errors" on in the interface options, WoW has it turned off by default. You might place a print() function at the base of your event script to check if it's being called at all. This'll make sure if the event is firing.

From here, everything looks fine.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)

Last edited by SDPhantom : 08-26-10 at 11:02 PM.
  Reply With Quote
08-29-10, 09:26 AM   #4
weasoug
A Flamescale Wyrmkin
 
weasoug's Avatar
AddOn Author - Click to view addons
Join Date: May 2010
Posts: 127
Post

yes like i said it works fine. it just don't show the print message. of what i said from the start is based on the inviter. with inviter not in seems to work. but it don't show the persons name or guild. of what i was trying to do.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Guild Invite message help

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