Thread Tools Display Modes
09-25-10, 02:23 PM   #1
Nobgul
A Molten Giant
 
Nobgul's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2009
Posts: 693
Snippet of code

Looking for a small snippet of code where.

when you loot a body,mine,herb w/e it may be if a certain item is looted it will message a target GUILD,SAY,PARTY,RAID w/e it may be with the item that was looted. I don't need it to be all items just certain items in a local table i guess.
__________________
[SIGPIC][/SIGPIC]
  Reply With Quote
09-26-10, 02:19 AM   #2
Xubera
A Cobalt Mageweaver
 
Xubera's Avatar
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 207
Try that, I left you to decide how the send chat message would work

Code:
local itemIDTable = {}
  itemIDTable["2589"] = true --Linen Cloth

local f = CreateFrame("Frame")
f:RegisterEvent("CHAT_MSG_LOOT")
f:SetScript("OnEvent", function(self, event, ...)
    local msg = ...
    if msg:find("\124Hitem:%d+") then
        local id = msg:match("\124Hitem:(%d+)")
        if itemIDTable[id] then
            SendChatMessage()
        end
    end
end)
__________________
Chat Consolidate is the solution to any out of control trade chat. Ignore lines, throttle chat, consolidate posts!Follow the link to find out how!

▲ ▲ WoWInterface wont let me triforce >.>

Last edited by Xubera : 09-26-10 at 02:21 AM. Reason: forget a parenthesis
  Reply With Quote
09-26-10, 08:51 AM   #3
Nobgul
A Molten Giant
 
Nobgul's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2009
Posts: 693
Thank You,

I will check it in a bit.
__________________
[SIGPIC][/SIGPIC]
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Snippet of code


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