Thread: weak aura halp

  1. #1

    weak aura help

    so im trying to get a weak aura to work better then it does atm. i have one that shows my targets name and percent while in combat, but if i happen to lose target, or for some reason am forced to target nothing for any amount of time, it spams me with errors

    Code:
    deuhdaGii6suWOiuNIqwLsvmlfLClc6xkk1WavhdHLPu8me10GW1ayBI4BI04Ou6CiY6au17afDpke7dq4GasTqqPlcOYgvunsqHtcO0kjWmvQQUPsvANuQ6NuQmukKwQIINIAQe5QuO(kGI9k9xi1Gv4WKSyajpgQMmLCzHnRiFgKrtrNMkVgq0SHYTjQDlQFd0WHKLtvpNutx11vY2Pu8DLQY4vkDELk7hPlrLklx2QSvLkB50OWu7KITVSb8Y4l9bLLITV80kJFhywSiQa6GoOd6adexHrhOcpEKpDye6qSXz3HrOWUPyKx5HIJu0Sno7omcf2n3RARyKx5HIJuKi6yp0bbC4WKkGoOd6Go8Xx(mDigPbnDiKom4myWGbKIa(jqVS6Ino7U9k5qmYR8qXrkIoMfDGk84r(0bDa6Pd4IGjvqKTkVZUPjD8oxycCaePWttHJGmbHTeB6KqejL9bKdmlTdvu(X2x(Eheu4Ruz8L(GYOnDwr57KdRYFhQOS(QV0Lx6aTzOWUzHT8kh2e5x(o5WQm(sFqz0FhQOS(QV0Lndf2nrdIk8Qd6ldegP8shOxz3lSLndf2nltuELDV8vEO4LXndCGS8cLL6r5WMiFD5Y4l9bLltfqf0xELV3bbf(kvgFPpOCzQaQGYRS7LVYdfVV8(Cw3SZtjdGmaYK3SHucjeKst6Kqeak7SkFLhkoDKvYr58swY7GGcVU2tuERDtt64DUqeKiLqKKscarkXMnjW7KqejLndhK578KuaaiNcWwcBtjdiHiPtcrqQSoWMmkOl)Y7h4MlvgduzvPYlDGghtP1f2YEqSOsLLxy3vP((YlDGghugOuVWwghtP1vQS2LHWIYadqpZmaRDZ03xwzz5UdmRWqFVdck86k13xwx2NKw2MApbcc49Ta
    is the offending aura, and the part doing all the work is

    Code:
    function()
        local percent = (UnitHealth("target")/UnitHealthMax("target")) * 100;
        return ("%s - %i%%%%"):format(UnitName("target") , percent  or 0);
    end
    it works perfectly while in combat and i have a target, just trying to prevent the error spam upon losing a target
    Last edited by bargiddle; 2014-08-13 at 04:13 PM.

  2. #2
    This should work:

    Code:
    function()
    	if not UnitExists("target") then return "" end;
    	local percent = (UnitHealth("target")/UnitHealthMax("target")) * 100;
    	return ("%s - %i%%%%"):format(UnitName("target") , percent  or 0);
    end

  3. #3
    thank you, works awesome

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •