Auto reply addon?

UI and Macro
Hello, I was going to make a buylist of items that I was looking for, but first I was trying to find an addon that auto whispered ppl back a message that i set. So if someone whispers me !buylist or just buylist it auto replies with the stuff that I am buying.

Any help would be appreciated thanks.
That's rather specific. Addon wise the closest to it that I can think of is AutoTrade which will let you specify trigger words, and also customize reply though it's set to also paste profession links.
Thank you for the answer. Yes I am looking for an addon similiar to this. I know with the auctioneer addon as well if someone whispers you !Elementium Ore, it auto replies with data about it, so I was trying to see if there was a similiar customizable addon.
I've just written an AddOn to do this. Use /buylist or /bl in-game to display the help.

To make the AddOn, copy/paste the code blocks below into their own empty text documents and save them with the specified name/extension (capitalisation is important). Make sure you don't save them as .txt files. Once you have both files, move them to a new folder called BuyList in your Interface\AddOns\ folder.

BuyList.toc## Interface: 40300
## Title: BuyList
## Version: 1.0
## Author: Choonster
## Notes: Automatically responds to whispers starting with "buylist" or "!buylist" with a specified response.
## SavedVariables: BUYLISTDB

core.lua


core.lualocal addon, ns = ...
local db;
local prefix = "|cff33ff99BuyList|r:"
local TAB = ("%4s"):format("")
local tabs = setmetatable({}, {
__index = function(t, key)
if type(key) ~= "number" then return end
local str = ""
for i = 1, key do
str = str .. TAB
end
rawset(t, key, str)
return str
end
})

local f = CreateFrame("Frame")
f:RegisterEvent("ADDON_LOADED")
f:RegisterEvent("CHAT_MSG_WHISPER")
f:SetScript("OnEvent", function(self, event, ...)
self[event](self, ...)
end)

function f:ADDON_LOADED(name)
if addon == name then
BUYLSITDB = BUYLISTDB or {enabled = true}
db = BUYLISTDB
end
end

function f:CHAT_MSG_WHISPER(msg, author)
if db.enabled and db.msg and (msg:sub(1, 8) == "!buylist" or msg:sub(1, 7) == "buylist") then
SendChatMessage(db.msg, "WHISPER", nil, author)
end
end

SLASH_BUYLIST1, SLASH_BUYLIST2 = "/buylist", "/bl"

SlashCmdList.BUYLIST = function(input)
input = input:trim()
local lower = input:lower()

if lower == "enable" then
db.enabled = true
print(prefix, "Enabled")
elseif lower == "disable" then
db.enabled = false
print(prefix, "Disabled")
elseif input ~= "" then
db.msg = input
print(prefix, ("Message set to %q."):format(input))
else
print(prefix, "Slash Command Usage")
print(tabs[1], "|cffff0000/buylist|r or |cffff0000/bl enable||disable||message|r")
print(tabs[2], "|cffff0000enable|disable|r -- Enable/disable automatic replies.")
print(tabs[2], "|cffff0000message|r -- Set the reply message to |cffff0000message|r.")
print(tabs[2], "Using the slash command without arguments will display this help.")
end
end
Idk if you will see this.

I am trying to get this to work and I was able to get the files going and everything, but when I do /buylist or anything of that nature nothing happens, and I get the standard Wow chat thing that says type /help for more info.
Idk if you will see this.

I am trying to get this to work and I was able to get the files going and everything, but when I do /buylist or anything of that nature nothing happens, and I get the standard Wow chat thing that says type /help for more info.

Do you have the AddOn enabled at the character selection screen (and have "Load out of date AddOns" checked)?

What does this output in-game?/dump IsAddOnLoaded("BuyList")
Yes it is loaded.

1. 1 for the output.

The formatting of the lua and toc files should appear as they do in the box you listed correct?
You should have a BuyList.toc file with the contents of the first code block and a core.lua file with the contents of the second code block.

Do you get any Lua errors? Make sure you have them enabled from the Interface > Help menu.
NO Lua errors. When typing /buylist all I simply get is "Type '/help' for a listing of a few commands."

All the codes are in there correctly. I jsut double checked.
NO Lua errors. When typing /buylist all I simply get is "Type '/help' for a listing of a few commands."

All the codes are in there correctly. I jsut double checked.

That's very strange. What does this output?/dump SlashCmdList.BUYLIST
nil
10/10/2012 03:28 PMPosted by Kyross
nil

What about this:/dump SLASH_BUYLIST1, SLASH_BUYLIST2
nil, nil
It seems the Lua code isn't being loaded properly. Are you sure you named the file core.lua (not core.lua.txt or anything else) and copy/pasted the two code blocks properly?
Got it to work, or load. It listed the info when I typd /buylist this time.

I did get a lua error:

...\AddOns\BuyList\core.lua line 50: attempt to index upvalue 'db' (a nil value)

and when whispering my self i got:

...\AddOns\BuyList\core.lua line 32: attempt to index upvalue 'db' (a nil value)

Join the Conversation

Return to Forum