View Single Post
12-24-19, 09:38 AM   #1
cokedrivers
A Rage Talon Dragon Guard
 
cokedrivers's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2009
Posts: 325
[Retail] nPower not updated need help with error code.

Hello,
NeavUI has not been updated sence 08/27/18 some people have tried to do quick fixes but not everything is updated. One of the addons I use from it is called nPower and it works but keeps thowing me a error everytime a load screen comes up.

Here is the link to the GitHub for the addon to see the whole addon. nPower

the error code I am getting from BugGrabber is:
Code:
411x nPower\core.lua:209: attempt to perform arithmetic on local 'start' (a nil value)
nPower\core.lua:209: in function <nPower\core.lua:207>
nPower\core.lua:388: in function <nPower\core.lua:373>

Locals:
self = 1
start = nil
duration = nil
runeReady = nil
(*temporary) = <function> defined =[C]:-1
(*temporary) = 342594.828000
(*temporary) = 342594.828000
(*temporary) = nil
(*temporary) = "attempt to perform arithmetic on local 'start' (a nil value)"
It seems to only happen on my Deathknight. the chunk of code that is being referenced is:
Lua Code:
  1. local function CalcRuneCooldown(self)
  2.     local start, duration, runeReady = GetRuneCooldown(self)
  3.     local time = floor(GetTime() - start)
  4.     local cooldown = ceil(duration - time)
  5.  
  6.     if (runeReady or UnitIsDeadOrGhost("player")) then
  7.         return "#"
  8.     elseif (not UnitIsDeadOrGhost("player") and cooldown) then
  9.         return cooldown
  10.     end
  11. end

and this function only seems to show up in this bit of code at the end of the .lua:
Lua Code:
  1. if (f.Rune) then
  2.     local updateTimer = 0
  3.     f:SetScript("OnUpdate", function(self, elapsed)
  4.         updateTimer = updateTimer + elapsed
  5.  
  6.         if (updateTimer > 0.1) then
  7.             for i = 1, 6 do
  8.                 if (UnitHasVehicleUI("player")) then
  9.                     if (f.Rune[i]:IsShown()) then
  10.                         f.Rune[i]:Hide()
  11.                     end
  12.                 else
  13.                     if (not f.Rune[i]:IsShown()) then
  14.                         f.Rune[i]:Show()
  15.                     end
  16.                 end
  17.  
  18.                 f.Rune[i]:SetText(CalcRuneCooldown(i))
  19.                 f.Rune[i]:SetTextColor(0.0, 0.6, 0.8)
  20.             end
  21.  
  22.             updateTimer = 0
  23.         end
  24.     end)
  25. end

Hopefully one of you awesome programmers have an idea why this keep throwing an error.

Thanks in advance for any help solving this issue.

Coke
  Reply With Quote