Thread Tools Display Modes
01-20-17, 03:43 PM   #21
pas06
A Theradrim Guardian
Join Date: Apr 2009
Posts: 62
No problem, i hope it works as expected in every situation and i didn't forgot anything
  Reply With Quote
01-20-17, 10:03 PM   #22
Tosaido
A Fallenroot Satyr
 
Tosaido's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2015
Posts: 23
Apologies, i now see the error in the code i posted in post #15, which for some reason hid from me.

i like the approach Pas has posted... Less if and function calls can only help.

although i would add [Ticker = -1], with out it, the loop won't stop.
You also don't need the [duration, expires] variables anymore

Lua Code:
  1. local function UNIT_AURA()
  2.     if UnitDebuff("player", TaintOfTheSea) then
  3.         if not debuffexists then
  4.             debuffexists = true --player just got the debuff
  5.             Ticker = 8
  6.             UpdateTicker()
  7.         end
  8.     else
  9.         Ticker = -1
  10.         debuffexists = false -- doesn't exist
  11.     end
  12. end
  Reply With Quote
01-21-17, 05:10 AM   #23
pas06
A Theradrim Guardian
Join Date: Apr 2009
Posts: 62
I guess you missed the change in line 8 that i made. That's what causes the loop to stop.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » UnitDebuff() + GetSpellInfo()


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