Thread Tools Display Modes
Prev Previous Post   Next Post Next
05-25-10, 05:35 AM   #1
mentalnutsy
A Cyclonian
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 47
Why cant i print spell info?

I know I am probably missing something obvious but cant work it out. Below is the code I am working with. The function is being called (highlighted below) but it just keeps returning nill.
(I'm not that good at lua and still learning so please simplify as much as possible thanks.)

Code:
NuttyWarAnnounce = LibStub("AceAddon-3.0"):NewAddon("NuttyWarAnnounce", "AceConsole-3.0", "AceEvent-3.0")

function NuttyWarAnnounce:OnInitialize()
    -- Called when the addon is loaded
end

function NuttyWarAnnounce:OnEnable()
self:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
end

function NuttyWarAnnounce:COMBAT_LOG_EVENT_UNFILTERED(event, timestamp, subevent, srcGUID, srcName, srcflags, dstGUID, dstname, dstflags, spellID)
	if UnitGUID("player") == srcGUID then
		if subevent == "SPELL_AURA_APPLIED" then
			if NuttyWarAnnounce.spellids.shouts[spellID] then			
				NuttyWarAnnounce:sendmessage()
				else if NuttyWarAnnounce.spellids.alerts[spellID] then
				NuttyWarAnnounce:spellcastcheck()
				end
			end
		end
		
		if subevent == "SPELL_AURA_REMOVED" then
			if NuttyWarAnnounce.spellids.shouts[spellID] then
				NuttyWarAnnounce:sendmessage()
			end 
		end
	end
end

	function NuttyWarAnnounce:spellcastcheck()
	print(spellid) --not working
	end
	
	function NuttyWarAnnounce:sendmessage()
	print ("test")
	end
NuttyWarAnnounce.spellids = {
	shouts= {
				[43308] = "find fish", --used for testing purposes--
				[6673] = "Battle Shout",
				[5242] = "Battle Shout",
				[6192] = "Battle Shout",
				[11549] = "Battle Shout",
				[11550] = "Battle Shout",
				[11551] = "Battle Shout",
				[25289] = "Battle Shout",
				[2048] = "Battle Shout",
				[47436] = "Battle Shout",

				[47440] = "Commanding Shout",
				[469] = "Commanding Shout",
				[47439] = "Commanding Shout",
			},
	alerts = {

				[1161] = "Challenging Shout",
				[871] = "Shied Wall",
				[64382] = "Shattering Throw",
				[12976] = "Last Stand",
				[676] = "Disarm",
			},
	taunts = {
				[355] = "Taunt",
				[694] = "Mocking Blow",
			},
}

Last edited by mentalnutsy : 05-25-10 at 05:37 AM. Reason: typo in thread name
  Reply With Quote
 

WoWInterface » Developer Discussions » Lua/XML Help » Why cant i print spell info?


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