Thread Tools Display Modes
Prev Previous Post   Next Post Next
04-23-06, 07:39 PM   #1
Vardelm
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: Jan 2006
Posts: 15
help finding a buff's index value?

I'm trying to create a function where I can give the name of a buff and the function will return the value of the index for that buff. Here's what I have so far, but it isn't working.

Code:
function GetBuffIndex(thisBuff)
  local counter = 1
  while (UnitBuff("player", counter)) do
    if (string.find(UnitBuff("player", counter), thisBuff)) then
      local buffIndex = counter;
    end
    counter = counter + 1
  end
  return buffIndex
end
Any suggestions on how to get this working? I've tried a bunch of small changes without luck so far. Maybe someone even has a function out there that does this already....?????
  Reply With Quote
 

WoWInterface » Developer Discussions » Lua/XML Help » help finding a buff's index value?


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