Quantcast Need help with WA2 script for mana percentage - WoWInterface
Thread Tools Display Modes
07-22-18, 09:47 AM   #1
Kenjub
A Murloc Raider
Join Date: Jul 2018
Posts: 6
Need help with WA2 script for mana percentage

Hi! This worked fine pre 8.0, but as of 8.0 it just doesn't display anything:

Code:
function()
    local percent = (UnitMana("player")/UnitManaMax("player"))*100
    return floor(percent+0.5).."%"
end
what's wrong? Thanks!
  Reply With Quote
07-22-18, 10:58 AM   #2
Ammako
A Frostmaul Preserver
 
Ammako's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2016
Posts: 256
https://www.townlong-yak.com/framexm..._7_2_0.lua#172
__________________
  Reply With Quote
07-22-18, 04:30 PM   #3
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,541
What Ammako is saying is that those functions have been deprecated for some time and were finally removed. Now you have to use their replacements.
__________________
"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
09-16-18, 05:58 AM   #4
Kenjub
A Murloc Raider
Join Date: Jul 2018
Posts: 6
Undestood it from his reply but thanks (forgot to reply originally)

However what I need is alternate power percentage (in this case, Shadowpriest mana bar that shows below insanity bar). Any suggestions?
  Reply With Quote
09-16-18, 09:39 AM   #5
Kanegasi
A Frostmaul Preserver
 
Kanegasi's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2007
Posts: 264
The Enum.PowerType.Mana shown in the linked code is a number. Here’s the full table:

Lua Code:
  1. Enum = {
  2.     PowerType = {
  3.         Alternate = 10,
  4.         ArcaneCharges = 16,
  5.         Chi = 12,
  6.         ComboPoints = 4,
  7.         Energy = 3,
  8.         Focus = 2,
  9.         Fury = 17,
  10.         HealthCost = -2,
  11.         HolyPower = 9,
  12.         Insanity = 13,
  13.         LunarPower = 8,
  14.         Maelstrom = 11,
  15.         Mana = 0,
  16.         None = -1,
  17.         NumPowerTypes = 19,
  18.         Obsolete = 14,
  19.         Obsolete2 = 15,
  20.         Pain = 18,
  21.         Rage = 1,
  22.         Runes = 5,
  23.         RunicPower = 6,
  24.         SoulShards = 7,
  25.     },
  26. }

Last edited by Kanegasi : 09-16-18 at 10:31 AM. Reason: tabs > spaces; sorted; removed brackets and quotes
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Need help with WA2 script for mana percentage

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