Advertisement
Guest User

EVFollow

a guest
Nov 18th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.70 KB | None | 0 0
  1. --Commands
  2. --/ev -- Slaves follow /ev user and give lead
  3. --/ev sq -- Invites from friends list with "squad" in notes. Slaves only autoaccept master.
  4. SLASH_EVF1="/ev"
  5. SlashCmdList["EVF"]=function(msg)
  6. SendAddonMessage("EVF", msg, "PARTY" and "RAID")
  7. if (msg == "sq") then
  8. SquadUp()
  9. end
  10. end
  11.  
  12. local SendRecieve = function(self, event, prefix, message, channel, sender)
  13. if event == "CHAT_MSG_ADDON" then
  14. if (prefix == "EVF") then
  15. if (message == "") then
  16. FollowUnit(sender)
  17. if (UnitIsPartyLeader(sender)~= 1) then
  18. PromoteToLeader(sender)
  19. end
  20. end
  21. end
  22. if (prefix == "EVR") then
  23. if (message == "master?") then
  24. SendAddonMessage("EVR", "Padawan", "WHISPER", sender)
  25. end
  26. if (message == "Padawan") then
  27. AcceptGroup()
  28. StaticPopup_Hide("PARTY_INVITE")
  29. end
  30. end
  31.  
  32. end
  33. if event == "PARTY_INVITE_REQUEST" then
  34. SendAddonMessage("EVR", "master?", "WHISPER", prefix)
  35.  
  36.  
  37. end
  38. end
  39.  
  40. function dosomeit()
  41. sdm_RunScript("Dance")- Run Blocked LUA from SuperDuperMacro
  42. --check for SDM addon
  43. --Create SDM Lua workaround if not present.
  44. --sdm_CreateNew("s", "test", character) -- Create New SDM scirpt
  45. end
  46.  
  47. function SquadUp()
  48. local Friends =GetNumFriends()
  49. for i = 1, Friends do
  50. local name, level, class, loc, connected, status, note = GetFriendInfo(i);
  51. if (connected) and (note == "squad") then
  52. InviteUnit(name)
  53. end
  54.  
  55. end
  56. end
  57.  
  58.  
  59.  
  60.  
  61. local EVF = CreateFrame("Frame")
  62. EVF:RegisterEvent("PARTY_INVITE_REQUEST")
  63. EVF:RegisterEvent("CHAT_MSG_ADDON")
  64. EVF:SetScript("OnEvent", SendRecieve)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement