Thread Tools Display Modes
04-17-08, 03:26 PM   #1
phaze112
A Deviate Faerie Dragon
Join Date: Mar 2007
Posts: 10
Easy Hello World On Event Question (newbie)

I am trying to do a simple display of Hello World when a certain combat log event matches what I am looking for but I feel I am doing something wrong.


__________________

function HelloWorld(self,event,...)

frame:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
frame:SetScript("OnEvent", function(self, event, ...)
self[event](...)
end)
local spellID, spellName
frame.COMBAT_LOG_EVENT_UNFILTERED = function(...)
if arg2 == "SPELL_AURA_APPLIED" then
spellID = arg9
spellName = GetSpellInfo(spellID)
if spellName == "Fel Armor" then
message("Hello World!");
end
end
end


end

____________

This is just a simple modification of the HelloWorld tutorial blizz provides so the xml and toc are the same as the tutorial.

Thanks all and this basic problem I am having will solve so many of my questions thank you alot

Travis
  Reply With Quote
04-17-08, 05:49 PM   #2
ganders
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: May 2007
Posts: 131
Code:
DEFAULT_CHAT_FRAME:AddMessage("Hello World!")
Also, you need to add
Code:
local frame = CreateFrame("Frame")
at the very beginning of the file.

Delete your XML file. You don't need one for something like this.

Make sure your TOC looks like:
Code:
## Interface: 20400
## Author: phaze112
## Title: HelloWorld!
## Notes: Test addon of freakin' awesomeness!
helloworld.lua
Obviously replace helloworld.lua with the actual file name.

Last edited by ganders : 04-17-08 at 05:55 PM.
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » Easy Hello World On Event Question (newbie)


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