Thread Tools Display Modes
02-05-14, 10:56 AM   #1
Dimmulux
A Deviate Faerie Dragon
Join Date: Feb 2014
Posts: 17
Post Addon that automatically whispers people when they join group.

I am looking for an add-on that automatically whispers people a preset message when they join my group.

The use of the add-on would be to inform people of what the group is for (in case they've made a mistake) and provide relevant information (such as voice server details). It would be very helpful for this to be done automatically so that the leader can spend more time organising the group or LFMing.

Does anyone know of an add-on that has this feature? If no such addon exists, would anyone want to create it?

Note: this was initially posted at http://eu.battle.net/wow/en/forum/topic/9051726863 . I have still not found a solution since I posted there and it was suggested I try asking here.
  Reply With Quote
02-05-14, 12:09 PM   #2
Malsomnus
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Apr 2013
Posts: 203
If you don't find an add-on that does this, this might be a nice addition to an add-on I have
__________________
SanityCheck - If you've ever said the words "Sorry, I forgot" then you need this add-on.

Remember, every time you post a comment on an add-on, a kitten gets its wings!
  Reply With Quote
02-05-14, 12:43 PM   #3
10leej
A Molten Giant
 
10leej's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2011
Posts: 583
Originally Posted by Malsomnus View Post
If you don't find an add-on that does this, this might be a nice addition to an add-on I have
I don't think an addon like this exists.
__________________
Tweets YouTube Website
  Reply With Quote
02-06-14, 04:03 AM   #4
Sharparam
A Flamescale Wyrmkin
 
Sharparam's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2011
Posts: 102
I thought this would be a lot simpler to implement, but then I was reminded about cross-realm and all the issues that brings. I wrote something up that might work:

lua Code:
  1. -- Add SHARPARAM_GROUP_WHISPER to SavedVariables to persist the settings
  2. SHARPARAM_GROUP_WHISPER = SHARPARAM_GROUP_WHISPER or {}
  3.  
  4. local opt = SHARPARAM_GROUP_WHISPER
  5.  
  6. opt.enabled = true
  7. op*****ssage = op*****ssage or "Welcome to the group!"
  8.  
  9. local members = {}
  10.  
  11. local PARTY_UNITS = {
  12.     "party1",
  13.     "party2",
  14.     "party3",
  15.     "party4",
  16.     "party5"
  17. }
  18.  
  19. -- Helper function to get a list of group members
  20. local function getGroupMembers()
  21.     local result = {}
  22.     if IsInRaid() then
  23.         for i = 1, GetNumGroupMembers() do
  24.             local name = GetRaidRosterInfo(i)
  25.             if not name:match("%w+-%w+") then
  26.                 -- Try to get realm from UnitName func
  27.                 local _, realm = UnitName(name)
  28.                 -- Fall back to using player realm
  29.                 if not realm then realm = GetRealmName() end
  30.                 name = ("%s-%s"):format(name, realm)
  31.             end
  32.             result[#result + 1] = name
  33.         end
  34.     else
  35.         for _, unit in pairs(PARTY_UNITS) do
  36.             local name, realm = UnitName(unit)
  37.             if not realm then realm = GetRealmName() end
  38.             result[#result + 1] = ("%s-%s"):format(name, realm)
  39.         end
  40.     end
  41.     return result
  42. end
  43.  
  44. -- Loop through members and message anyone new to the group
  45. local function updateMembers()
  46.     if not opt.enabled or not IsInGroup() or not UnitIsGroupLeader("player") then
  47.         wipe(members)
  48.         return
  49.     end
  50.    
  51.     for _, v in pairs(getGroupMembers()) do
  52.         -- New member? Great! Let's message them
  53.         if not members[name] then
  54.             sendMessage(name)
  55.             -- Add them to list so they don't get messaged again
  56.             members[name] = true
  57.         end
  58.     end
  59. end
  60.  
  61. -- Gets the full player name string (name-realm) of the current player
  62. local function getFullPlayerName()
  63.     local name, realm = UnitName("player")
  64.     if not realm then realm = GetRealmName() end
  65.     return ("%s-%s"):format(name, realm)
  66. end
  67.  
  68. local function sendMessage(name, realm) -- realm param currently unused
  69.     realm = realm or GetRealmName()
  70.     if not name:match("%w+-%w+") then
  71.         name = ("%s-%s"):format(name:match("%w+"), realm)
  72.     end
  73.     if name == getFullPlayerName() then return end
  74.     SendChatMessage(op*****ssage, "WHISPER", nil, name)
  75. end
  76.  
  77. local frame = CreateFrame("Frame")
  78.  
  79. frame:SetScript("OnEvent", function(self, event, ...)
  80.     updateMembers()
  81. end)
  82.  
  83. frame:RegisterEvent("GROUP_JOINED")
  84. frame:RegisterEvent("GROUP_ROSTER_UPDATE")
  85. frame:RegisterEvent("INSTANCE_GROUP_SIZE_CHANGED")
  86. frame:RegisterEvent("PARTY_MEMBERS_CHANGED")
  87. frame:RegisterEvent("RAID_ROSTER_UPDATE")
  88.  
  89. SLASH_SHARPARAMGROUPWHISPER1 = "/sharpgw"
  90.  
  91. SlashCmdList["SHARPARAMGROUPWHISPER"] = function(e, msg)
  92.     local cmd, arg = msg:match("(%w)%w*(.*)")
  93.     if cmd == "t" then -- toggle
  94.         opt.enabled = not opt.enabled
  95.         print("Group whisper is now " .. (opt.enabled and "enabled" or "disabled"))
  96.     elseif cmd == "m" then -- set message
  97.         -- dirty workaround to skip the first space
  98.         op*****ssage = arg:gsub("^ ", "")
  99.         print("Update group whisper message!")
  100.     end
  101. end

PLEASE NOTE: I am not sure if this code will work with player names using unicode characters.

Last edited by Sharparam : 02-06-14 at 04:56 PM. Reason: Updated code with savedvars and slash command
  Reply With Quote
02-06-14, 06:27 AM   #5
Duugu
Premium Member
 
Duugu's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 851
Is wipe() a standard function? Never heared of it.
  Reply With Quote
02-06-14, 06:33 AM   #6
Sharparam
A Flamescale Wyrmkin
 
Sharparam's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2011
Posts: 102
It's a function in the WoW API to clear a table's values. I believe it's not available in standard Lua.
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Search/Requests » Addon that automatically whispers people when they join group.


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off