Edit: I dont think I can modify responses but ima gunna try 'declineinvite'.......
Code: Select all
declineInvite_conf = {
["ENABLED"] = true,
};
function declineInvite_OnLoad()
SlashCmdList["declineInvite"] = declineInvite_SlashCmd;
SLASH_declineInvite1 = "/declineinvite";
SLASH_declineInvite2 = "/di";
DEFAULT_CHAT_FRAME:AddMessage("Loaded declineIvite addon.");
end
function declineInvite_SlashCmd(a, msg)
if( declineInvite_conf["ENABLED"] ) then
declineInvite_conf["ENABLED"] = false;
DEFAULT_CHAT_FRAME:AddMessage("declineInvite disabled.");
else
declineInvite_conf["ENABLED"] = true;
DEFAULT_CHAT_FRAME:AddMessage("declineInvite enabled.");
end;
end
local timeInvited = nil;
function declineInvite_OnUpdate()
if( timeInvited ~= nil and timeInvited == 1 ) then
-- Decline the invite
DeclineGroup();
timeInvited = nil;
end
if( timeInvited ~= nil and timeInvited == 2 ) then
StaticPopup_OnClick(StaticPopup1, 2);
timeInvited = nil;
end
if( timeInvited ~= nil and timeInvited == 3 ) then
CancelDuel()
timeInvited = nil;
end
end
function declineInvite_OnEvent(event)
if( declineInvite_conf["ENABLED"] == false ) then
return;
end;
if( event == "PARTY_INVITE_REQUEST" ) then
DEFAULT_CHAT_FRAME:AddMessage("Enqueued a decline for party invite")
timeInvited = 1;
end
if( event == "GUILD_INVITE_REQUEST" ) then
DEFAULT_CHAT_FRAME:AddMessage("Enqueued a decline for guild invite")
DEFAULT_CHAT_FRAME:AddMessage("guildinvite: "..StaticPopup_Visible("GUILD_INVITE"))
timeInvited = 2;
end
if( event == "DUEL_REQUESTED" ) then
DEFAULT_CHAT_FRAME:AddMessage("Enqueued a decline for duel request")
timeInvited = 3;
end
end