View Single Post
01-29-15, 11:28 PM   #2
Clamsoda
A Frostmaul Preserver
Join Date: Nov 2011
Posts: 269
I just whipped up a small test, and it appears that automating the acceptance of this (or perhaps all?) spell confirmation prompts causes taint. I assume it is because accepting the prompt executes a spell immediately, and spell casting via Lua is certainly restricted to Blizzard.

I tried using the static popup's OnClick function, the "Okay" button's Click method, and AcceptSpellConfirmationPrompt.

Lua Code:
  1. local eventHandler = CreateFrame("Frame")
  2.  
  3. eventHandler:RegisterEvent("SPELL_CONFIRMATION_PROMPT")
  4. eventHandler:SetScript("OnEvent", function (self, event, spellID)
  5.     -- The spell ID is 161736.
  6.     for i = 1, STATICPOPUP_NUMDIALOGS do
  7.         local frame = _G["StaticPopup"..i]
  8.  
  9.         if (frame.which == "SPELL_CONFIRMATION_PROMPT") and (frame.data == spellID) then
  10.             -- StaticPopup_OnClick(frame, 1)
  11.            
  12.             -- _G["StaticPopup"..i.."Button1"]:Click()
  13.             -- frame.Button1:Click()
  14.  
  15.             -- AcceptSpellConfirmationPrompt(spellID)
  16.         end
  17.     end
  18. end)

Last edited by Clamsoda : 01-29-15 at 11:46 PM.
  Reply With Quote