Thread Tools Display Modes
04-27-07, 06:53 PM   #1
sirspikey
A Deviate Faerie Dragon
 
sirspikey's Avatar
Join Date: Feb 2007
Posts: 19
capture an event arg1

I'm using the CHAT_MSG_SPELL_PERIODIC_CREATURE_BUFFS and I want my little function here to compare the arg1 from the event (wich returns: *some1 gains: *something") with the table of spells. And when it finds a spell it will add 1 to M

it works if I type the string directly in the code string.find("Restoration",spel) or make a_buff="Restoration" -BUT it don't work ingame?!?! I debugged it with DEFAULT_CHAT_FRAME:AddMessage(arg1) to se if the event really return a string, and it did

Code:
M=0

DispellType_Magic{
	"Mighty Rage",
	"Greater Dreamless Sleep",
	"Living Free Action",
	"Major Dreamless Sleep",
	"Restoration"
        }


  if (event~="CHAT_MSG_SPELL_AURA_GONE_OTHER") then 
    a_buff=arg1
    for i,spell in ipairs(DispellType_Magic) do
        a=string.find(a_buff,spell)
        if (a~= nil) then M=M+1; break;
        end
    end
 
  end
(this is not the whole code)

Where do I go wrong?!?!
  Reply With Quote
04-27-07, 09:40 PM   #2
Riraito
An Aku'mai Servant
 
Riraito's Avatar
Join Date: Dec 2006
Posts: 32
I had a very similar problem awhile back, where it worked fine manually, but didn't work otherwise, and debugging it showed it working right, my problem was that I had two different 'arg1's from 2 different places, not sure if thats the problem here, but maybe you should check that, just a thought
__________________
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » capture an event arg1


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