Thread Tools Display Modes
05-24-14, 02:32 PM   #1
Rothbard
A Defias Bandit
Join Date: May 2014
Posts: 2
Question Regarding Rage Counter

After what I have understood it is not possible to return_rage() by using lua. However is it possible to track rage? Say I set rage to zero before a boss fight, since I know what creates rage could I then track the rage throughout the fight?

If this is possible, could I then put in some "if" statements to tell me which spell to cast, so that a graphic appeared on the screen?
  Reply With Quote
05-24-14, 04:23 PM   #2
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
You mean your own rage? What's wrong with using the UNIT_POWER event and the UnitPower function?
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
05-24-14, 11:09 PM   #3
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Originally Posted by Rothbard View Post
After what I have understood it is not possible to return_rage() by using lua.
I'm not sure what resources you're looking at, but either you're looking at the wrong resources, or you're not understanding what you're reading at all, because there is no such function as "return_rage" in the WoW API.

Here is a list of the API functions that exist in WoW:
http://wowpedia.org/API

And here is an example of registering for the event that tells you when you gain or lose power (including rage) and keeping track of how much you gained or lost since the last change:
Code:
local prev
local f = CreateFrame("Frame")
f:RegisterUnitEvent("UNIT_POWER", "player")
f:SetScript("OnEvent", function(self, event, unit, powerType)
     if powerType ~= "RAGE" then return end
     local rage = UnitPower(unit)
     if prev then
          local diff = rage - prev
          if diff > 0 then
               print("You gained", diff, "rage!")
          elseif diff < 0 then
               print("You lost", diff, "rage!")
          end
     end
     prev = rage
end)
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.

Last edited by Phanx : 05-24-14 at 11:12 PM.
  Reply With Quote
05-25-14, 04:36 AM   #4
Rothbard
A Defias Bandit
Join Date: May 2014
Posts: 2
I have not played wow in about 3 years, and have not written in lua, though I have some programming experience. So my former question was out of ignorance of all function. But from what I understand of your replies, thanks for them, I can in fact make a program that tracks my rage and says something like "if rage is above 60" then show icon CS on screen.

If this is possible then I would like to start writing a program. I just wanted to know the feasibility of my project.

Thanks again for your time.
  Reply With Quote
05-25-14, 07:21 AM   #5
Dridzt
A Pyroguard Emberseer
 
Dridzt's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2005
Posts: 1,360
I think instead of trying to make an addon from scratch it would serve you best to use one of the existing addons that put notifications on the screen or flash actionbuttons and just make the triggers you want.

WeakAuras / PowerAuras for the first category or something like SpellFlash for the second.
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Search/Requests » Question Regarding Rage Counter

Thread Tools
Display Modes

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