im not a coder or anything but here is the code, used some sap addon codes for the commands, please let me know whats making it not work.
local a = CreateFrame("Frame")
SLASH_NOCLICK1 = '/noclick';
local f=CreateFrame("Frame")
local function SlashCmd(cmd,self)
if (cmd == 'on') then
enabled = 'true';
DEFAULT_CHAT_FRAME:AddMessage("Noclick Enabled",1,0,0);
-- This file is loaded from "Click Through.toc"
-- TargetFrame and FocusFrame
hooksecurefunc("TargetFrame_UpdateAuras",function(self)
local name=self:GetName();
for i=1,MAX_TARGET_BUFFS do
local frame=_G[name.."Buff"..i];
if frame then frame:EnableMouse(0); end
end
for i=1,(self.maxDebuffs or MAX_TARGET_DEBUFFS) do
local frame=_G[name.."Debuff"..i];
if frame then frame:EnableMouse(0); end
end
end);
-- Target of Target
for i=1,4 do _G["TargetFrameToTDebuff"..i]:EnableMouse(false); end
PlayerFrame:EnableMouse(0);
PlayerFrameHealthBar:EnableMouse(0);
PlayerFrameManaBar:EnableMouse(0);
TargetFrame:EnableMouse(0);
TargetFrameHealthBar:EnableMouse(0);
TargetFrameManaBar:EnableMouse(0);
PetFrame:EnableMouse(0);
PetFrameHealthBar:EnableMouse(0);
PetFrameManaBar:EnableMouse(0);
TargetFrameToT:EnableMouse(0);
TargetFrameToTHealthBar:EnableMouse(0);
TargetFrameToTManaBar:EnableMouse(0);
FocusFrame:EnableMouse(0);
FocusFrameHealthBar:EnableMouse(0)
FocusFrameManaBar:EnableMouse(0)
FocusFrameToT:EnableMouse(0);
elseif (cmd == 'off') then
enabled = 'false';
DEFAULT_CHAT_FRAME:AddMessage("Noclick Disabled",1,0,0);
-- This file is loaded from "Click Through.toc"
-- TargetFrame and FocusFrame
hooksecurefunc("TargetFrame_UpdateAuras",function(self)
local name=self:GetName();
for i=1,MAX_TARGET_BUFFS do
local frame=_G[name.."Buff"..i];
if frame then frame:EnableMouse(1); end
end
for i=1,(self.maxDebuffs or MAX_TARGET_DEBUFFS) do
local frame=_G[name.."Debuff"..i];
if frame then frame:EnableMouse(1); end
end
end);
-- Target of Target
for i=1,4 do _G["TargetFrameToTDebuff"..i]:EnableMouse(false); end
PlayerFrame:EnableMouse(1);
PlayerFrameHealthBar:EnableMouse(1);
PlayerFrameManaBar:EnableMouse(1);
TargetFrame:EnableMouse(1);
TargetFrameHealthBar:EnableMouse(1);
TargetFrameManaBar:EnableMouse(1);
PetFrame:EnableMouse(1);
PetFrameHealthBar:EnableMouse(1);
PetFrameManaBar:EnableMouse(1);
TargetFrameToT:EnableMouse(1);
TargetFrameToTHealthBar:EnableMouse(1);
TargetFrameToTManaBar:EnableMouse(1);
FocusFrame:EnableMouse(1);
FocusFrameHealthBar:EnableMouse(1)
FocusFrameManaBar:EnableMouse(1)
FocusFrameToT:EnableMouse(1);
else
DEFAULT_CHAT_FRAME:AddMessage("Unknown command. Enter either '/noclick on' to activate noclick, or '/noclick off' to deactivate it.",1,0,0);
end
end
SlashCmdList["NOCLICK"] = SlashCmd;
a:SetScript("OnEvent", function(self, event)
if event == "PLAYER_ENTERING_WORLD" then
-- This file is loaded from "Click Through.toc"
-- TargetFrame and FocusFrame
hooksecurefunc("TargetFrame_UpdateAuras",function(self)
local name=self:GetName();
for i=1,MAX_TARGET_BUFFS do
local frame=_G[name.."Buff"..i];
if frame then frame:EnableMouse(0); end
end
for i=1,(self.maxDebuffs or MAX_TARGET_DEBUFFS) do
local frame=_G[name.."Debuff"..i];
if frame then frame:EnableMouse(0); end
end
end);
-- Target of Target
for i=1,4 do _G["TargetFrameToTDebuff"..i]:EnableMouse(false); end
PlayerFrame:EnableMouse(0);
PlayerFrameHealthBar:EnableMouse(0);
PlayerFrameManaBar:EnableMouse(0);
TargetFrame:EnableMouse(0);
TargetFrameHealthBar:EnableMouse(0);
TargetFrameManaBar:EnableMouse(0);
PetFrame:EnableMouse(0);
PetFrameHealthBar:EnableMouse(0);
PetFrameManaBar:EnableMouse(0);
TargetFrameToT:EnableMouse(0);
TargetFrameToTHealthBar:EnableMouse(0);
TargetFrameToTManaBar:EnableMouse(0);
FocusFrame:EnableMouse(0);
FocusFrameHealthBar:EnableMouse(0)
FocusFrameManaBar:EnableMouse(0)
FocusFrameToT:EnableMouse(0);
f:RegisterEvent("UNIT_AURA")
f:RegisterEvent("PLAYER_TARGET_CHANGED")
f:SetScript("OnEvent", function()
end)
end
end)
a:RegisterEvent("PLAYER_ENTERING_WORLD")
|