Thread Tools Display Modes
12-18-10, 12:30 AM   #1
Djinnrb
A Murloc Raider
Join Date: Dec 2009
Posts: 5
Auto Reply

I was looking around and couldn't find an addon that could help me. I was wondering if there was an addon that you could set a trigger and when whispered that trigger you automatically reply back with a message.

ex.
Someone:guildinfo
Me:Blah Blah is recruiting because blah blah

or

Someone:!shop
Me:Buying Blah Blah for this much plz COD.

I would like something with multiple triggers. If there isnt something like this around is it possible someone could make it?
  Reply With Quote
12-18-10, 04:20 AM   #2
Vlad
A Molten Giant
 
Vlad's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2005
Posts: 793
The thing with these kind of addons are that usually you have to also code some function so that the replies are dynamic and not just static -but as long "!shop" does not change you can actually make a very simple addon yourself! I'll show an example using a example addon name: DjinnrbMod

1. Make a folder called "DjinnrbMod" then go inside that folder
2. Create a file called "DjinnrbMod.toc" then...
3. Put this in the .toc file:
Code:
## Interface: 40000
## Title: My first addon!
AutoReply.lua
4. Create a file called "AutoReply.lua" then...
5. Put this in the AutoReply.lua file:
Code:
local timelock, messages = {}, {}

-- used by the addon below, on line 23
messages["shop"] = [[Hello!
This is a test message.
- Bye!
]]

local frame = CreateFrame("Frame")
frame:RegisterEvent("CHAT_MSG_WHISPER")
frame:SetScript("OnEvent", function(self, event, msg, author, ...)

  -- handle whispers we receive
  if event == "CHAT_MSG_WHISPER" then

    -- check if the message is a specific keyword
    if msg:lower():find("^!shop") then -- this means "!shop junktext" will also trigger

      -- make sure we avoid spam and reply to one message each second (if user spams "!shop" it will not spam back)
      if GetTime() - (timelock[author] or 0) > 1 then

        -- we reply with our static message (take note of the ":replace(...)" part, because if the message contains new lines the game only sends the first line. this will make messages with new lines simply show on one line)
        SendChatMessage(messages["shop"]:replace("\n", " "), "WHISPER", nil, author)

        -- this will keep track of when we last got a message from him
        timelock[author] = GetTime()

      end

    end

  end

end)
This is just a example, when you put that folder in the Interface\Addons folder of the game, when you startup and look in "Addons" you should see it showing. When you then receive "!shop" commands you will reply with a default message. Note that new lines are converted to space instead, can't send new lines trough the chat.
  Reply With Quote
12-18-10, 06:03 AM   #3
SaraFdS
A Fallenroot Satyr
 
SaraFdS's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 24
Or you could check out AutoRespond, it's pretty old but still working fine (at least, when I last used it..)
__________________
Sará the Insane
  Reply With Quote
12-18-10, 08:06 AM   #4
Djinnrb
A Murloc Raider
Join Date: Dec 2009
Posts: 5
Thats pretty awesome thank you.
  Reply With Quote
12-18-10, 11:56 AM   #5
Sythalin
Curse staff
 
Sythalin's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2006
Posts: 680
AutoNo is coded similar to what you are looking for. Feel free to reference it as well to help you out.
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Search/Requests » Auto Reply


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