Skip to content

Instantly share code, notes, and snippets.

@orlp
Created June 15, 2013 21:03
Show Gist options
  • Save orlp/5789582 to your computer and use it in GitHub Desktop.
Save orlp/5789582 to your computer and use it in GitHub Desktop.
local driver = CreateFrame("Button", "casthack_driver", nil, "SecureHandlerClickTemplate")
local executor = CreateFrame("Button", "casthack_executor", nil, "SecureActionButtonTemplate")
driver:SetAttribute("_onclick", [[
local executor = self:GetFrameRef("executor")
if math.random() < 0.5 then
executor:SetAttribute("type", "spell")
executor:SetAttribute("spell", "Concussive Shot")
else
executor:SetAttribute("type", "spell")
executor:SetAttribute("spell", "Arcane Shot")
end
]])
driver:RegisterForClicks("AnyDown")
driver:SetFrameRef("executor", executor)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment