Thread Tools Display Modes
11-16-11, 01:18 PM   #1
adrianutrilla
A Deviate Faerie Dragon
Join Date: Jul 2011
Posts: 10
LF addon

I'm looking for an addon that, when someone whispers me, autoanwser some predefined phrase.
Thanks!
  Reply With Quote
11-16-11, 01:56 PM   #2
Vlad
A Molten Giant
 
Vlad's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2005
Posts: 793
How about "/ar <message>" i.e. "/ar Call me 1-800-LOVE" would make you whisper that to anyone that whispers you once each 5 minutes (i.e. if they wait a while and whisper you after 5 minutes you whisper them that again).

If you like it I can make it. :P

Include or exclude guildies, friends, party/raid members?
  Reply With Quote
11-16-11, 02:09 PM   #3
adrianutrilla
A Deviate Faerie Dragon
Join Date: Jul 2011
Posts: 10
Originally Posted by Vladinator View Post
How about "/ar <message>" i.e. "/ar Call me 1-800-LOVE" would make you whisper that to anyone that whispers you once each 5 minutes (i.e. if they wait a while and whisper you after 5 minutes you whisper them that again).

If you like it I can make it. :P

Include or exclude guildies, friends, party/raid members?
I'm trying to make, it, but new to addon programming. This is what i have:
if event == CHAT_MSG_WHISPER
then SendChatMessage("Hola", 'WHISPER', 'nil', player??)
end
where i wrote player it is because i dont really know what to write..
  Reply With Quote
11-16-11, 02:12 PM   #4
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
http://wowprogramming.com/docs/events/CHAT_MSG_WHISPER gives you the same of the sender with its arguments.
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
11-16-11, 02:18 PM   #5
adrianutrilla
A Deviate Faerie Dragon
Join Date: Jul 2011
Posts: 10
Originally Posted by Seerah View Post
http://wowprogramming.com/docs/events/CHAT_MSG_WHISPER gives you the same of the sender with its arguments.
So.. how should i use it?Sorry, i'm noob
  Reply With Quote
11-16-11, 03:13 PM   #6
adrianutrilla
A Deviate Faerie Dragon
Join Date: Jul 2011
Posts: 10
Bump!!!!!!!!!
  Reply With Quote
11-16-11, 05:53 PM   #7
Dridzt
A Pyroguard Emberseer
 
Dridzt's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2005
Posts: 1,360
Code:
local eventframe = CreateFrame("frame")
local mymessages = {"Wazzup", "Yo", "Hello"}
local function mychatfunc(self,event,...)
	local messg, sender = ...
	SendChatMessage(mymessages[random(1,3)].." "..sender.."!","WHISPER",nil,sender)
end
eventframe:SetScript("OnEvent", mychatfunc)
eventframe:RegisterEvent("CHAT_MSG_WHISPER")
Note that this is just example code for you to study.

In actual practice it would reply to any whisper with the same automated reply regardless if it's the first time someone sends a tell or the 10th.
It would lead to some very nonsensical conversations.

If you want everyone that /w you to get a predefined message it's easier to just set your dnd or away message with
/dnd your message here
/afk your message here
  Reply With Quote
11-16-11, 06:43 PM   #8
Torhal
A Pyroguard Emberseer
 
Torhal's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2008
Posts: 1,196
BTW: Bumping a thread less than an hour after you post in it is rather annoying. It isn't contributing anything to the conversation and makes the thread re-appear for no good reason to the people who had nothing to say in reply the first time they saw it.
__________________
Whenever someone says "pls" because it's shorter than "please", I say "no" because it's shorter than "yes".

Author of NPCScan and many other AddOns.
  Reply With Quote
11-16-11, 07:20 PM   #9
Vlad
A Molten Giant
 
Vlad's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2005
Posts: 793
Code:
local addonName, addon, lastReplies, reply = ..., CreateFrame("Frame"), {}
addon:RegisterEvent("CHAT_MSG_WHISPER")
addon:SetScript("OnEvent", function(addon, event, msg, sender, ...)
  if event == "CHAT_MSG_WHISPER" and reply then
    if GetTime() - (lastReplies[sender] or 0) > 60*5 then
      lastReplies[sender] = GetTime()
      SendChatMessage(reply, "WHISPER", nil, sender)
    end
  end
end)
SlashCmdList[addonName] = function(str)
  table.wipe(lastReplies)
  str = str:trim() or ""
  reply = str:len() > 0 and str or nil
  if reply then
    DEFAULT_CHAT_FRAME:AddMessage("Auto-reply: "..reply, 1, 1, 0)
  else
    DEFAULT_CHAT_FRAME:AddMessage("Auto-reply has been disabled.", 1, 1, 0)
  end
end
_G["SLASH_"..addonName.."1"] = "/ar"
You can put this in your .lua file, typing "/ar <message>" to put one there and "/ar" to remove it. People whispering you when you put a message will be whispered back (not each time, must past 5 minutes before you whisper them again to avoid spam, you can tweak it at the 60*5 part, set it to 30 for 30 seconds, e.g.). Each time you /ar this list is reset so the new message you make will clear the old timers and such.
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Search/Requests » LF addon


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