Thread Tools Display Modes
Prev Previous Post   Next Post Next
04-23-13, 03:57 AM   #1
Spawnova
A Warpwood Thunder Caller
 
Spawnova's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2012
Posts: 96
simple addon not working

I have an addon I would like to print a line once a certain item is looted/receieved
but it never seems to do anything past "if event=="


Code:
    local SKF = CreateFrame("frame")
	local playerName = UnitName("player")
	local keyName = "Scallions"

    SKF:RegisterEvent("CHAT_MSG_LOOT")
    SKF:SetScript("OnEvent",function(self,event,message)
		if event=="CHAT_MSG_LOOT" then
			local msg = string.gsub(message, "[", "")
                        print "event fired" --never fires
			if string.match(msg,"You receive item: " .. keyName) then
				print "looted"
			end
		end
    end)
  Reply With Quote
 

WoWInterface » Developer Discussions » Lua/XML Help » simple addon not working


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