UI and Macro
Is GuildInvite a protected function now? I have an addon that makes use of this function and it worked for a long time but recently, it's been throwing taint errors and I can't figure out why. (And no, the addon doesn't spam guild invites. It simply makes it possible for someone to easily get themselves invited to my guild)
Do you still get errors if your addon is the only AddOn loaded?
Yes. I enabled Swatter to get a complete report and got

Date: 2012-07-28 21:43:47
ID: 1
Error occured in: AddOn: gInviteMe
Count: 1
Message: Warning: AddOn gInviteMe attempted to call a protected function (GuildInvite()) which may require interaction.
[C]: GuildInvite()
gInviteMe\gInviteMe.lua:22: Invitez0rz()
Swatter, v5.13.5258 (BoldBandicoot)
gInviteMe, v1.2.2
BlizRuntimeLib_enUS v4.3.4.40300 <us>
What does /dump issecurevariable("GuildInvite") output with and without your AddOn enabled?
[1]=1 without the addon enabled.

Same with it enabled.
Looks like it requires a hardware event to trigger an invite. Probably quietly patched in some time ago.
From a bit of testing, it seems that GuildInvite requires a hardware event. I have no idea when this was implemented.

To test whether a function (GuildInvite in this case) is protected in some form, install SlashIn or InDemand and use this directly after reloading your UI:/in 1 /run GuildInvite("Someplayerthatdoesntexist")

If it's protected, you should see a popup saying A macro script has been blocked from an action only available to the Blizzard UI.

If it just requires a hardware event, you'll see "Interface action failed because of an AddOn" printed in your chat. This message only seems to print once per session regardless of how many protected functions are called insecurely, that's why you should use this test right after a UI reload.

If it's only protected in combat and you test while in combat, you'll see the same chat message as above.

If it's not protected in any way, no message will be printed.

Edit: What Unkle said.
Edit 2: Turns out the first test can be used to distinguish between all three forms of protection, so the second test isn't needed.
07/28/2012 07:40 AMPosted by Unkle
Looks like it requires a hardware event to trigger an invite. Probably quietly patched in some time ago.

Disappointing. Unfortunately, a hardware event defeats the purpose of the addon so I think I'll just retire the addon.

Thanks guys.

Join the Conversation

Return to Forum