Reply
 
Thread Tools Display Modes
Old 04-10-12, 05:06 PM   #1
Caetan0
A Warpwood Thunder Caller
Join Date: Aug 2011
Posts: 92
request macro/addon

Friends of wowinterface ...

I am wanting to develop two functions for my wow, the one he should send a / w for all who are online in my guild (for macro), and second it will return to / r q a msg so I type /rts, eg , player "A" speaks for /w me, dae i type /rts and answer a pre-defined phrase to player "A"
Caetan0 is offline   Reply With Quote
Old 04-10-12, 06:00 PM   #2
Phanx
A Pyroguard Emberseer
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 2,619
Your post is really hard to read. Even (or perhaps especially!) if English is not your first language, making some effort to capitalize sentences, not type your whole post as one sentence, and splitting up the different ideas into different paragraphs would help a lot.

1. You want an addon/macro that will whisper the same message to all players in your guild.

I'm not sure this is possible due to Blizzard restrictions on the number of messages you can send in a short period of time. These restrictions are meant to prevent spamming. You can try this, but I'm not sure it will work:

Lua Code:
  1. local message
  2.  
  3. -- Create a slash command for sending the message:
  4. SLASH_GUILDWHISPER1 = "/gw"
  5. SlashCmdList.GUILDWHISPER = function(text)
  6.     if not text or text:len() < 1 then
  7.         -- No text was entered with the slash command.
  8.         -- Stop here.
  9.         return
  10.     end
  11.  
  12.     -- Update the message variable so the addon knows
  13.     -- to send a message.
  14.     message = text
  15.  
  16.     -- Ask the server for updated information about
  17.     -- your guild, such as who is online.
  18.     -- An event will fire when the server responds,
  19.     -- and we will send the message then.
  20.     GuildRoster()
  21. end
  22.  
  23. -- Create a frame to listen for the event telling us
  24. -- that the server has responded with information about
  25. -- your guild:
  26. local frame = CreateFrame("Frame")
  27. frame:RegisterEvent("GUILD_ROSTER_UPDATE")
  28. frame:SetScript("OnEvent", function()
  29.     if not message then
  30.         -- We did not cause this event, and have
  31.         -- no message to send. Stop here.
  32.         return
  33.     end
  34.  
  35.     -- Loop through each guild member:
  36.     for i = 1, GetNumGuildMembers() do
  37.         local name, _, rank, level, _, _, _, _, online, class = GetGuildRosterInfo(i)
  38.  
  39.         -- If they are online, send them the message:
  40.         if online then
  41.             SendChatMessage(message, "WHISPER", nil, name)
  42.         end
  43.     end
  44.  
  45.     -- Clear the message since we are done sending it:
  46.     message = nil
  47. end)

2. You want the "/rts" command to send a pre-defined message to the last person who whispered you.

Lua Code:
  1. local messages = {
  2.     ["default"] = "This is the default message.",
  3.     ["nothanks"] = "No thanks. I'm not interested.",
  4. }
  5.  
  6. SLASH_RTS1 = "/rts"
  7.  
  8. SlashCmdList.RTS = function(which)
  9.     -- Get the name of the last person who whispered you:
  10.     local name = ChatEdit_GetLastTellTarget()
  11.     if not name then
  12.         -- Nobody has whispered you yet.
  13.         return
  14.     end
  15.  
  16.     -- Look up which message to send:
  17.     local message = messages[which]
  18.  
  19.     -- If you typed a wrong message name, use the default one:
  20.     if not message then
  21.         message = messages["default"]
  22.     end
  23.  
  24.     -- Send the message:
  25.     SendChatMessage(message, "WHISPER", nil, name)
  26. end

You can type "/rts nothanks" to send the "No thanks. I'm not interested." message, or just "/rts" to send the default message. You can add new messages if you want, or delete the "nothanks" one. You can edit the text of the default message, but do not delete it.

If either of these do not work, please post the error message(s) they give you.
Phanx is offline   Reply With Quote
Reply

Go BackWoWInterface » AddOns, Compilations, Macros » AddOn Search/Requests » request macro/addon

Thread Tools
Display Modes

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