WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   Guild Invite message help (https://www.wowinterface.com/forums/showthread.php?t=34618)

weasoug 08-25-10 08:55 AM

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

Nefrirr 08-25-10 04:01 PM

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.

SDPhantom 08-26-10 10:56 PM

Quote:

Originally Posted by Nefrirr (Post 203824)
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.

weasoug 08-29-10 09:26 AM

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.


All times are GMT -6. The time now is 02:48 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI