Advertisement
Guest User

Untitled

a guest
Oct 16th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.93 KB | None | 0 0
  1. local T, C, L, _ = unpack(select(2, ...))
  2.  
  3. ----------------------------------------------------------------------------------------
  4. -- Accept invites from guild members or friend list(by ALZA)
  5. ----------------------------------------------------------------------------------------
  6. if C.automation.accept_invite == true then
  7. local function CheckFriend(inviterGUID)
  8. if C_BattleNet.GetAccountInfoByGUID(inviterGUID) or C_FriendList.IsFriend(inviterGUID) or IsGuildMember(inviterGUID) then
  9. return true
  10. end
  11. end
  12.  
  13. local ai = CreateFrame("Frame")
  14. ai:RegisterEvent("PARTY_INVITE_REQUEST")
  15. ai:SetScript("OnEvent", function(self, event, name, _, _, _, _, _, inviterGUID)
  16. if QueueStatusMinimapButton:IsShown() or GetNumGroupMembers() > 0 then return end
  17. if CheckFriend(inviterGUID) then
  18. RaidNotice_AddMessage(RaidWarningFrame, L_INFO_INVITE..name, {r = 0.41, g = 0.8, b = 0.94}, 3)
  19. print(format("|cffffff00"..L_INFO_INVITE..name..".|r"))
  20. AcceptGroup()
  21. for i = 1, STATICPOPUP_NUMDIALOGS do
  22. local frame = _G["StaticPopup"..i]
  23. if frame:IsVisible() and frame.which == "PARTY_INVITE" then
  24. frame.inviteAccepted = 1
  25. StaticPopup_Hide("PARTY_INVITE")
  26. return
  27. elseif frame:IsVisible() and frame.which == "PARTY_INVITE_XREALM" then
  28. frame.inviteAccepted = 1
  29. StaticPopup_Hide("PARTY_INVITE_XREALM")
  30. return
  31. end
  32. end
  33. else
  34. SendWho(name)
  35. end
  36. end)
  37. end
  38.  
  39. ----------------------------------------------------------------------------------------
  40. -- Auto invite by whisper(by Tukz)
  41. ----------------------------------------------------------------------------------------
  42. if T.client == "ruRU" then
  43. C.automation.invite_keyword = "инв"
  44. end
  45.  
  46. local autoinvite = CreateFrame("Frame")
  47. autoinvite:RegisterEvent("CHAT_MSG_WHISPER")
  48. autoinvite:RegisterEvent("CHAT_MSG_BN_WHISPER")
  49. autoinvite:SetScript("OnEvent", function(self, event, arg1, arg2, ...)
  50. if ((not UnitExists("party1") or UnitIsGroupLeader("player") or UnitIsGroupAssistant("player")) and arg1:lower():match(C.automation.invite_keyword)) and SavedOptionsPerChar.AutoInvite == true and not QueueStatusMinimapButton:IsShown() then
  51. if event == "CHAT_MSG_WHISPER" then
  52. InviteUnit(arg2)
  53. elseif event == "CHAT_MSG_BN_WHISPER" then
  54. local bnetIDAccount = select(11, ...)
  55. local bnetIDGameAccount = select(6, BNGetFriendInfoByID(bnetIDAccount))
  56. BNInviteFriend(bnetIDGameAccount)
  57. end
  58. end
  59. end)
  60.  
  61. SlashCmdList.AUTOINVITE = function(msg)
  62. if msg == "" then
  63. if SavedOptionsPerChar.AutoInvite == true then
  64. SavedOptionsPerChar.AutoInvite = false
  65. print("|cffffff00"..L_INVITE_DISABLE..".|r")
  66. else
  67. SavedOptionsPerChar.AutoInvite = true
  68. print("|cffffff00"..L_INVITE_ENABLE..C.automation.invite_keyword..".|r")
  69. C.automation.invite_keyword = C.automation.invite_keyword
  70. end
  71. else
  72. SavedOptionsPerChar.AutoInvite = true
  73. print("|cffffff00"..L_INVITE_ENABLE..msg..".|r")
  74. C.automation.invite_keyword = msg
  75. end
  76. end
  77. SLASH_AUTOINVITE1 = "/ainv"
  78. SLASH_AUTOINVITE2 = "/фштм"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement